* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif; }
body { display: flex; flex-direction: column; }

header {
  background: #0A0F3C;
  color: #fff;
  padding: 0.75rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 3px solid #63DAD6;
  z-index: 1100;
}
header h1 { font-size: 1.05rem; margin: 0; font-weight: 600; letter-spacing: 0.02em; }
header .meta { font-size: 0.8rem; opacity: 0.75; }

#app { flex: 1; display: flex; position: relative; min-height: 0; }
#map { flex: 1; background: #e8eef2; }

#panel {
  width: 340px;
  background: #fff;
  border-right: 1px solid #d8dde3;
  overflow-y: auto;
  padding: 1rem 1.1rem 2rem;
  font-size: 0.88rem;
  line-height: 1.45;
}
#panel > p.intro {
  margin: 0 0 0.6rem;
  font-size: 0.82rem;
  color: #555;
}
#panel h2 {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #0A0F3C;
  margin: 1rem 0 0.4rem;
  padding: 0.2rem 0;
  border-bottom: 1px solid #eaecef;
}
#panel h2:first-of-type { margin-top: 0.4rem; }
#panel h2.collapsible {
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  outline: none;
  transition: background 0.12s;
}
#panel h2.collapsible:hover { background: #f0f4f8; }
#panel h2.collapsible:focus-visible { outline: 2px solid #0A0F3C; outline-offset: 1px; }
#panel h2.collapsible::before {
  content: '▾';
  font-size: 0.65rem;
  transition: transform 0.15s;
  color: #5a6378;
  flex-shrink: 0;
  display: inline-block;
  width: 0.8rem;
}
#panel h2.collapsible.collapsed::before { transform: rotate(-90deg); }
#panel .collapse-content { transition: opacity 0.15s; }

#panel h3.layer-subhead {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #5a6378;
  margin: 0.75rem 0 0.25rem 0.35rem;
  font-weight: 600;
}

