* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font: 15px/1.4 Calibri, Carlito, "Segoe UI", "Helvetica Neue", Arial, sans-serif; color: #e8eef7; background: #0c1420; }
#map { position: absolute; inset: 0 340px 0 0; }
body.clean #map { right: 0; }
body.clean #panel { display: none; }
#labels, #route-labels, #ac-labels, #wx-labels, #gps-labels { position: absolute; inset: 0 340px 0 0; pointer-events: none; overflow: hidden; }
body.clean #labels, body.clean #route-labels, body.clean #ac-labels, body.clean #wx-labels, body.clean #gps-labels { right: 0; }
.top-label { position: absolute; transform: translate(-50%, -135%); padding: 1px 7px; border-radius: 4px; white-space: nowrap;
  background: rgba(8, 16, 28, .88); color: #fff; font-weight: 700; font-size: 12.5px; border: 1px solid rgba(255, 255, 255, .7); }
.alt-label.gps-label { border-color: #00e5ff; color: #b8f8ff; }
.radar-key { display: flex; align-items: center; gap: 6px; margin: 2px 0 2px 22px; font-size: 11px; color: #9fb0c6; }
.radar-key i { flex: 1; height: 8px; border-radius: 4px;
  background: linear-gradient(90deg, #a8ed9e, #6bdb66, #1a9e29, #086b1a, #ffed26, #ff940d, #e61a14, #9e050d, #cc26cc, #8c40e6); }
button.active { background: #b3261e; border-color: #e0635c; font-weight: 600; }
.ac-label { position: absolute; transform: translate(9px, -50%); font-size: 11px; font-weight: 600; color: #0b1320; white-space: nowrap;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 2px #fff; }
.wx-pop { font: 13px/1.4 Georgia, Cambria, "Times New Roman", serif; color: #111; }
.wx-pop .age { color: #555; font-weight: normal; }
.wx-pop .age.stale { color: #b3261e; font-weight: bold; }
.wx-pop .taf b { display: block; margin-bottom: 2px; }
.maplibregl-popup-content, .maplibregl-ctrl { font-family: inherit; }
select { font: inherit; color: inherit; background: #1b2a40; border: 1px solid #2f4363; border-radius: 5px; padding: 3px 6px; max-width: 200px; }
.row.detail { align-items: center; margin: 2px 0 2px 22px; gap: 8px; font-size: 13px; }
.wx-pop .taf { margin-top: 5px; padding-top: 5px; border-top: 1px solid #ccc; }
.row.saved { align-items: center; gap: 8px; margin: 2px 0 0 22px; }
.row.saved button { padding: 1px 8px; font-size: 12px; }
.status { font-size: 12px; color: #9fb0c6; min-height: 1em; }
.alt-label.route-label { transform: translate(-50%, -140%); margin: 0; background: rgba(8, 16, 28, .9); border: 1px solid #fff; }
#panel { overflow-y: auto; }
#panel > * { flex-shrink: 0; }
#places { max-height: 60vh; }
input[type=number] { font: inherit; color: inherit; background: #1b2a40; border: 1px solid #2f4363; border-radius: 5px; padding: 4px 6px; width: 78px; }
.unit { align-self: center; color: #9fb0c6; font-size: 12px; }
#route-out { font-size: 12.5px; max-height: 240px; overflow-y: auto; }
.route-sum { margin: 4px 0 6px; }
.leg { padding: 4px 8px; margin-bottom: 4px; border-left: 4px solid #22c55e; background: #162235; border-radius: 3px; }
.leg.req { border-left-color: #ff3b30; }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: #22c55e; vertical-align: -1px; }
.key.req { background: #ff3b30; }
.alt-label { position: absolute; transform: translate(-100%, -50%); padding: 1px 7px; margin-left: -8px;
  background: rgba(8, 16, 28, .82); color: #fff; border-radius: 4px; font-weight: 600; font-size: 13px; white-space: nowrap; }

.rules-card { position: absolute; transform: translate(14px, -50%); min-width: 190px; max-width: 250px; padding: 8px 11px;
  background: rgba(8, 16, 28, .9); color: #fff; border-radius: 6px; border-left: 4px solid #ffc400; font-size: 13px; line-height: 1.35; }
.rules-card h3 { margin: 0 0 3px; font-size: 14px; }
.rules-card h4 { margin: 6px 0 1px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: #ffcf70; }
.rules-card ul { margin: 0; padding-left: 16px; }
.rules-card .ref { margin-top: 5px; font-size: 10.5px; color: #9fb0c6; }

#hud { position: absolute; left: 12px; bottom: 12px; display: flex; gap: 14px; align-items: center;
  padding: 6px 12px; background: rgba(8, 16, 28, .8); border-radius: 6px; pointer-events: none; }
#hud-scale { font-weight: 600; }
#hud .hint { color: #9fb0c6; font-size: 12px; }
body.clean #hud .hint { display: none; }

#panel { position: absolute; top: 0; right: 0; bottom: 0; width: 340px; display: flex; flex-direction: column;
  background: #111b2a; border-left: 1px solid #23324a; }
#panel h1 { margin: 0; padding: 12px 14px 8px; font-size: 17px; }
#panel .brandbar { display: flex; align-items: center; justify-content: space-between; padding-right: 14px; }
#panel .brandbar img { display: block; height: 30px; width: auto; }
#panel .brandlinks { padding: 0 14px 10px; font-size: 13px; color: #9fb0c6; }
#panel .brandlinks a, #panel footer a { color: #8fc2ff; }
#brand { position: absolute; left: 12px; bottom: 44px; z-index: 5; padding: 6px 10px; border-radius: 8px; background: rgba(17,27,42,.72); }
#brand img { display: block; height: 34px; width: auto; }
#brand:hover { background: rgba(17,27,42,.92); }
#panel h2 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: #9fb0c6; }
#panel section { padding: 10px 14px; border-top: 1px solid #23324a; }
#panel section.grow { flex: 1 0 300px; display: flex; flex-direction: column; }
#panel footer { padding: 8px 14px; font-size: 11px; color: #7f90a8; border-top: 1px solid #23324a; }
.row { display: flex; justify-content: space-between; margin-top: 6px; }
.row output { font-weight: 600; }
input[type=range] { width: 100%; margin: 4px 0; accent-color: #4d9bff; }
.btns { display: flex; gap: 6px; margin: 4px 0 6px; }
button, input[type=search] { font: inherit; color: inherit; background: #1b2a40; border: 1px solid #2f4363; border-radius: 5px; padding: 4px 9px; }
button { cursor: pointer; white-space: nowrap; }
button:hover { background: #24375a; }
.seg button { flex: 1; }
.seg button.active { background: #2f6fd6; border-color: #5a95f0; font-weight: 600; }
input[type=search] { flex: 1; min-width: 0; }
label.check { display: flex; gap: 7px; align-items: center; margin-top: 6px; cursor: pointer; }

#classes { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 10px; }
#classes label { display: flex; gap: 7px; align-items: center; cursor: pointer; }
.sw { width: 12px; height: 12px; border-radius: 3px; flex: none; }

#places { flex: 1; overflow-y: auto; margin: 0 -14px; padding: 0 8px 8px 14px; }
.place { border-bottom: 1px solid #1c2a40; }
.place-head { display: flex; align-items: center; gap: 7px; padding: 4px 0; }
.place-head .name { flex: 1; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.place-head .name:hover { color: #8fc0ff; }
.place-head .name.stub { color: #9fb0c6; font-style: italic; }
.badge { font-size: 10.5px; font-weight: 700; padding: 0 5px; border-radius: 3px; color: #fff; }
.place-head button { padding: 0 6px; font-size: 12px; }
.shelves { padding: 0 0 6px 22px; }
.shelf { display: flex; align-items: center; gap: 7px; padding: 2px 4px; border-radius: 4px; cursor: pointer; }
.shelf:hover { background: #1b2a40; }
.shelf.selected { background: #5a4400; }
.shelf .alt { flex: 1; color: #c6d3e6; }

#details-body { font-size: 13.5px; }
#details-body b { font-size: 15px; }
#details-body table { border-collapse: collapse; margin-top: 4px; }
#details-body td { padding: 1px 10px 1px 0; vertical-align: top; }
#details-body td:first-child { color: #9fb0c6; }
#details-body .note { color: #ffcf70; font-size: 12px; margin-top: 4px; }
