:root{
  --bg:#f6f8fc;
  --ink:#0b1220;
  --sub: rgba(11,18,32,.78);
  --line: rgba(11,18,32,.14);
  --shadow: 0 18px 48px rgba(11,18,32,.12);
  --panel-w: 420px;
}

*{box-sizing:border-box}
html, body{height:100%}
body{margin:0; background:var(--bg); font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; color:var(--ink);}

.od2-shell{padding:12px}

.topbar{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:12px;
  border:1px solid var(--line);
  border-radius:16px;
  background: linear-gradient(180deg, rgba(255,255,255,.99), rgba(255,255,255,.92));
  box-shadow: var(--shadow);
}

.brand{display:flex; align-items:center; gap:12px;}
.mark{
  height:40px; padding:0 12px; border-radius:14px;
  display:flex; align-items:center; justify-content:center;
  border:1px solid var(--line);
  background: rgba(11,18,32,.05);
  font-weight:950; letter-spacing:.7px;
}
.titles .h1{font-weight:950; font-size:14px; line-height:1.1;}
.titles .h2{font-weight:950; font-size:12px; color:var(--sub); margin-top:2px;}

.actions{display:flex; align-items:center; gap:10px;}
.btn{
  border:1px solid var(--line);
  background: rgba(255,255,255,.99);
  padding: 9px 12px;
  border-radius: 12px;
  font-weight:950;
  cursor:pointer;
}
.pill{
  border:1px solid var(--line);
  background: rgba(255,255,255,.92);
  padding: 9px 12px;
  border-radius: 999px;
  font-size:12px;
  font-weight:950;
  color:var(--sub);
  user-select:none;
}

.stage{
  margin-top:10px;
  position:relative;
  border:1px solid var(--line);
  border-radius:18px;
  overflow:hidden;
  background: var(--bg);
  box-shadow: var(--shadow);
}

#map{
  width:100%;
  height: calc(100vh - 140px);
  min-height: 560px;
}

.hud{
  position:absolute;
  left:12px;
  bottom:12px;
  background: rgba(255,255,255,.98);
  border:1px solid rgba(11,18,32,.18);
  border-radius:14px;
  padding:10px 12px;
  box-shadow: 0 16px 34px rgba(11,18,32,.16);
  max-width: 380px;
  pointer-events:none;
  z-index: 600;
}
.hud-title{font-weight:950; font-size:12px;}
.hud-body{margin-top:6px; font-size:12px; font-weight:950; color:rgba(11,18,32,.82); line-height:1.4;}