.layer-group { margin-bottom: 0.15rem; }
.layer {
  display: flex;
  flex-wrap: wrap;          /* transparens-skyderen får sin egen linje under navnet */
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.35rem;
  border-radius: 0;
  cursor: pointer;
  transition: background 0.12s;
  font-size: 0.85rem;
}
.layer:hover { background: #f0f4f8; }
.layer input { flex-shrink: 0; cursor: pointer; }
.layer .label { flex: 1; min-width: 0; }
.layer .name {
  font-weight: 500;
  color: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.layer .desc { display: none; }  /* Skjult — vises som tooltip via title-attribut */
.layer .teach {
  font-size: 0.76rem;
  color: #0A0F3C;
  margin-top: 0.2rem;
  padding-left: 0.5rem;
  border-left: 2px solid #63DAD6;
}
.layer .teach::before { content: "Brug i undervisning: "; font-weight: 600; }

.external-links {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #eaecef;
  font-size: 0.82rem;
}
.external-links a {
  display: block;
  color: #0A0F3C;
  text-decoration: none;
  padding: 0.3rem 0;
  border-bottom: 1px dashed #e0e3e8;
}
.external-links a:hover { color: #D4763C; }
.external-links a::after { content: " ↗"; opacity: 0.5; font-size: 0.85em; }

#toggle-panel {
  display: none;
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 1000;
  background: #fff;
  border: 1px solid #d8dde3;
  border-radius: 0;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* Info popups */
.leaflet-popup-content { font-size: 0.85rem; line-height: 1.45; }
.leaflet-popup-content h3 { margin: 0 0 0.4rem; font-size: 0.95rem; color: #0A0F3C; }
.leaflet-popup-content p { margin: 0.3rem 0; }
.leaflet-popup-content a { color: #D4763C; }

/* Custom markers */
.marker-station { background: #D4763C; border: 3px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px #D4763C, 0 2px 4px rgba(0,0,0,0.3); }
.marker-aws { background: #63DAD6; border: 2px solid #0A0F3C; border-radius: 0; transform: rotate(45deg); }
.marker-town { background: #7123A1; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px #7123A1; }
.marker-glacier { background: #fff; border: 2px solid #0A0F3C; border-radius: 50%; }

.legend {
  background: rgba(255,255,255,0.95);
  padding: 0.6rem 0.75rem;
  border-radius: 0;
  font-size: 0.78rem;
  line-height: 1.5;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.legend .item { display: flex; align-items: center; gap: 0.4rem; margin-bottom: 0.15rem; }
.legend .swatch { width: 14px; height: 14px; flex-shrink: 0; }

/* Signaturforklaring-boks for spektrale lag */
.legend-box {
  background: rgba(255, 255, 255, 0.97);
  border-radius: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  font-size: 0.76rem;
  line-height: 1.4;
  max-width: 280px;
  max-height: 60vh;
  overflow-y: auto;
  margin-bottom: 8px;  /* spacing til marker-legend nedenunder */
}
.legend-box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #0A0F3C;
  color: #fff;
  padding: 0.35rem 0.6rem;
  font-weight: 600;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 0;
}
.legend-box-collapse {
  background: none;
  border: none;
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.2rem;
}
.legend-box-body { padding: 0.5rem 0.6rem; }
.legend-item { margin-bottom: 0.8rem; }
.legend-item:last-child { margin-bottom: 0; }
.legend-item + .legend-item {
  padding-top: 0.6rem;
  border-top: 1px solid #e8eaef;
}
.leg-title { font-weight: 600; color: #0A0F3C; margin-bottom: 0.2rem; font-size: 0.78rem; }
.leg-unit { color: #666; font-size: 0.7rem; font-style: italic; margin-bottom: 0.3rem; }
.leg-desc { color: #555; font-size: 0.7rem; margin-top: 0.3rem; font-style: italic; line-height: 1.35; }
.leg-stops { display: flex; flex-direction: column; gap: 1px; }
.leg-tick { display: flex; align-items: center; gap: 0.35rem; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.72rem; }
.leg-swatch { display: inline-block; width: 14px; height: 14px; flex-shrink: 0; border: 1px solid rgba(0,0,0,0.15); border-radius: 0; }
.leg-val { min-width: 36px; font-weight: 600; color: #1a1a1a; }
.leg-lbl { color: #666; font-size: 0.7rem; }
.legend-rgb .leg-bands { display: flex; flex-direction: column; gap: 0.15rem; }
.leg-band { display: flex; align-items: center; gap: 0.3rem; font-size: 0.72rem; }
.leg-band b { color: #0A0F3C; min-width: 14px; }

/* Transparens-slider per lag */
.layer-controls-row {
  flex-basis: 100%;
  margin-top: 0.1rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  color: #666;
  padding-left: 0.5rem;
}
.layer-opacity-slider {
  flex: 1;
  height: 4px;
  cursor: pointer;
}
.layer-opacity-val {
  font-family: ui-monospace, Menlo, monospace;
  min-width: 30px;
  text-align: right;
}

.basemap-info {
  background: rgba(10, 15, 60, 0.92);
  color: #fff;
  padding: 0.5rem 0.75rem;
  border-radius: 0;
  font-size: 0.78rem;
  line-height: 1.4;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  max-width: 260px;
}
.basemap-info .label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.7; }
.basemap-info .value { font-weight: 600; margin-top: 0.15rem; }
.basemap-info .note { font-size: 0.72rem; opacity: 0.85; margin-top: 0.2rem; font-style: italic; }

/* Sentinel Hub config-input */
#sh-config {
  margin-top: 0.5rem;
  padding: 0.6rem 0.7rem;
  background: #f0f9f8;
  border: 1px solid #c8e8e6;
  border-radius: 0;
  font-size: 0.78rem;
  line-height: 1.4;
}
#sh-config.connected { background: #f0f6e8; border-color: #c8d8a8; }
#sh-config strong { color: #0A0F3C; }
#sh-config input {
  width: 100%;
  padding: 0.3rem 0.4rem;
  margin-top: 0.3rem;
  border: 1px solid #b8c8c8;
  border-radius: 0;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 0.78rem;
}
#sh-config button {
  margin-top: 0.4rem;
  padding: 0.35rem 0.7rem;
  background: #0A0F3C;
  color: #fff;
  border: none;
  border-radius: 0;
  cursor: pointer;
  font-size: 0.78rem;
}
#sh-config button:hover { background: #2a2f6c; }
#sh-config a { color: #0A0F3C; }
#sh-config .status { margin-top: 0.4rem; font-weight: 500; }
#sh-config .status.ok { color: #2a7a2a; }

/* Sentinel Hub status-række */
#sh-config .sh-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
#sh-config .link-btn {
  background: none;
  border: none;
  color: #0A0F3C;
  font-size: 0.72rem;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  margin: 0;
  width: auto;
}
#sh-config .link-btn:hover { color: #D4763C; background: none; }
#sh-instance-edit { margin-top: 0.4rem; }

/* Datovælger for spektrale lag */
#sh-dates {
  margin-top: 0.7rem;
  padding: 0.6rem 0.7rem;
  background: #fff;
  border: 1px solid #d8dde3;
  border-radius: 0;
  font-size: 0.78rem;
}
#sh-dates strong { color: #0A0F3C; display: block; margin-bottom: 0.4rem; }
#sh-dates .date-row { display: flex; gap: 0.4rem; align-items: center; margin-bottom: 0.4rem; }
#sh-dates label { font-size: 0.75rem; color: #555; min-width: 60px; }
#sh-dates input[type="date"] {
  flex: 1;
  padding: 0.25rem 0.35rem;
  border: 1px solid #c8d0d8;
  border-radius: 0;
  font-size: 0.78rem;
}

/* Mode-toggle (periode vs specifik dato) */
#sh-dates .mode-toggle {
  display: flex;
  gap: 0;
  margin-bottom: 0.6rem;
  border: 1px solid #c8d0d8;
  border-radius: 0;
  overflow: hidden;
}
#sh-dates .mode-toggle button {
  flex: 1;
  padding: 0.35rem 0.5rem;
  border: none;
  background: #f8f9fb;
  cursor: pointer;
  font-size: 0.75rem;
  color: #555;
  border-right: 1px solid #c8d0d8;
}
#sh-dates .mode-toggle button:last-child { border-right: none; }
#sh-dates .mode-toggle button:hover { background: #e8eef5; }
#sh-dates .mode-toggle button.active { background: #0A0F3C; color: #fff; }

/* Presets */
#sh-dates .presets { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.4rem; }
#sh-dates .presets button {
  padding: 0.2rem 0.5rem;
  border: 1px solid #c8d0d8;
  background: #f8f9fb;
  border-radius: 0;
  font-size: 0.72rem;
  cursor: pointer;
}
#sh-dates .presets button:hover { background: #e8eef5; border-color: #0A0F3C; }
#sh-dates .presets button.active { background: #0A0F3C; color: #fff; border-color: #0A0F3C; }

/* Scrub-knapper (forrige/næste dag/uge/måned) */
#sh-dates .scrub-row {
  display: flex;
  gap: 0.2rem;
  margin: 0.4rem 0;
}
#sh-dates .scrub-row button {
  flex: 1;
  padding: 0.3rem 0;
  border: 1px solid #c8d0d8;
  background: #f8f9fb;
  border-radius: 0;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  color: #0A0F3C;
}
#sh-dates .scrub-row button:hover { background: #0A0F3C; color: #fff; border-color: #0A0F3C; }

/* Tolerance- og maxcc-rækker */
#sh-dates .tolerance-row,
#sh-dates .maxcc-row {
  margin-top: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
#sh-dates .tolerance-row input,
#sh-dates .maxcc-row input { flex: 1; }
#sh-dates .tolerance-row .val,
#sh-dates .maxcc-row .val {
  font-family: ui-monospace, Menlo, monospace;
  min-width: 50px;
  text-align: right;
  font-size: 0.75rem;
}

/* Hint-tekst */
#sh-dates .hint {
  margin: 0.4rem 0 0;
  font-size: 0.7rem;
  color: #888;
  font-style: italic;
  line-height: 1.35;
}

/* Dato-badge på kortet */
.date-badge-spectral {
  background: rgba(10, 15, 60, 0.92);
  color: #fff;
  padding: 0.5rem 0.75rem;
  border-radius: 0;
  font-size: 0.78rem;
  line-height: 1.4;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  max-width: 280px;
  margin-top: 0.4rem;
}
.date-badge-spectral .label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.7; }
.date-badge-spectral .value { font-weight: 600; margin-top: 0.15rem; }
.date-badge-spectral .note { font-size: 0.72rem; opacity: 0.85; margin-top: 0.2rem; font-style: italic; }

