* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font-family: system-ui, "Segoe UI", Arial, sans-serif; }
#map { position: absolute; top: 0; left: 0; right: 340px; bottom: 0; background: #aadaff; }

#panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: 340px;
  background: #f4f6f9; border-left: 1px solid #c4ccd6; overflow-y: auto;
  font-size: 12px; color: #1b2430;
}
.phead { display: flex; align-items: baseline; justify-content: space-between;
  padding: 10px 12px; background: #1f4e79; color: #fff; }
.phead h1 { font-size: 15px; margin: 0; letter-spacing: .5px; }
.cyc { font-size: 11px; color: #fff; text-decoration: none; opacity: .9; }
.cyc:hover { opacity: 1; text-decoration: underline; }
/* MapLibre: keep controls clear of the side panel; markers centered */
.maplibregl-ctrl-bottom-right { right: 350px; }
.wp-marker { cursor: pointer; }

.sect { padding: 10px 12px; border-bottom: 1px solid #e0e5ec; }
.sect-h { font-weight: 700; color: #1f4e79; font-size: 11px; text-transform: uppercase;
  letter-spacing: .5px; margin-bottom: 6px; }
.lyr { display: block; margin: 3px 0; cursor: pointer; }
.op { width: 100%; margin: 0 0 6px; height: 14px; }
.hint { color: #6b7686; font-size: 11px; margin-bottom: 8px; line-height: 1.35; }

.mini { float: right; margin-left: 6px; font-size: 10px; padding: 1px 7px;
  border: 1px solid #b9c2cf; background: #fff; border-radius: 3px; cursor: pointer; color: #1f4e79; }
.mini:hover { background: #e8eef6; }

table#legs { width: 100%; border-collapse: collapse; font-size: 11px; }
#legs th, #legs td { border: 1px solid #dde3ec; padding: 2px 3px; text-align: center; }
#legs thead th { background: #dce6f2; color: #13344f; font-weight: 600; line-height: 1.05; }
#legs th small { font-weight: 400; opacity: .7; font-size: 8.5px; }
#legs tbody tr:nth-child(odd) { background: #fff; }
#legs tbody tr:nth-child(even) { background: #eef2f7; }
#legs .fix { text-align: left; font-weight: 600; }
#legs tfoot td { background: #dce6f2; font-weight: 600; }

.readout { font-family: "Cascadia Code", Consolas, monospace; font-size: 11px;
  line-height: 1.5; color: #243; white-space: pre; }

.foot { padding: 8px 12px; color: #93a; color: #8893a3; font-size: 10px; }

/* numbered waypoint markers */
/* hollow ring: transparent center lets the GL waypoint dot + route line show through */
.wp-marker { background: transparent; color: #b1121b; border: 3px solid #d62828;
  border-radius: 50%; width: 24px; height: 24px; line-height: 18px; text-align: center;
  font-weight: 800; font-size: 11px; cursor: pointer;
  text-shadow: 0 0 2px #fff, 0 0 2px #fff, 0 0 3px #fff; }
.wp-marker.dep  { border-color: #2a9d8f; color: #1d7268; }
.wp-marker.dest { border-color: #1f4e79; color: #16395a; }

.leaflet-popup-content { font-size: 12px; }

/* navdata search box (floating over the map) */
#search { position: absolute; top: 10px; left: 52px; width: 320px; z-index: 5; font-size: 13px; }
#search-input { width: 100%; padding: 7px 10px; border: 1px solid #9aa7b6; border-radius: 5px;
  box-shadow: 0 1px 4px rgba(0,0,0,.25); font-size: 13px; }
#search-results { display: none; margin-top: 3px; background: #fff; border: 1px solid #c4ccd6;
  border-radius: 5px; box-shadow: 0 2px 8px rgba(0,0,0,.25); max-height: 320px; overflow-y: auto; }
.sr-row { display: flex; align-items: center; gap: 7px; padding: 5px 8px; cursor: pointer;
  border-bottom: 1px solid #eef1f5; }
.sr-row:hover { background: #eef4fb; }
.sr-ico { width: 14px; text-align: center; color: #1f4e79; }
.sr-code { font-weight: 700; color: #13344f; min-width: 56px; }
.sr-name { flex: 1; color: #555; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-add { border: 1px solid #b9c2cf; background: #f4f6f9; color: #1f4e79; border-radius: 4px;
  width: 22px; height: 22px; cursor: pointer; font-weight: 700; line-height: 1; }
.sr-add:hover { background: #1f4e79; color: #fff; }

.navlog-btn { width: 100%; margin-top: 8px; padding: 8px; border: 0; border-radius: 4px;
  background: #1f4e79; color: #fff; font-size: 12px; font-weight: 600; cursor: pointer; }
.navlog-btn:hover { background: #163a5c; }

/* nearby (double-click) modal */
.modal { position: absolute; inset: 0; z-index: 20; background: rgba(0,0,0,.25);
  display: flex; align-items: center; justify-content: center; }
.modal[hidden] { display: none; }
.modal-card { background: #fff; width: 400px; max-width: 92%; max-height: 80%; border-radius: 8px;
  box-shadow: 0 8px 30px rgba(0,0,0,.35); display: flex; flex-direction: column; overflow: hidden; }
.modal-h { display: flex; justify-content: space-between; align-items: center; background: #1f4e79;
  color: #fff; padding: 8px 12px; font-weight: 600; font-size: 13px; }
.modal-x { background: none; border: 0; color: #fff; font-size: 19px; cursor: pointer; line-height: 1; }
.modal-body { overflow-y: auto; padding: 2px 0; }
.nb-row { display: flex; align-items: center; gap: 6px; padding: 5px 10px;
  border-bottom: 1px solid #eef1f5; font-size: 12px; }
.nb-row.head { background: #eef4fb; }
.nb-ico { width: 15px; text-align: center; color: #1f4e79; }
.nb-main { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nb-main b { color: #13344f; }
.nb-sub { color: #667; font-size: 11px; }
.nb-meta { color: #1f4e79; font-variant-numeric: tabular-nums; white-space: nowrap;
  font-size: 11px; min-width: 86px; text-align: right; }
.nb-btn { border: 1px solid #b9c2cf; background: #f4f6f9; color: #1f4e79; border-radius: 4px;
  width: 24px; height: 24px; cursor: pointer; font-weight: 700; line-height: 1; }
.nb-btn:hover { background: #1f4e79; color: #fff; }