.toast{
  position:absolute;
  top:12px;
  left:50%;
  transform: translateX(-50%);
  background: rgba(255,255,255,.98);
  border:1px solid rgba(11,18,32,.18);
  border-radius:999px;
  padding:8px 12px;
  font-weight:950;
  font-size:12px;
  color:rgba(11,18,32,.80);
  box-shadow: 0 16px 34px rgba(11,18,32,.16);
  z-index: 700;
  max-width: calc(100% - 24px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.od2-backdrop{
  position:absolute;
  inset:0;
  background: rgba(11,18,32,.06);
  z-index: 720;
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s ease;
}
.od2-backdrop[aria-hidden="false"]{
  opacity: 1;
  pointer-events: auto;
}

.od2-panel{
  position:absolute;
  top:12px;
  left:12px;
  width: var(--panel-w);
  max-width: calc(100% - 24px);
  max-height: calc(100% - 24px);
  overflow:auto;
  background: rgba(255,255,255,.97);
  border:1px solid rgba(11,18,32,.16);
  border-radius: 18px;
  box-shadow: 0 34px 100px rgba(11,18,32,.22);
  z-index: 730;
  transform: translateX(16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .14s ease, transform .14s ease;
}
.od2-panel[aria-hidden="false"]{
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.od2-panel-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  padding: 12px;
  border-bottom: 1px solid rgba(11,18,32,.12);
}
.od2-panel-headleft{min-width:0}
.od2-panel-title{font-weight: 950; font-size: 14px; line-height: 1.1;}
.od2-panel-sub{margin-top: 4px; font-weight: 950; font-size: 12px; color: rgba(11,18,32,.72);}
.od2-panel-x{
  border:1px solid rgba(11,18,32,.16);
  background: rgba(255,255,255,.99);
  border-radius: 12px;
  padding: 8px 10px;
  cursor: pointer;
  font-weight: 950;
}

.od2-panel-body{padding: 12px;}

.od2-metrics{display:grid; grid-template-columns: 1fr; gap:10px;}
.od2-metrics-2{grid-template-columns: 1fr 1fr;}
@media (max-width: 920px){
  .od2-metrics-2{grid-template-columns:1fr;}
}

.od2-metric{
  border:1px solid rgba(11,18,32,.12);
  background: rgba(255,255,255,.94);
  border-radius: 16px;
  padding: 10px 12px;
}
.od2-ml{font-size: 12px; font-weight: 950; color: rgba(11,18,32,.72);}
.od2-mv{font-size: 22px; font-weight: 950; margin-top: 6px;}
.od2-mn{font-size: 12px; font-weight: 950; color: rgba(11,18,32,.72); margin-top: 4px;}

.od2-panelsplit{display:grid; grid-template-columns: 1fr 1fr; gap:10px; margin-top: 10px;}
@media (max-width: 920px){
  .od2-panelsplit{grid-template-columns:1fr;}
}

.od2-panelbox{
  border:1px solid rgba(11,18,32,.12);
  background: rgba(255,255,255,.92);
  border-radius: 16px;
  padding: 10px 12px;
}
.od2-pt{font-size: 12px; font-weight: 950; margin-bottom: 8px;}
.od2-list{display:flex; flex-direction:column; gap:6px;}

.od2-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  border:1px solid rgba(11,18,32,.08);
  background: rgba(11,18,32,.03);
  border-radius: 12px;
  padding: 8px 10px;
}
.od2-row-strong{background: rgba(11,18,32,.04)}
.od2-k{font-weight: 950; font-size: 12px; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.od2-v{font-weight: 950; font-size: 12px; color: rgba(11,18,32,.84);}

.od2-panel-footer{
  margin-top: 10px;
  border:1px solid rgba(11,18,32,.12);
  background: rgba(255,255,255,.92);
  border-radius: 14px;
  padding: 9px 10px;
  color: rgba(11,18,32,.72);
  font-size: 12px;
  font-weight: 950;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.od2-foot-left{display:flex; align-items:center; gap:8px;}
.od2-dot{
  width:10px; height:10px; border-radius: 999px;
  background: rgba(11,18,32,.22);
  border:1px solid rgba(11,18,32,.16);
}

.leaflet-control-layers{
  border-radius:14px !important;
  border:1px solid rgba(11,18,32,.16) !important;
  box-shadow: 0 18px 40px rgba(11,18,32,.16) !important;
  background: rgba(255,255,255,0.95) !important;
  font-family: inherit !important;
}
.leaflet-interactive{cursor:pointer;}

/* --- TOPSTRIP (anti-overlap) --- */
.midstrip{
  position:absolute;
  top:12px;
  left:12px;
  right:110px; /* plads til leaflet layer control */
  z-index: 610;
  pointer-events:none;
}
.stage[data-panel="open"] .midstrip{
  left: calc(12px + var(--panel-w) + 12px); /* flyttes så den aldrig overlapper panelet */
  right:110px;
}
@media (max-width: 920px){
  .stage[data-panel="open"] .midstrip{left:12px; right:110px;}
}
@media (max-width: 680px){
  .midstrip{display:none;} /* på meget små skærme: ingen overlap, ingen kamp */
}

.midstrip-inner{
  border:1px solid rgba(11,18,32,.14);
  background: rgba(255,255,255,.92);
  border-radius: 18px;
  padding: 10px 12px;
  box-shadow: 0 18px 48px rgba(11,18,32,.12);
}

.ms-title{display:flex; align-items:baseline; justify-content:space-between; gap:12px; margin-bottom:8px;}
.ms-h{font-weight:950; font-size:12px;}
.ms-s{font-weight:950; font-size:12px; color:rgba(11,18,32,.70); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width: 60%;}

.ms-cards{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap:10px;
}
@media (max-width: 1100px){
  .ms-cards{grid-template-columns: repeat(2, minmax(0, 1fr));}
}
@media (max-width: 780px){
  .ms-cards{grid-template-columns: 1fr;}
}

.ms-card{
  border:1px solid rgba(11,18,32,.10);
  background: rgba(255,255,255,.94);
  border-radius: 14px;
  padding: 10px 12px;
}
.ms-l{font-size: 12px; font-weight:950; color: rgba(11,18,32,.72);}
.ms-v{font-size: 22px; font-weight:950; margin-top:6px;}
.ms-v2{font-size: 14px; font-weight:950;}
.ms-n{font-size: 12px; font-weight:950; color: rgba(11,18,32,.70); margin-top:4px;}

/* --- Panel: hero/logo --- */
.od2-hero{display:flex; align-items:center; gap:10px; min-width:0;}
.od2-logo{
  width:44px; height:44px;
  border-radius: 14px;
  border:1px solid rgba(11,18,32,.14);
  background: rgba(11,18,32,.04);
  display:flex; align-items:center; justify-content:center;
  overflow:hidden;
  flex: 0 0 auto;
}
.od2-logo img{width:100%; height:100%; object-fit:contain; padding:6px;}
.od2-logo-fallback{
  font-weight:950; font-size:11px; color: rgba(11,18,32,.82);
  padding:6px; text-align:center; line-height:1.1;
}
.od2-hero-text{min-width:0}
.od2-hero-bered{margin-top:6px; font-weight:950; font-size:12px; color:rgba(11,18,32,.72);}

/* --- Latest --- */
.od2-latest{display:flex; flex-direction:column; gap:6px;}
.od2-latest-row{
  display:grid;
  grid-template-columns: 64px 1fr;
  gap:10px;
  border:1px solid rgba(11,18,32,.08);
  background: rgba(11,18,32,.03);
  border-radius: 12px;
  padding: 8px 10px;
}
.od2-lk{font-weight:950; font-size:12px; color: rgba(11,18,32,.72);}
.od2-lv{font-weight:950; font-size:12px; color: rgba(11,18,32,.88); overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
#p-last-desc{white-space:normal;}

/* --- Types --- */
.od2-types{display:flex; flex-direction:column; gap:8px;}
.od2-type-row{
  border:1px solid rgba(11,18,32,.10);
  background: rgba(255,255,255,.94);
  border-radius: 14px;
  padding: 10px 10px 8px 10px;
}
.od2-type-left{display:flex; align-items:center; gap:8px; min-width:0;}
.od2-type-ico{
  width:28px; height:28px; border-radius: 10px;
  border:1px solid rgba(11,18,32,.10);
  background: rgba(11,18,32,.03);
  display:flex; align-items:center; justify-content:center;
  font-weight:950;
}
.od2-type-name{font-weight:950; font-size:12px; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.od2-type-right{margin-left:auto; display:flex; gap:10px; align-items:center;}
.od2-type-n{font-weight:950; font-size:12px;}
.od2-type-p{font-weight:950; font-size:12px; color: rgba(11,18,32,.72);}
.od2-type-bar{
  margin-top:8px;
  height:6px;
  border-radius:999px;
  border:1px solid rgba(11,18,32,.10);
  background: rgba(11,18,32,.04);
  overflow:hidden;
}
.od2-type-barfill{
  height:100%;
  background: rgba(37,99,235,.75);
  border-radius:999px;
}
.od2-hint{margin-top:8px; font-weight:950; font-size:11px; color: rgba(11,18,32,.64);}

/* --- Spark / graph --- */
.od2-spark{
  height: 92px;
  border-radius: 14px;
  border:1px solid rgba(11,18,32,.10);
  background: rgba(11,18,32,.03);
  padding: 10px;
  display:flex;
  align-items:flex-end;
  gap:2px;
  overflow:hidden;
}
.od2-bar{flex: 1 1 auto; min-width: 2px; height:100%; display:flex; align-items:flex-end;}
.od2-bar-in{
  width: 100%;
  height: 0%;
  border-radius: 6px 6px 2px 2px;
  background: rgba(37,99,235,.75);
}
.od2-spark-foot{
  margin-top:8px;
  font-weight:950;
  font-size:11px;
  color: rgba(11,18,32,.64);
}

/* --- Empty --- */
.od2-empty{
  font-weight:950;
  font-size:12px;
  color: rgba(11,18,32,.68);
  padding: 10px;
}

/* 🚨 marker */
.od2-alert-icon{
  font-size: 18px;
  filter: drop-shadow(0 8px 12px rgba(11,18,32,.28));
}