/* Værktøjslinje */
.tool-bar {
  background: #fff;
  border-radius: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.2);
}
.tool-btn {
  background: #fff;
  border: none;
  width: 36px;
  height: 36px;
  font-size: 1.35rem;
  line-height: 1;
  color: #0A0F3C;
  cursor: pointer;
  border-bottom: 1px solid #eee;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, color 0.12s;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Symbol", "Helvetica Neue", sans-serif;
  font-weight: 500;
}
.tool-btn:last-child { border-bottom: none; }
.tool-btn:hover { background: #f0f5fa; }
.tool-btn.active { background: #0A0F3C; color: #fff; }
.tool-btn.danger { color: #c44; }
.tool-btn.danger:hover { background: #fdf0f0; }

/* Live koordinat-aflæsning */
.coord-readout {
  background: rgba(255,255,255,0.95);
  padding: 0.35rem 0.7rem;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.78rem;
  border-radius: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  color: #1a1a1a;
}

/* Afsatte punkter */
.dropped-pin {
  background: #2d6a4f;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px #2d6a4f;
}

/* Validation-marker (foto + ground-måling) */
.validation-marker {
  background: #f0c020;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 2px #b88800, 0 2px 4px rgba(0,0,0,0.3);
  position: relative;
}
.validation-marker::after {
  content: '◉';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: #b88800;
  font-weight: 700;
}

/* Validation-popup */
.vp-popup h3 { margin: 0 0 0.3rem; color: #0A0F3C; font-size: 0.95rem; }
.vp-popup .vp-coord {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 0.72rem;
  color: #555;
  margin-bottom: 0.2rem;
}
.vp-popup .vp-time { font-size: 0.72rem; color: #666; margin-bottom: 0.5rem; }
.vp-popup .vp-photos {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  margin-bottom: 0.3rem;
  padding-bottom: 4px;
}
.vp-popup .vp-thumb {
  height: 70px;
  width: auto;
  border-radius: 0;
  cursor: pointer;
  border: 1px solid #ccc;
  flex-shrink: 0;
}
.vp-popup .vp-exif {
  font-size: 0.7rem;
  color: #888;
  margin-bottom: 0.4rem;
  font-style: italic;
}
.vp-popup .vp-empty { color: #aaa; font-size: 0.78rem; font-style: italic; }
.vp-popup .vp-photo-actions {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin: 0.3rem 0;
}
.vp-popup .vp-photo-btn {
  padding: 0.3rem 0.5rem;
  font-size: 0.74rem;
  border: 1px solid #b88800;
  background: #fff8dc;
  color: #b88800;
  border-radius: 0;
  cursor: pointer;
  text-align: left;
}
.vp-popup .vp-photo-btn:hover { background: #f0c020; color: #000; }
.vp-popup .vp-ground table {
  width: 100%;
  font-size: 0.78rem;
  border-collapse: collapse;
  margin: 0.4rem 0;
}
.vp-popup .vp-ground th {
  text-align: left;
  font-weight: 500;
  color: #555;
  padding: 0.15rem 0.4rem 0.15rem 0;
  vertical-align: top;
  width: 50%;
}
.vp-popup .vp-ground td {
  padding: 0.15rem 0;
  font-family: ui-monospace, Menlo, monospace;
  font-weight: 600;
  color: #1a1a1a;
}
.vp-popup .vp-notes {
  font-size: 0.76rem;
  color: #333;
  background: #f6f7f9;
  padding: 0.4rem 0.5rem;
  border-radius: 0;
  margin: 0.4rem 0;
  white-space: pre-wrap;
}
/* Satellit-sektion i validation-popup */
.vp-popup .vp-sat {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid #e8eaef;
}
.vp-popup .vp-sat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.3rem;
}
.vp-popup .vp-sat-header strong {
  color: #0A0F3C;
  font-size: 0.82rem;
}
.vp-popup .vp-sat-fetch-btn {
  background: #0A0F3C;
  color: #fff;
  border: 1px solid #0A0F3C;
  border-radius: 0;
  padding: 0.25rem 0.6rem;
  font-size: 0.72rem;
  cursor: pointer;
}
.vp-popup .vp-sat-fetch-btn:hover { background: #2a2f6c; }
.vp-popup .vp-sat-fetch-btn:disabled {
  background: #888; border-color: #888; cursor: not-allowed;
}
.vp-popup .vp-sat table {
  width: 100%;
  font-size: 0.76rem;
  border-collapse: collapse;
}
.vp-popup .vp-sat th {
  text-align: left;
  font-weight: 500;
  color: #555;
  padding: 0.15rem 0.4rem 0.15rem 0;
  width: 45%;
}
.vp-popup .vp-sat td {
  padding: 0.15rem 0;
  font-family: ui-monospace, Menlo, monospace;
  font-weight: 600;
}
.vp-popup .vp-sat-empty { color: #aaa; font-style: italic; font-weight: normal; }
.vp-popup .vp-sat-err { color: #c44; font-style: italic; font-weight: normal; font-size: 0.7rem; }
.vp-popup .vp-sat-fetched {
  font-size: 0.68rem;
  color: #888;
  font-style: italic;
  margin-top: 0.25rem;
  text-align: right;
}
.vp-popup .vp-diff {
  font-size: 0.7rem;
  font-weight: normal;
  margin-left: 0.3rem;
}
.vp-popup .vp-diff-small { color: #2a7a2a; }
.vp-popup .vp-diff-large { color: #c44; }

.vp-popup .vp-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.5rem;
  border-top: 1px solid #e8eaef;
  padding-top: 0.5rem;
}
.vp-popup .vp-actions button {
  flex: 1;
  padding: 0.35rem 0.5rem;
  font-size: 0.78rem;
  border: 1px solid #b8c4cc;
  background: #f8f9fb;
  border-radius: 0;
  cursor: pointer;
}
.vp-popup .vp-actions button:first-child { background: #0A0F3C; color: #fff; border-color: #0A0F3C; }
.vp-popup .vp-actions button:hover { opacity: 0.85; }

/* Modal til oprettelse/redigering */
#vp-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 5000;
  align-items: center;
  justify-content: center;
}
#vp-modal.open { display: flex; }
.vp-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 15, 60, 0.55);
}
.vp-modal-card {
  position: relative;
  background: #fff;
  border-radius: 0;
  width: min(560px, 92vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
  overflow: hidden;
}
.vp-modal-header {
  background: #0A0F3C;
  color: #fff;
  padding: 0.7rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.vp-modal-header h2 { margin: 0; font-size: 1rem; font-weight: 600; }
#vp-modal-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.3rem;
}
.vp-modal-body {
  padding: 1rem 1.2rem;
  overflow-y: auto;
  font-size: 0.85rem;
}
.vp-modal-body label {
  display: block;
  margin-bottom: 0.7rem;
  color: #333;
}
.vp-modal-body input[type="text"],
.vp-modal-body input[type="number"],
.vp-modal-body input[type="datetime-local"],
.vp-modal-body textarea {
  display: block;
  width: 100%;
  margin-top: 0.2rem;
  padding: 0.4rem 0.5rem;
  border: 1px solid #c8d0d8;
  border-radius: 0;
  font-family: inherit;
  font-size: 0.85rem;
}
.vp-modal-body textarea { resize: vertical; min-height: 60px; }
.vp-modal-body fieldset {
  border: 1px solid #d8dde3;
  border-radius: 0;
  padding: 0.7rem 0.9rem;
  margin-bottom: 0.8rem;
}
.vp-modal-body legend {
  font-weight: 600;
  color: #0A0F3C;
  padding: 0 0.4rem;
  font-size: 0.85rem;
}
.vp-modal-body input[type="file"] {
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}
.vp-photo-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.vp-photo-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: #f5f7fa;
  padding: 0.4rem;
  border-radius: 0;
}
.vp-photo-thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 0;
  border: 1px solid #ccc;
  flex-shrink: 0;
}
.vp-photo-info { flex: 1; min-width: 0; }
.vp-photo-name {
  font-weight: 500;
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vp-photo-exif { font-size: 0.7rem; color: #666; }
.vp-photo-remove {
  background: #fdf0f0;
  border: 1px solid #f0c4c4;
  color: #c44;
  border-radius: 0;
  width: 26px;
  height: 26px;
  font-size: 1rem;
  cursor: pointer;
  flex-shrink: 0;
}
.vp-photo-remove:hover { background: #c44; color: #fff; }
.vp-modal-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  padding-top: 0.5rem;
  border-top: 1px solid #e8eaef;
  margin-top: 0.5rem;
}
.vp-modal-actions button {
  padding: 0.5rem 1.2rem;
  border-radius: 0;
  border: 1px solid #b8c4cc;
  background: #f8f9fb;
  cursor: pointer;
  font-size: 0.85rem;
}
#vp-save {
  background: #0A0F3C !important;
  color: #fff;
  border-color: #0A0F3C !important;
}
#vp-save:hover { background: #2a2f6c !important; }

/* Foto-albedo modal */
#pa-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 5500;
  align-items: center;
  justify-content: center;
}
#pa-modal.open { display: flex; }
.pa-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 15, 60, 0.6);
}
.pa-modal-card {
  position: relative;
  background: #fff;
  border-radius: 0;
  width: min(900px, 95vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
  overflow: hidden;
}
.pa-modal-header {
  background: #0A0F3C;
  color: #fff;
  padding: 0.7rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.pa-modal-header h2 { margin: 0; font-size: 1rem; font-weight: 600; }
#pa-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0 0.3rem;
}
.pa-modal-body {
  padding: 0.7rem 1rem 1rem;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1fr 280px;
  grid-template-rows: auto 1fr auto;
  gap: 0.6rem 1rem;
}
.pa-toolbar {
  grid-column: 1 / -1;
  display: flex;
  gap: 0.4rem;
}
.pa-tool {
  padding: 0.4rem 0.7rem;
  border: 1px solid #c8d0d8;
  background: #f8f9fb;
  border-radius: 0;
  cursor: pointer;
  font-size: 0.82rem;
}
.pa-tool.active {
  background: #0A0F3C;
  color: #fff;
  border-color: #0A0F3C;
}
.pa-tool:hover:not(.active) { background: #e8eef5; }
.pa-canvas-wrap {
  grid-column: 1;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}
#pa-canvas {
  border: 1px solid #d8dde3;
  border-radius: 0;
  background: #f0f2f5;
  max-width: 100%;
  max-height: 60vh;
  width: 100%;
  height: auto;
  cursor: crosshair;
  touch-action: none;
}
.pa-hint {
  font-size: 0.75rem;
  color: #666;
  font-style: italic;
}
.pa-results {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.85rem;
}
.pa-result {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.35rem 0.5rem;
  background: #f5f7fa;
  border-radius: 0;
}
.pa-result label { color: #555; font-size: 0.78rem; }
.pa-val {
  font-family: ui-monospace, Menlo, monospace;
  font-weight: 600;
  color: #1a1a1a;
}
.pa-result-primary {
  background: #fff8dc;
  border: 1px solid #f0c020;
}
.pa-val-primary {
  font-size: 1.3rem;
  color: #0A0F3C;
}
.pa-ref-row {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.4rem 0.5rem;
  background: #f0f9f8;
  border: 1px solid #c8e8e6;
  border-radius: 0;
}
.pa-ref-row label {
  display: block;
  font-size: 0.78rem;
  color: #555;
}
.pa-ref-row input, .pa-ref-row select {
  width: 100%;
  padding: 0.3rem 0.4rem;
  border: 1px solid #c8d0d8;
  border-radius: 0;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 0.82rem;
  margin-top: 0.15rem;
}
.pa-formula {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 0.72rem;
  color: #666;
  padding: 0.3rem 0.5rem;
  background: #f9fafb;
  border-radius: 0;
  text-align: center;
}
.pa-modal-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  padding-top: 0.5rem;
  border-top: 1px solid #e8eaef;
}
.pa-modal-actions button {
  padding: 0.5rem 1.2rem;
  border-radius: 0;
  border: 1px solid #b8c4cc;
  background: #f8f9fb;
  cursor: pointer;
  font-size: 0.85rem;
}
#pa-save {
  background: #0A0F3C;
  color: #fff;
  border-color: #0A0F3C;
}
#pa-save:disabled {
  background: #888;
  border-color: #888;
  cursor: not-allowed;
  opacity: 0.5;
}
#pa-save:not(:disabled):hover { background: #2a2f6c; }

/* PROMICE viewer modal */
#pv-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 6000;
  align-items: center;
  justify-content: center;
}
#pv-modal.open { display: flex; }
.pv-modal-backdrop { position: absolute; inset: 0; background: rgba(10,15,60,0.6); }
.pv-modal-card {
  position: relative;
  background: #fff;
  border-radius: 0;
  width: min(900px, 95vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
  overflow: hidden;
}
.pv-modal-header {
  background: #0A0F3C;
  color: #fff;
  padding: 0.7rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.pv-modal-header h2 { margin: 0; font-size: 1rem; font-weight: 600; }
#pv-close { background: none; border: none; color: #fff; font-size: 1.4rem; cursor: pointer; padding: 0 0.3rem; }
.pv-modal-body { padding: 0.8rem 1rem; overflow-y: auto; display: flex; flex-direction: column; gap: 0.6rem; }
.pv-toolbar {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.85rem;
}
.pv-toolbar label { margin-right: 0.3rem; color: #555; font-size: 0.78rem; }
.pv-toolbar select {
  padding: 0.3rem 0.5rem;
  border: 1px solid #c8d0d8;
  border-radius: 0;
  font-size: 0.85rem;
  background: #fff;
}
#pv-reset-zoom {
  padding: 0.3rem 0.7rem;
  border: 1px solid #c8d0d8;
  background: #f8f9fb;
  border-radius: 0;
  cursor: pointer;
  font-size: 0.78rem;
  color: #0A0F3C;
}
#pv-reset-zoom:hover { background: #e8eef5; }

.pv-info {
  font-size: 0.78rem;
  color: #666;
  font-style: italic;
  margin-left: auto;
}
.pv-chart-wrap {
  position: relative;
  height: 380px;
  background: #fafbfc;
  border: 1px solid #e8eaef;
  border-radius: 0;
  padding: 0.5rem;
}
.pv-stats {
  display: flex;
  gap: 1.5rem;
  font-size: 0.85rem;
  flex-wrap: wrap;
  padding: 0.4rem 0.6rem;
  background: #f5f7fa;
  border-radius: 0;
}
.pv-stats b { color: #0A0F3C; font-family: ui-monospace, Menlo, monospace; }
.pv-meta {
  font-size: 0.74rem;
  color: #888;
  border-top: 1px solid #e8eaef;
  padding-top: 0.5rem;
}

/* Integral-kort (tilført energi i synlig periode) */
.pv-integral { /* container */ }
.pv-int-card {
  background: linear-gradient(135deg, #fff8dc 0%, #fde9b3 100%);
  border: 1px solid #f0c020;
  border-radius: 0;
  padding: 0.6rem 0.8rem;
  margin-top: 0.2rem;
}
.pv-int-card.pv-int-neg {
  background: linear-gradient(135deg, #dceaf8 0%, #b8d0e8 100%);
  border-color: #5680c0;
}
.pv-int-card.pv-int-pos {
  background: linear-gradient(135deg, #fff3d8 0%, #f5d488 100%);
  border-color: #d49830;
}
.pv-int-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #5a4a1a;
  font-weight: 600;
}
.pv-int-card.pv-int-neg .pv-int-label { color: #1a3a6a; }
.pv-int-value {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 1.6rem;
  font-weight: 700;
  color: #0A0F3C;
  margin: 0.15rem 0 0.3rem;
}
.pv-int-unit { font-size: 0.85rem; color: #666; font-weight: 500; }
.pv-int-detail {
  font-size: 0.72rem;
  color: #555;
  line-height: 1.4;
}

/* Download-sektion */
.pv-download {
  font-size: 0.82rem;
  padding: 0.5rem 0.6rem;
  background: #f5f7fa;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.pv-download-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.pv-download-header strong { color: #0A0F3C; }
.pv-download-hint { color: #888; font-size: 0.72rem; font-style: italic; flex: 1; }
.pv-dl-buttons { display: flex; gap: 0.4rem; }
.pv-dl-buttons button {
  padding: 0.35rem 0.8rem;
  background: #0A0F3C;
  color: #fff;
  border: 1px solid #0A0F3C;
  border-radius: 0;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 500;
}
.pv-dl-buttons button:hover { background: #2a2f6c; }

.pv-dl-vars-wrap {
  background: #fff;
  border: 1px solid #e0e4ea;
  border-radius: 0;
  padding: 0.4rem 0.55rem;
}
.pv-dl-vars-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  font-size: 0.76rem;
  color: #555;
  flex-wrap: wrap;
}
.pv-dl-mini {
  padding: 0.1rem 0.5rem;
  background: #fff;
  border: 1px solid #c8d0d8;
  border-radius: 0;
  cursor: pointer;
  font-size: 0.7rem;
  color: #0A0F3C;
}
.pv-dl-mini:hover { background: #e8eef5; }

.pv-dl-vars { display: flex; flex-direction: column; gap: 0.35rem; }
.pv-dl-vars-group-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #888;
  font-weight: 600;
  margin-top: 0.1rem;
}
.pv-dl-vars-group {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 0.15rem 0.6rem;
  padding-left: 0.3rem;
}
.pv-dl-var-chk {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.74rem;
  color: #1a1a1a;
  cursor: pointer;
  padding: 0.1rem 0.2rem;
  border-radius: 0;
}
.pv-dl-var-chk:hover { background: #f0f4f8; }
.pv-dl-var-chk input { margin: 0; cursor: pointer; flex-shrink: 0; }
.pv-dl-var-chk span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pv-meta a { color: #0A0F3C; }
.pv-empty { color: #aaa; font-style: italic; }

.pv-var-explain {
  background: #f0f6fc;
  border-left: 3px solid #0A0F3C;
  padding: 0.5rem 0.7rem;
  border-radius: 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #1a2a4a;
  display: none;
}
.pv-explain-desc { margin-bottom: 0.3rem; }
.pv-explain-example { font-size: 0.78rem; color: #4a5a7a; }
.pv-explain-example b { color: #0A0F3C; }

/* Mobile: stack results under canvas */
@media (max-width: 720px) {
  .pa-modal-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto;
  }
  .pa-canvas-wrap { grid-column: 1; grid-row: 2; }
  .pa-results { grid-column: 1; grid-row: 3; }
  .pa-modal-actions { grid-row: 4; }
}

/* ─── Pixel-info modal ─── */
#px-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 6500;
  align-items: center;
  justify-content: center;
}
#px-modal.open { display: flex; }
.px-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 15, 60, 0.55);
}
.px-modal-card {
  position: relative;
  background: #fff;
  border-radius: 0;
  width: min(720px, 95vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
  overflow: hidden;
}
.px-modal-header {
  background: #0A0F3C;
  color: #fff;
  padding: 0.7rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.px-modal-header h2 { margin: 0; font-size: 1rem; font-weight: 600; }
#px-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.3rem;
}
.px-modal-body {
  padding: 0.9rem 1.1rem 1rem;
  overflow-y: auto;
  font-size: 0.85rem;
}
.px-bbox-info, .px-date-info {
  font-size: 0.78rem;
  color: #444;
  padding: 0.3rem 0.5rem;
  background: #f5f7fa;
  border-radius: 0;
  margin-bottom: 0.4rem;
}
.px-bbox-info b, .px-date-info b { color: #0A0F3C; }
.px-results { margin-top: 0.5rem; }
.px-loading {
  padding: 1rem;
  text-align: center;
  color: #666;
  font-style: italic;
}
.px-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}
.px-table thead th {
  background: #0A0F3C;
  color: #fff;
  text-align: left;
  padding: 0.35rem 0.5rem;
  font-weight: 500;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.px-table tbody th {
  text-align: left;
  font-weight: 500;
  color: #1a1a1a;
  padding: 0.35rem 0.5rem;
  background: #f8f9fb;
  border-bottom: 1px solid #e8eaef;
  width: 38%;
}
.px-table tbody td {
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid #e8eaef;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 0.78rem;
}
.px-table tbody td b { color: #0A0F3C; font-size: 0.85rem; }
.px-table tbody tr:last-child th,
.px-table tbody tr:last-child td { border-bottom: none; }
.px-empty { color: #aaa; font-style: italic; font-family: inherit; }
.px-err { color: #c44; font-style: italic; font-family: inherit; font-size: 0.72rem; }
.px-warn { color: #b06a10; font-weight: 600; }
.px-eff { color: #777; font-size: 0.78rem; }
.px-tip {
  margin-top: 0.6rem;
  font-size: 0.72rem;
  color: #666;
  font-style: italic;
  text-align: center;
  padding: 0.4rem;
  background: #f9fafb;
  border-radius: 0;
}
/* Pixel-info i elevsprog: stort albedotal, indeks, omgivelser */
.px-hoved { display: flex; gap: 1rem; align-items: center; margin-bottom: 0.6rem; }
.px-hoved p { margin: 0; font-size: 0.9rem; line-height: 1.5; color: #222; }
.px-stortal { flex: none; background: #0A0F3C; color: #fff; padding: 0.5rem 0.9rem; text-align: center; min-width: 5.5rem; }
.px-stortal span { display: block; font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.8; }
.px-stortal b { display: block; font-size: 1.9rem; line-height: 1.15; font-variant-numeric: tabular-nums; }
.px-indeks { display: flex; gap: 0.6rem; align-items: baseline; font-size: 0.88rem; padding: 0.35rem 0; border-top: 1px solid #e6eaef; }
.px-indeks span { flex: 1; color: #444; }
.px-indeks b { color: #0A0F3C; font-variant-numeric: tabular-nums; }
.px-indeks i { color: #666; font-size: 0.82rem; min-width: 8.5rem; text-align: right; }
.px-scene { font-size: 0.82rem; color: #555; margin: 0.5rem 0 0.7rem; padding-top: 0.45rem; border-top: 1px solid #e6eaef; line-height: 1.5; }
.px-omgiv { border-left: 3px solid #999; background: #f6f8fa; padding: 0.6rem 0.8rem; margin: 0.4rem 0 0.7rem; }
.px-omgiv.ens { border-left-color: #2e8b57; background: #f1faf4; }
.px-omgiv.blandet { border-left-color: #e0a020; background: #fffaef; }
.px-omgiv h3 { margin: 0 0 0.25rem; font-size: 0.8rem; letter-spacing: 0.04em; text-transform: uppercase; color: #0A0F3C; }
.px-omgiv p { margin: 0.2rem 0; font-size: 0.86rem; line-height: 1.5; }
.px-besked { background: #fffaef; border-left: 3px solid #e0a020; padding: 0.7rem 0.9rem; font-size: 0.88rem; line-height: 1.5; }
.px-sted { font-size: 0.75rem; color: #888; margin-top: 0.5rem; }
.px-detaljer { margin: 0.2rem 0 0.4rem; font-size: 0.8rem; }
.px-detaljer summary { cursor: pointer; color: #0A0F3C; font-weight: 600; padding: 0.3rem 0; }
.px-detaljer p { margin: 0.3rem 0; color: #555; }
@media (max-width: 480px) {
  .px-hoved { align-items: flex-start; }
  .px-indeks i { min-width: 0; }
  .px-table { font-size: 0.72rem; }
}

.px-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  padding-top: 0.6rem;
  margin-top: 0.6rem;
  border-top: 1px solid #e8eaef;
}
.px-actions button {
  padding: 0.45rem 1rem;
  border-radius: 0;
  border: 1px solid #b8c4cc;
  background: #f8f9fb;
  cursor: pointer;
  font-size: 0.82rem;
}
.px-actions #px-copy {
  background: #0A0F3C;
  color: #fff;
  border-color: #0A0F3C;
}
.px-actions #px-copy:hover { background: #2a2f6c; }
.px-actions #px-close-btn:hover { background: #e8eef5; }

/* Aktiv værktøjs-cursor på kortet */
.tool-active .leaflet-grab,
.tool-active .leaflet-interactive { cursor: crosshair !important; }

/* ─── Tegne-hint-bar (vises mens man tegner) ───────────────────────────────── */
.draw-hint-bar {
  background: #fff;
  border-radius: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  padding: 0.55rem 0.7rem;
  min-width: 260px;
  max-width: 340px;
  font-size: 0.82rem;
  line-height: 1.4;
  border-left: 4px solid #D4763C;
}
.draw-hint-bar.measure-hint { border-left-color: #0A0F3C; }
.hint-row { display: flex; align-items: center; gap: 0.4rem; }
.hint-row-main { justify-content: space-between; margin-bottom: 0.35rem; }
.hint-title {
  font-weight: 600;
  color: #0A0F3C;
  font-size: 0.85rem;
}
.hint-meta {
  font-family: ui-monospace, Menlo, monospace;
  color: #5a4a1a;
  background: #fff8dc;
  padding: 0.1rem 0.4rem;
  border-radius: 0;
  font-size: 0.75rem;
}
.hint-row-actions { gap: 0.3rem; margin-bottom: 0.4rem; }
.hint-btn {
  flex: 1;
  padding: 0.35rem 0.5rem;
  border: 1px solid #c8d0d8;
  background: #f8f9fb;
  color: #1a1a1a;
  border-radius: 0;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 500;
}
.hint-btn:hover:not(:disabled) { background: #e8eef5; border-color: #0A0F3C; }
.hint-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.hint-btn-primary {
  background: #2a7a2a;
  color: #fff;
  border-color: #2a7a2a;
}
.hint-btn-primary:hover:not(:disabled) { background: #1a6a1a !important; border-color: #1a6a1a !important; }
.hint-btn-cancel { color: #c44; }
.hint-btn-cancel:hover:not(:disabled) { background: #fdf0f0 !important; border-color: #c44 !important; }
.hint-help {
  font-size: 0.72rem;
  color: #666;
  line-height: 1.35;
  margin-top: 0.2rem;
}

/* ─── Navngivnings-modal ───────────────────────────────────────────────────── */
#name-dialog {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 7000;
  align-items: center;
  justify-content: center;
}
#name-dialog.open { display: flex; }
.name-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 15, 60, 0.5);
}
.name-dialog-card {
  position: relative;
  background: #fff;
  border-radius: 0;
  width: min(420px, 92vw);
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
  overflow: hidden;
}
.name-dialog-header {
  background: #0A0F3C;
  color: #fff;
  padding: 0.7rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.name-dialog-header h2 { margin: 0; font-size: 1rem; font-weight: 600; }
#nd-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.3rem;
}
.name-dialog-body { padding: 1rem 1.2rem; }
.name-dialog-body label {
  display: block;
  margin-bottom: 0.8rem;
  font-size: 0.82rem;
  color: #333;
}
.name-dialog-body input {
  display: block;
  width: 100%;
  margin-top: 0.2rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid #c8d0d8;
  border-radius: 0;
  font-family: inherit;
  font-size: 0.9rem;
}
.name-dialog-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 0.5rem;
  padding-top: 0.6rem;
  border-top: 1px solid #e8eaef;
}
.name-dialog-actions button {
  padding: 0.5rem 1.2rem;
  border-radius: 0;
  border: 1px solid #b8c4cc;
  background: #f8f9fb;
  cursor: pointer;
  font-size: 0.85rem;
}
.name-dialog-actions button.primary {
  background: #0A0F3C;
  color: #fff;
  border-color: #0A0F3C;
}
.name-dialog-actions button.primary:hover { background: #2a2f6c; }
.name-dialog-actions button:not(.primary):hover { background: #e8eef5; }

/* ─── Station-info modal ───────────────────────────────────────────────────── */
#si-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 6800;
  align-items: center;
  justify-content: center;
}
#si-modal.open { display: flex; }
.si-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 15, 60, 0.55);
}
.si-modal-card {
  position: relative;
  background: #fff;
  border-radius: 0;
  width: min(640px, 95vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
  overflow: hidden;
}
.si-modal-header {
  background: #0A0F3C;
  color: #fff;
  padding: 0.7rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.si-modal-header h2 { margin: 0; font-size: 1.05rem; font-weight: 600; }
#si-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.3rem;
}
.si-modal-body {
  padding: 0;
  overflow-y: auto;
}
.si-photo {
  width: 100%;
  max-height: 280px;
  overflow: hidden;
  background: #0A0F3C;
  position: relative;
}
.si-photo img {
  width: 100%;
  height: auto;
  display: block;
  max-height: 280px;
  object-fit: cover;
}
.si-photo-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(10, 15, 60, 0.7);
  color: #fff;
  padding: 0.4rem 0.75rem;
  font-size: 0.72rem;
  font-style: italic;
}
.si-photo-placeholder {
  height: 140px;
  background: linear-gradient(135deg, #e8eaf0 0%, #c8d0e0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1rem;
}
.si-photo-pl-icon { font-size: 2.4rem; opacity: 0.5; }
.si-photo-pl-text { font-size: 0.85rem; color: #1a2a4a; }
.si-photo-pl-text a { color: #0A0F3C; font-weight: 500; }

.si-meta {
  padding: 0.75rem 1.2rem;
  background: #f5f7fa;
  border-bottom: 1px solid #e8eaef;
  font-size: 0.82rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.3rem 1rem;
}
.si-meta-label {
  color: #5a6378;
  font-size: 0.72rem;
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.si-section {
  padding: 0.8rem 1.2rem;
  border-bottom: 1px solid #f0f2f5;
}
.si-section:last-child { border-bottom: none; }
.si-section h3 {
  margin: 0 0 0.4rem;
  font-size: 0.88rem;
  color: #0A0F3C;
  font-weight: 600;
}
.si-section p {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #2a2a2a;
}
.si-instruments {
  list-style: none;
  padding: 0;
  margin: 0;
}
.si-instruments li {
  padding: 0.4rem 0;
  border-bottom: 1px dotted #e0e3e8;
  font-size: 0.82rem;
}
.si-instruments li:last-child { border-bottom: none; }
.si-instruments li b { color: #0A0F3C; }
.si-instruments .si-what {
  color: #5a6378;
  font-size: 0.78rem;
  line-height: 1.4;
}
.si-external {
  display: inline-block;
  padding: 0.45rem 0.8rem;
  background: #0A0F3C;
  color: #fff !important;
  text-decoration: none;
  border-radius: 0;
  font-size: 0.82rem;
  font-weight: 500;
}
.si-external:hover { background: #2a2f6c; }

/* Værktøj-popup styling */
.tool-popup button {
  padding: 0.3rem 0.6rem;
  font-size: 0.78rem;
  border: 1px solid #b8c4cc;
  background: #f8f9fb;
  border-radius: 0;
  cursor: pointer;
  margin-right: 0.3rem;
}
.tool-popup button:hover { background: #0A0F3C; color: #fff; border-color: #0A0F3C; }
.tool-popup .coord {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-weight: 600;
  color: #0A0F3C;
}

/* Mobile */
@media (max-width: 768px) {
  #panel {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    z-index: 999;
    width: 85%;
    max-width: 340px;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 4px 0 12px rgba(0,0,0,0.15);
  }
  #panel.open { transform: translateX(0); }
  /* Leaflets knapper har z-index 1000 — panelet skal ligge over dem, ellers
     dækker værktøjslinjen og baggrundsmærkaten for panelets tekst. */
  #panel { z-index: 1500; padding-top: 3.2rem; }
  #toggle-panel { display: block; z-index: 1600; }
  /* ☰-knappen står øverst til venstre; skub kortets egne knapper ned under den */
  .leaflet-top.leaflet-left { top: 2.9rem; }
}

/* Scene-info: hvilke satellitscener vises i udsnittet (sentinel-hub.js) */
.sh-scene-info {
  background: rgba(255,255,255,0.94);
  border: 1px solid #d8dde3;
  border-radius: 0;
  padding: 0.45rem 0.65rem;
  font-size: 0.72rem;
  line-height: 1.5;
  color: #1b2030;
  max-width: 260px;
  box-shadow: 0 1px 4px rgba(10,15,60,0.15);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.sh-scene-info b { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.sh-scene-more { color: #777; font-size: 0.66rem; }

/* To tilstande for Sentinel Hub-boksen: en forklaring når instansen mangler,
   og status-rækken når den er på plads. updateShStatus() sætter .connected. */
#sh-config .sh-ok { display: none; }
#sh-config.connected .sh-ok { display: block; }
#sh-config.connected .sh-mangler { display: none; }
#sh-config .sh-mangler p { margin: 0.3rem 0 0; font-size: 0.78rem; line-height: 1.5; color: #6a4a2a; }
#sh-config .sh-mangler strong { display: block; color: #8a4a1a; font-size: 0.82rem; }

/* Ægte satellitpixels: browseren forstørrer 10 m-fliserne med skarpe kanter
   i stedet for at udglatte dem, så eleverne kan se, at hver farveflade dækker
   10×10 meter på jorden. Bruges kun hvor profilen beder om det. */
.sh-pixels img,
.leaflet-tile-pane .sh-pixels img {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* ─── Elevvisning — kortets standard (js/elevvisning.js) ─────────────────────
   Den almindelige bruger er en elev, der skal slå ét tal op. Alt andet ligger bag
   «Flere værktøjer» nederst i panelet. */

/* "Sentinel Hub forbundet · skift instans" er udvikler-UI og vises aldrig, når
   instansen er sat. Mangler den, står forklaringen der stadig. */
#sh-config.connected { display: none; }

#panel ol.intro-trin { margin: 0.2rem 0 0.6rem; padding-left: 1.25rem; font-size: 0.85rem; line-height: 1.55; color: #333; }
#panel ol.intro-trin li { margin: 0.2rem 0; }
#panel p.flere { margin: 1.1rem 0 0.4rem; font-size: 0.8rem; }
#panel p.flere .link-btn { color: #555; background: none; border: none; padding: 0; font: inherit; font-size: 0.8rem; text-decoration: underline; cursor: pointer; }
#panel p.flere .link-btn:hover { color: #D4763C; }

/* Avancerede panelsektioner: overskriften og det indhold, ui.js pakker ind efter den */
html.elevvisning #panel h2.avanceret,
html.elevvisning #panel h2.avanceret + .collapse-content,
html.elevvisning #panel .avanceret-blok { display: none !important; }
/* I albedo-gruppen er kun albedolaget for eleven (NDSI og NDWI er avancerede) */
html.elevvisning #glacial-layers .layer:not([data-lag="ALBEDO"]) { display: none; }

/* Værktøjslinjen: Danmarkskortet har ingen (klik = opslag), Grønlandskortet kun ⓘ */
html.elevvisning[data-profil="dk"] .tool-bar { display: none; }
html.elevvisning .tool-bar .tool-btn:not([data-tool="pixel-info"]) { display: none; }

/* Oven på kortet: kun målestok og signaturforklaring bliver */
html.elevvisning #basemap-badge,
html.elevvisning .sh-scene-info,
html.elevvisning #coord-readout,
html.elevvisning .leg-desc { display: none !important; }

/* ⓘ er det værktøj eleverne skal bruge — gør det tydeligt */
.tool-btn.fremhaev { background: #0A0F3C; color: #fff; }
.tool-btn.fremhaev.active { background: #D4763C; }
.px-hint {
  position: absolute; z-index: 1001; white-space: nowrap; max-width: calc(100vw - 5rem);
  background: #0A0F3C; color: #fff; font-size: 0.8rem; padding: 0.35rem 0.6rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25); pointer-events: none;
}
.px-hint::before {
  content: ""; position: absolute; left: -6px; top: 50%; transform: translateY(-50%);
  border: 6px solid transparent; border-left: none; border-right-color: #0A0F3C;
}
/* Danmarkskortet i elevvisning: hjælpeteksten står øverst midt på kortet */
.px-hint.midt { left: 50%; top: 0.8rem; transform: translateX(-50%); font-size: 0.9rem; padding: 0.5rem 0.9rem; }
.px-hint.midt::before { display: none; }

/* Søgefelt (Danmarkskortet) */
.soeg { position: relative; margin: 0.2rem 0 0.7rem; }
.soeg input { width: 100%; padding: 0.5rem 0.6rem; font: inherit; font-size: 0.88rem; border: 1px solid #0A0F3C; border-radius: 0; background: #fff; }
.soeg-resultater { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; margin: 0; padding: 0; list-style: none;
  background: #fff; border: 1px solid #0A0F3C; border-top: none; box-shadow: 0 4px 10px rgba(0,0,0,0.15); max-height: 16rem; overflow-y: auto; }
.soeg-resultater li button { display: block; width: 100%; text-align: left; padding: 0.45rem 0.6rem; font: inherit; font-size: 0.82rem;
  border: none; border-bottom: 1px solid #eef1f5; background: #fff; cursor: pointer; }
.soeg-resultater li button:hover, .soeg-resultater li button:focus { background: #eef3fb; }
.soeg-resultater li.tom { padding: 0.5rem 0.6rem; font-size: 0.8rem; color: #777; }
