* { box-sizing: border-box; margin: 0; }
:root {
  --bg: #0f1419; --panel: #161c24; --panel-2: #1d2530; --line: #2a3441;
  --text: #e6edf3; --muted: #8b98a5; --accent: #4da3ff;
  --national: #22c55e; --regional: #ef4444; --municipal: #f59e0b; --satellite: #8b5cf6; --global: #3b82f6;
  font-size: 14px;
}
html, body, #app { height: 100%; }
body { font-family: -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
#app { display: flex; }

#sidebar { width: 430px; min-width: 430px; display: flex; flex-direction: column; background: var(--panel); border-right: 1px solid var(--line); height: 100%; }
#sidebar-head { padding: 16px 16px 10px; border-bottom: 1px solid var(--line); }
#sidebar-head h1 { font-size: 18px; letter-spacing: .2px; }
.subtitle { color: var(--muted); font-size: 12px; margin: 4px 0 12px; line-height: 1.4; }
#search { width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); outline: none; }
#search:focus { border-color: var(--accent); }

.pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pill { border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 999px; padding: 3px 10px; font-size: 12px; cursor: pointer; }
.pill.active { color: #fff; border-color: transparent; }

.filter-row { display: flex; gap: 8px; margin-top: 10px; }
.filter-row select { flex: 1; min-width: 0; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); }

.sort-row { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.sort-label { color: var(--muted); font-size: 12px; }
.sort-btn { background: transparent; border: none; color: var(--muted); cursor: pointer; font-size: 12px; padding: 2px 6px; border-radius: 6px; }
.sort-btn.active { color: var(--text); background: var(--panel-2); }

#cards { flex: 1; overflow-y: auto; padding: 10px 12px; }
.card { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer; background: var(--panel-2); transition: border-color .15s; }
.card:hover { border-color: #3d4a5c; }
.card.selected { border-color: var(--accent); }
.card-row1 { display: flex; align-items: center; gap: 8px; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.card-name { font-weight: 600; font-size: 13.5px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-badge { font-size: 10px; padding: 2px 6px; border-radius: 4px; flex: none; letter-spacing: .3px; }
.status-preview { background: #123a5c; color: #7cc0ff; }
.status-onmap { background: #0f4a2a; color: #5ee79a; }
.status-notiles { background: #333a44; color: #8b98a5; }
.card-provider { color: var(--muted); font-size: 12px; margin: 3px 0 6px 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badges { display: flex; flex-wrap: wrap; gap: 4px; margin-left: 17px; }
.badge { font-size: 10px; padding: 1.5px 6px; border-radius: 4px; background: #26303c; color: #aab7c4; }
.badge.free { background: #0f4a2a; color: #5ee79a; }
.badge.trueortho { background: #4a3a0f; color: #ffd95e; }
.badge.mlok { background: #12324a; color: #7cc0ff; }
.badge.validated { background: #103c3c; color: #55e0d0; }
.badge.bulk { background: #2d1a4a; color: #c79bff; }

.card-detail { margin: 10px 0 2px 17px; font-size: 12px; color: var(--muted); line-height: 1.55; display: none; }
.card.selected .card-detail { display: block; }
.card-detail b { color: var(--text); font-weight: 600; }
.card-detail a { color: var(--accent); text-decoration: none; }
.card-detail .dl { display: inline-block; margin-top: 8px; padding: 5px 12px; background: var(--accent); color: #04121f; border-radius: 7px; font-weight: 600; }
.access-list { margin: 6px 0 0; padding-left: 16px; }
.access-list li { margin-bottom: 2px; word-break: break-all; }

#sidebar-foot { padding: 8px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }

#map-wrap { flex: 1; position: relative; }
#map { position: absolute; inset: 0; }
#map-controls { position: absolute; top: 12px; right: 12px; z-index: 5; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
#toggle-eox { border: 1px solid var(--line); background: rgba(15,20,25,.85); color: var(--text); padding: 7px 12px; border-radius: 8px; cursor: pointer; font-size: 12.5px; backdrop-filter: blur(4px); }
#toggle-eox.active { background: var(--accent); color: #04121f; border-color: transparent; }
#opacity-wrap { background: rgba(15,20,25,.85); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 8px; backdrop-filter: blur(4px); }
#opacity-wrap.hidden, #active-banner.hidden { display: none; }
#active-banner { position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 5; background: rgba(15,20,25,.88); border: 1px solid var(--line); border-radius: 999px; padding: 6px 16px; font-size: 12.5px; backdrop-filter: blur(4px); max-width: 70%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 800px) {
  #app { flex-direction: column; }
  #sidebar { width: 100%; min-width: 0; height: 45%; }
}
