/* EarthquakeIndex design 1 v2 — KONTROLRUM: neutral grafit, hvid interaktion, grøn kun til live.
   Magnitude-farverne er de eneste "rigtige" farver — dataene er helten. */

:root {
  --bg:        #0a0c0b;
  --glass:     rgba(15, 18, 16, .84);
  --glass-2:   rgba(24, 28, 26, .9);
  --panel-2:   #1d2320;
  --ink:       #edf1ed;
  --ink-2:     #aab3ac;
  --muted:     #6f7a72;
  --line:      rgba(255, 255, 255, .09);
  --hi:        #edf1ed;                    /* interaktion: hvid */
  --hi-soft:   rgba(255, 255, 255, .08);
  --live:      #34c979;                    /* grøn: KUN live-status */

  --m0: #6b7686;  --m0-t: #a7b1bf;
  --m2: #2fa863;  --m2-t: #63d494;
  --m4: #e8b421;  --m4-t: #ffd45e;
  --m5: #e26212;  --m5-t: #ff9350;
  --m6: #a53a12;  --m6-t: #e0703a;

  --radius: 14px;
  --shadow: 0 10px 32px rgba(0, 0, 0, .5);
  --shadow-soft: 0 2px 8px rgba(0, 0, 0, .28);
  font-size: 15px;
}

[hidden] { display: none !important; }

* { margin: 0; padding: 0; box-sizing: border-box; scrollbar-width: thin; scrollbar-color: #2c342f transparent; }

html, body { height: 100%; }

body {
  font-family: "Space Grotesk", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  overflow: hidden;
}

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: var(--ink-2); }
::selection { background: rgba(255, 255, 255, .22); }
:focus-visible { outline: 2px solid var(--hi); outline-offset: 2px; }

/* ------------------------------------------------- kortet ER skærmen */

#map { position: fixed; inset: 0; z-index: 1; background: var(--bg); }

.leaflet-container { font: inherit; background: var(--bg); }
.leaflet-container .leaflet-control-attribution {
  background: rgba(10, 12, 11, .75); color: var(--muted); font-size: .6rem;
  margin: 0 14px calc(var(--strip-top, 180px) + 8px) 0;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
}
.leaflet-container .leaflet-control-attribution a { color: var(--ink-2); }
/* zoom-knapper forankres ved seismogrammets venstre kant, lige til højre for listen */
.leaflet-bottom.leaflet-left .leaflet-control-zoom { margin-left: 388px !important; margin-bottom: calc(var(--strip-top, 180px) + 18px) !important; }
.leaflet-bar { border: 1px solid var(--line) !important; box-shadow: var(--shadow); }
.leaflet-bar a { background: var(--glass); color: var(--ink-2); border-bottom: 1px solid var(--line); }
.leaflet-bar a:hover { background: var(--glass-2); color: var(--ink); }
.leaflet-tooltip {
  background: var(--glass-2); color: var(--ink);
  border: 1px solid var(--line); box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.leaflet-tooltip-top:before { border-top-color: rgba(255, 255, 255, .25); }

.quake-pulse { pointer-events: none; }
.quake-pulse span {
  display: block; width: 100%; height: 100%; border-radius: 50%;
  border: 3px solid var(--live);
  animation: ring 2.2s ease-out infinite;
}
@keyframes ring { 0% { transform: scale(.3); opacity: .9; } 100% { transform: scale(1.4); opacity: 0; } }

/* ------------------------------------------------------ svævende topbar */

.topbar {
  position: fixed; top: 14px; left: 14px; right: 14px; z-index: 900;
  display: flex; align-items: center; gap: 20px;
  padding: 10px 16px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.brand { display: flex; align-items: center; gap: 11px; flex: 0 0 auto; }
.brand-mark { width: 38px; height: 38px; border-radius: 9px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 1.08rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.brand-text span { font-size: .7rem; color: var(--muted); letter-spacing: .04em; }

/* de 4 hovedtal: tydelige celler med skillelinjer */
.kpis { display: flex; gap: 0; margin-left: auto; min-width: 0; }
.kpi {
  display: flex; flex-direction: column; line-height: 1.2; min-width: 0;
  padding: 2px 22px;
  border-left: 1px solid var(--line);
  overflow: hidden;
}
.kpi-value { font-size: 1.45rem; font-weight: 700; color: var(--ink); white-space: nowrap; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; }
.kpi-label { font-size: .62rem; color: var(--ink-2); text-transform: uppercase; letter-spacing: .1em; }
.kpi-trend {
  font-size: .66rem; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 170px;
}
.kpi-sub { display: none; }

.topbar-status { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.utc-clock {
  font-size: .78rem; color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
}
.live-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px;
  border: 1px solid var(--line); border-radius: 999px;
  font-size: .78rem; color: var(--ink-2);
  background: rgba(24, 28, 26, .6);
}
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.live-pill.is-live { border-color: rgba(52, 201, 121, .5); color: var(--live); }
.live-pill.is-live .live-dot { background: var(--live); animation: pulse 2s ease-out infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 201, 121, .5); }
  70% { box-shadow: 0 0 0 8px rgba(52, 201, 121, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 201, 121, 0); }
}

/* ------------------------------------------------- svævende venstre panel */

.sidebar {
  position: fixed; top: var(--panels-top, 86px); left: 14px; bottom: calc(var(--strip-top, 180px) + 14px); z-index: 800;
  width: 360px;
  display: flex; flex-direction: column;
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.filters { padding: 14px 14px 12px; border-bottom: 1px solid var(--line); }

.filter-label {
  display: block;
  font-size: .6rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: .12em;
  margin: 11px 2px 5px;
}

/* kompakte, altid synlige filtre: søgefelt + ikonknapper + 2×2 dropdowns */
.search-row { display: flex; gap: 6px; }
.search-wrap { position: relative; flex: 1 1 auto; min-width: 0; }

.icon-btn {
  flex: 0 0 auto;
  width: 37px; height: 37px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 9px;
  color: var(--ink-2);
  background: rgba(10, 12, 11, .6);
}
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:hover { color: var(--ink); background: var(--panel-2); }
.icon-btn.is-active { color: var(--live); border-color: rgba(52, 201, 121, .55); }

.select-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 8px;
}
.select-grid select {
  width: 100%;
  font: inherit; font-size: .78rem; color: var(--ink);
  padding: 6px 8px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel-2);
}
.select-grid select:hover { border-color: rgba(255, 255, 255, .2); }

.count-row { margin-top: 8px; display: flex; justify-content: flex-end; }

/* menu-dropdown (genbruger lang-list-udtrykket) */
.menu-src {
  margin-top: 4px; padding: 8px 11px 4px;
  border-top: 1px solid var(--line);
  font-size: .7rem; color: var(--muted);
}
.menu-src a { font-size: .7rem; }
.search-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted); }
#searchInput {
  width: 100%; padding: 9px 12px 9px 33px;
  border: 1px solid var(--line); border-radius: 9px;
  font: inherit; color: var(--ink);
  background: rgba(10, 12, 11, .6);
}
#searchInput::placeholder { color: var(--muted); }
#searchInput:focus { outline: 2px solid var(--hi); outline-offset: -1px; }

.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 4px 11px;
  border: 1px solid var(--line); border-radius: 999px;
  font-size: .77rem; color: var(--ink-2);
  background: transparent;
}
.chip:hover { background: var(--panel-2); color: var(--ink); }
.chip.is-active { background: var(--hi); border-color: var(--hi); color: var(--bg); font-weight: 600; }

.custom-range { display: flex; align-items: center; gap: 6px; margin-top: 7px; }
.custom-range input {
  flex: 1 1 auto; min-width: 0;
  padding: 5px 8px;
  border: 1px solid var(--line); border-radius: 8px;
  font: inherit; font-size: .78rem; color: var(--ink);
  background: rgba(10, 12, 11, .6);
  color-scheme: dark;
}
.custom-range-sep { color: var(--muted); font-size: .8rem; }

.felt-badge {
  font-size: .68rem; font-weight: 600;
  color: var(--m4-t);
  letter-spacing: .02em;
}

.sort-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  margin-top: 12px; padding-top: 11px;
  border-top: 1px solid var(--line);
}
.tool-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.result-count { margin-left: auto; font-size: .74rem; color: var(--muted); font-variant-numeric: tabular-nums; }

.event-list { flex: 1 1 auto; overflow-y: auto; padding: 6px; }

.side-links {
  flex: 0 0 auto;
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px 14px;
  padding: 9px 14px;
  border-top: 1px solid var(--line);
}
.side-links a { font-size: .74rem; color: var(--muted); text-decoration: none; }
.side-links a:hover { color: var(--ink); }
.side-links-src { margin-left: auto; font-size: .68rem; color: var(--muted); }
.side-links-src a { font-size: .68rem; }
.event-card {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 9px;
  border-radius: 9px;
  text-align: left;
  border: 1px solid transparent;
}
.event-card:hover { background: rgba(29, 35, 32, .85); }
.event-card.is-selected { background: var(--hi-soft); border-color: rgba(255, 255, 255, .3); }
.event-card.is-new { animation: flash-in 1.8s ease-out; }
@keyframes flash-in { 0% { background: var(--hi-soft); } 100% { background: transparent; } }

.mag-badge {
  flex: 0 0 auto;
  width: 46px; height: 38px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .95rem;
  font-variant-numeric: tabular-nums;
}
.mag-badge.b-m0 { background: rgba(107, 118, 134, .18); color: var(--m0-t); box-shadow: inset 0 0 0 1px rgba(107, 118, 134, .35); }
.mag-badge.b-m2 { background: rgba(47, 168, 99, .16); color: var(--m2-t); box-shadow: inset 0 0 0 1px rgba(47, 168, 99, .4); }
.mag-badge.b-m4 { background: rgba(232, 180, 33, .14); color: var(--m4-t); box-shadow: inset 0 0 0 1px rgba(232, 180, 33, .4); }
.mag-badge.b-m5 { background: rgba(226, 98, 18, .16); color: var(--m5-t); box-shadow: inset 0 0 0 1px rgba(226, 98, 18, .45); }
.mag-badge.b-m6 { background: rgba(165, 58, 18, .22); color: var(--m6-t); box-shadow: inset 0 0 0 1px rgba(224, 112, 58, .55), 0 0 12px rgba(226, 98, 18, .25); }

.event-main { min-width: 0; flex: 1 1 auto; }
.event-region { font-size: .84rem; font-weight: 600; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.event-meta { font-size: .73rem; color: var(--muted); }
.list-empty { padding: 26px 14px; text-align: center; color: var(--muted); font-size: .85rem; }

/* ------------------------------------------------- højre kolonne (info) */

.rightcol {
  position: fixed; top: var(--panels-top, 86px); right: 14px; bottom: calc(var(--strip-top, 180px) + 14px); z-index: 800;
  width: 218px;
  display: flex; flex-direction: column; gap: 10px;
  overflow-y: auto;
}
.side-card {
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 9px 9px 7px;
  flex: 0 0 auto;
}
.side-title {
  display: block;
  font-size: .62rem; color: var(--muted);
  padding: 0 5px 5px;
  text-transform: uppercase; letter-spacing: .1em;
}

/* legend */
.legend-card { display: flex; flex-direction: column; gap: 1px; }
.legend-row { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 7px; font-size: .78rem; }
.legend-row:hover { background: var(--panel-2); }
.legend-row.is-active { background: var(--hi-soft); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3); }
.legend-dot { width: 11px; height: 11px; border-radius: 50%; flex: 0 0 auto; }
.dot-m0 { background: var(--m0); }
.dot-m2 { background: var(--m2); }
.dot-m4 { background: var(--m4); }
.dot-m5 { background: var(--m5); }
.dot-m6 { background: var(--m6); box-shadow: 0 0 8px rgba(226, 98, 18, .5); }
.legend-lab { color: var(--ink-2); }
.legend-count { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; font-size: .74rem; }

/* dybde */
.depth-row {
  position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 5px 6px 9px;
}
.depth-lab { font-size: .72rem; color: var(--ink-2); }
.depth-n { font-size: .72rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.depth-bar {
  position: absolute; left: 6px; bottom: 4px;
  height: 3px; border-radius: 2px;
  background: var(--ink-2);
  min-width: 2px;
  max-width: calc(100% - 12px);
}

/* regioner */
.region-row {
  position: relative;
  width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 5px 6px 9px;
  border-radius: 7px;
  text-align: left;
}
.region-row:hover { background: var(--panel-2); }
.region-name {
  font-size: .72rem; color: var(--ink-2); font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.region-n { font-size: .72rem; color: var(--muted); font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.region-bar {
  position: absolute; left: 6px; bottom: 4px;
  height: 3px; border-radius: 2px;
  background: var(--ink-2);
  min-width: 2px;
  max-width: calc(100% - 12px);
}
.side-empty { font-size: .72rem; color: var(--muted); padding: 2px 6px 6px; }

/* --------------------------------------------- seismogram (bundstriben) */

.activity-card {
  position: fixed; left: 14px; right: 14px; bottom: 14px; z-index: 800;
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.activity-head {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 7px 13px 4px;
  font-size: .73rem; color: var(--ink-2); font-weight: 600; letter-spacing: .03em;
}
.activity-ctrl { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.activity-ctrl select {
  font: inherit; font-size: .72rem; color: var(--ink-2);
  padding: 3px 6px;
  border: 1px solid var(--line); border-radius: 7px;
  background: var(--panel-2);
}
.activity-ctrl select:hover { color: var(--ink); }
.activity-collapse {
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 7px; color: var(--ink-2);
}
.activity-collapse:hover { background: var(--panel-2); color: var(--ink); }
.activity-chev { width: 14px; height: 14px; transition: transform .2s; }
.activity-card.is-collapsed .activity-chev { transform: rotate(180deg); }
.activity-card.is-collapsed .activity-body { display: none; }

.activity-body { position: relative; padding: 2px 13px 8px; }
.chart { position: relative; height: 96px; }
.chart.is-seismo { cursor: crosshair; touch-action: pan-y; }

.seismo-guide {
  position: absolute; left: 0; right: 0;
  border-top: 1px solid rgba(255, 255, 255, .07);
  pointer-events: none;
}
.seismo-guide b {
  position: absolute; right: 2px; top: -14px;
  font-size: .58rem; font-weight: 500; color: var(--muted);
}
.seismo-tick {
  position: absolute; top: 0; bottom: 0;
  border-left: 1px solid rgba(255, 255, 255, .06);
  pointer-events: none;
}
.seismo-sel {
  position: absolute; top: 0; bottom: 0;
  background: rgba(255, 255, 255, .09);
  border-left: 1px solid rgba(255, 255, 255, .4);
  border-right: 1px solid rgba(255, 255, 255, .4);
  pointer-events: none;
}
.seismo-dot {
  position: absolute;
  width: 9px; height: 9px;
  border-radius: 50%;
  transform: translate(-50%, 50%);
  padding: 0;
  transition: transform .12s;
}
.seismo-dot:hover { transform: translate(-50%, 50%) scale(1.7); z-index: 5; }
.chart-axis { display: flex; justify-content: space-between; font-size: .64rem; color: var(--muted); padding-top: 5px; }
.chart-axis.is-ticks {
  display: block; position: relative; height: 18px;
  font-variant-numeric: tabular-nums;
}
.chart-axis.is-ticks span { position: absolute; top: 4px; transform: translateX(-50%); white-space: nowrap; }
.chart-axis.is-ticks .axis-end { right: 0; left: auto; transform: none; }
.chart-tip {
  position: absolute; z-index: 10;
  background: var(--glass-2); color: var(--ink);
  border: 1px solid var(--line);
  font-size: .72rem; padding: 4px 9px; border-radius: 7px;
  pointer-events: none; white-space: nowrap;
  transform: translate(-50%, calc(-100% - 8px));
  box-shadow: var(--shadow);
}
/* fallback: soejle-tilstand hvis seismo ikke er aktiv */
.chart-col { flex: 1 1 0; display: flex; align-items: flex-end; height: 100%; min-width: 0; }
.chart-col > i { display: block; width: 100%; background: var(--ink-2); border-radius: 4px 4px 0 0; min-height: 2px; }

/* --------------------------------------------------------- detaljepanel */

.detail-panel {
  position: fixed; top: var(--panels-top, 86px); right: 246px; z-index: 850;
  width: min(340px, calc(100% - 640px));
  max-height: calc(100vh - var(--panels-top, 86px) - var(--strip-top, 180px) - 28px);
  overflow-y: auto;
  background: var(--glass-2);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
}
.detail-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.detail-mag { width: 60px; height: 54px; font-size: 1.4rem; border-radius: 11px; }
.detail-region { font-size: .96rem; font-weight: 700; line-height: 1.3; }
.detail-close { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 7px; color: var(--muted); font-size: 1rem; }
.detail-close:hover { background: var(--panel-2); color: var(--ink); }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 12px; margin-bottom: 12px; }
.detail-item { display: flex; flex-direction: column; }
.detail-item dt { font-size: .6rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.detail-item dd { font-size: .85rem; font-weight: 600; }
.detail-item dd small { font-weight: 400; color: var(--ink-2); }
.detail-mt {
  display: flex; flex-direction: column; gap: 2px;
  margin: -4px 0 12px;
  padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 9px;
  background: rgba(10, 12, 11, .4);
}
.detail-mt-title {
  font-size: .62rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: .08em;
  margin-bottom: 2px;
}
.detail-mt-row { font-size: .76rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }

.detail-link { display: inline-block; font-size: .8rem; font-weight: 600; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.detail-link:hover { color: var(--live); }

/* kommentarer i detaljepanelet */
.cmts { margin-top: 14px; padding-top: 11px; border-top: 1px solid var(--line); }
.cmts-title {
  display: block;
  font-size: .62rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: .1em;
  margin-bottom: 7px;
}
.cmts-felt { color: var(--m4-t); text-transform: none; letter-spacing: 0; font-size: .68rem; margin-left: 6px; }
.cmt-list { max-height: 180px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.cmt { display: flex; flex-direction: column; gap: 1px; }
.cmt-head { font-size: .72rem; color: var(--muted); }
.cmt-head b { color: var(--ink-2); }
.cmt-body { font-size: .82rem; color: var(--ink); line-height: 1.4; overflow-wrap: anywhere; }
.cmt-empty { font-size: .76rem; color: var(--muted); }

.cmt-form { display: flex; flex-direction: column; gap: 6px; }
.cmt-form input[type="text"], .cmt-form textarea {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--line); border-radius: 8px;
  font: inherit; font-size: .8rem; color: var(--ink);
  background: rgba(10, 12, 11, .6);
  resize: vertical;
}
.cmt-form ::placeholder { color: var(--muted); }
.cmt-hp { position: absolute !important; left: -9999px !important; width: 1px !important; height: 1px !important; opacity: 0; }
.cmt-send-row { display: flex; align-items: center; gap: 10px; }
.cmt-privacy { flex: 1 1 auto; font-size: .62rem; color: var(--muted); line-height: 1.35; }
.cmt-send {
  flex: 0 0 auto;
  padding: 7px 16px;
  border-radius: 999px;
  background: var(--hi); color: var(--bg);
  font-weight: 600; font-size: .8rem;
}
.cmt-send:disabled { opacity: .5; }
.cmt-send:hover:not(:disabled) { background: #fff; }

/* global kommentar-strøm ("chatten") */
.chat-row {
  width: 100%;
  display: flex; flex-direction: column; gap: 1px;
  padding: 6px;
  border-radius: 8px;
  text-align: left;
}
.chat-row:hover { background: var(--panel-2); }
.chat-head { font-size: .68rem; color: var(--muted); }
.chat-head b { color: var(--ink-2); }
.chat-quake { font-size: .68rem; color: var(--m4-t); }
.chat-body { font-size: .76rem; color: var(--ink-2); line-height: 1.35; overflow-wrap: anywhere; }

/* ------------------------------------------------------------------ mv. */

.toast {
  position: fixed; top: var(--panels-top, 86px); left: 50%; transform: translateX(-50%); z-index: 950;
  background: var(--glass-2);
  border: 1px solid rgba(255, 255, 255, .25);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  color: var(--ink);
  padding: 9px 16px; border-radius: 999px;
  font-size: .82rem; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 8px;
  cursor: pointer;
  animation: toast-in .25s ease-out;
  max-width: min(520px, calc(100% - 28px));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -8px); } }
.toast .legend-dot { flex: 0 0 auto; }

.foot { display: none; font-size: .68rem; color: var(--muted); }
.foot a { color: var(--ink-2); }
.noscript { position: fixed; inset: 0; z-index: 999; background: var(--bg); padding: 40px; text-align: center; }

/* topbaren strammes trinvist, saa status-knapperne aldrig rammer KPI-cellerne */
@media (max-width: 1600px) {
  .utc-clock { display: none; }
  .kpi { padding: 2px 16px; }
  .kpis { gap: 0; }
}
@media (max-width: 1460px) {
  .kpi-value { font-size: 1.18rem; }
  .kpi-label { font-size: .58rem; }
  .kpi-trend { max-width: 110px; font-size: .62rem; }
  .brand-text span { display: none; }
  .topbar { gap: 14px; }
  .kpi { padding: 2px 12px; }
}

/* ------------------------------------------------------------ responsiv */

@media (max-width: 1250px) {
  .kpis { gap: 16px; }
  .kpi-trend { max-width: 110px; }
  .utc-clock { display: none; }
}

@media (max-width: 1020px) and (min-width: 901px) {
  .rightcol { width: 190px; }
  .activity-card { left: 388px; }
  .detail-panel { right: 214px; width: min(320px, calc(100% - 600px)); }
}

/* ---- mobil: alt bliver til én rullende kolonne, kortet øverst ---- */
@media (max-width: 900px) {
  body { overflow: auto; display: flex; flex-direction: column; }

  .topbar {
    position: static; order: 0;
    margin: 8px 8px 0; gap: 10px;
    flex-wrap: wrap;
    border-radius: 12px;
  }
  .brand { flex: 1 1 auto; }
  .topbar-status { margin-left: auto; }
  .utc-clock { display: none; }
  .kpis {
    order: 5; width: 100%;
    margin: 4px 0 0;
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    border-top: 1px solid var(--line);
    padding-top: 8px;
  }
  .kpi { border-left: 0; padding: 0; }
  .kpi-value { font-size: 1.05rem; }
  .kpi-trend { max-width: 100%; }

  #map {
    position: relative; inset: auto; order: 1;
    width: auto; height: 44vh; min-height: 300px;
    margin: 8px; border-radius: 12px;
    border: 1px solid var(--line);
    overflow: hidden;
  }
  .leaflet-control-zoom { margin-bottom: 14px !important; }

  .sidebar {
    position: static; order: 3;
    width: auto; margin: 0 8px 8px;
    max-height: 62vh;
  }

  .rightcol {
    position: static; order: 2;
    width: auto; margin: 0 8px 8px;
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 8px; overflow: visible;
  }
  .rightcol .side-card:last-child { grid-column: 1 / -1; }

  .activity-card { position: static; order: 4; margin: 0 8px 8px; }

  .detail-panel {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0;
    width: auto; max-height: 72vh; overflow-y: auto;
    border-radius: 16px 16px 0 0;
    z-index: 1000;
  }

  .toast { position: fixed; top: 12px; }
  .foot { display: block; order: 6; margin: 0 8px 10px; }
  .leaflet-container .leaflet-control-attribution { margin-bottom: 0; }
  .leaflet-bottom.leaflet-left .leaflet-control-zoom { margin-left: 14px !important; margin-bottom: 14px !important; }
}

/* ------------------------------------------- sprogvælger (dropdown, 30+ sprog) */
.lang-menu { position: relative; }
.lang-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 11px;
  border: 1px solid var(--line); border-radius: 999px;
  font-size: .76rem; color: var(--ink-2); font-weight: 600;
  letter-spacing: .05em;
  background: rgba(24, 28, 26, .6);
}
.lang-btn:hover { color: var(--ink); border-color: rgba(255, 255, 255, .2); }
.lang-btn svg { width: 15px; height: 15px; }
.lang-btn .lang-chev { width: 12px; height: 12px; }
.lang-btn[aria-expanded="true"] .lang-chev { transform: rotate(180deg); }

.lang-list {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 999;
  min-width: 170px; max-height: 340px; overflow-y: auto;
  margin: 0; padding: 5px; list-style: none;
  background: var(--glass-2);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow);
}
.lang-list a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 11px;
  border-radius: 8px;
  font-size: .82rem; color: var(--ink-2);
  text-decoration: none;
}
.lang-list a:hover { background: var(--panel-2); color: var(--ink); }
.lang-list a.is-active { color: var(--ink); font-weight: 600; }
.lang-list a.is-active::after { content: "✓"; color: var(--live); margin-left: 12px; }

/* "tilbage til alle skælv"-bjælken (aktivt område-/søgefilter) */
.scope-bar {
  display: block;
  margin: 0 8px 4px;
  padding: 8px 12px;
  background: var(--hi-soft);
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 9px;
  font-size: .78rem; font-weight: 600; color: var(--ink);
  text-align: left;
}
.scope-bar:hover { background: rgba(255, 255, 255, .14); }
.scope-bar b { font-weight: 400; color: var(--ink-2); }

/* sammenklappelige højre-paneler + kompakt kommentar-strøm */
/* diskret skygge: den store panelskygge fyldte 10px-mellemrummene som mørke bånd
   og blev klippet af kolonnens overflow — så "mærkelig" ud på de smalle bjælker */
.rightcol .side-card { box-shadow: var(--shadow-soft); }
.rightcol .side-title { cursor: pointer; display: flex; align-items: center; justify-content: space-between; }
.rightcol .side-title::after { content: "▾"; color: var(--muted); font-size: .7rem; margin-left: 8px; }
.rightcol .side-card.is-collapsed .side-title::after { content: "▸"; }
.rightcol .side-card.is-collapsed > :not(.side-title) { display: none; }
#chatFeed { max-height: 300px; overflow-y: auto; }
.chat-more {
  width: 100%;
  margin-top: 4px; padding: 6px;
  border-radius: 8px;
  font-size: .72rem; font-weight: 600; color: var(--ink-2);
  background: var(--hi-soft);
}
.chat-more:hover { color: var(--ink); }

/* ------------------------------------------------------------- LYST TEMA */
:root[data-theme="light"] {
  --bg:        #eef1ed;
  --glass:     rgba(252, 253, 252, .88);
  --glass-2:   rgba(255, 255, 255, .95);
  --panel-2:   #e2e7e1;
  --ink:       #131714;
  --ink-2:     #46504a;
  --muted:     #78827a;
  --line:      rgba(15, 23, 17, .13);
  --hi:        #131714;
  --hi-soft:   rgba(15, 23, 17, .06);
  --live:      #0f8746;
  --shadow:    0 10px 28px rgba(20, 26, 22, .16);
  --shadow-soft: 0 2px 8px rgba(20, 26, 22, .1);

  /* magnitude-palette valideret mod LYS flade; tints = mørkere streger/tekst */
  --m0: #8a918c;  --m0-t: #5f6661;
  --m2: #27a05a;  --m2-t: #1c7440;
  --m4: #dba708;  --m4-t: #8a6a03;
  --m5: #cc5f08;  --m5-t: #9a4706;
  --m6: #7d3c14;  --m6-t: #572a0d;
}
:root[data-theme="light"] * { scrollbar-color: #b9c1ba transparent; }
:root[data-theme="light"] ::selection { background: rgba(15, 23, 17, .16); }
:root[data-theme="light"] #searchInput,
:root[data-theme="light"] .custom-range input,
:root[data-theme="light"] .icon-btn,
:root[data-theme="light"] .cmt-form input[type="text"],
:root[data-theme="light"] .cmt-form textarea { background: rgba(255, 255, 255, .8); }
:root[data-theme="light"] .custom-range input { color-scheme: light; }
:root[data-theme="light"] .live-pill { background: rgba(255, 255, 255, .65); }
:root[data-theme="light"] .leaflet-container .leaflet-control-attribution { background: rgba(255, 255, 255, .8); }
:root[data-theme="light"] .leaflet-tooltip-top:before { border-top-color: rgba(15, 23, 17, .22); }
:root[data-theme="light"] .event-card:hover { background: rgba(15, 23, 17, .05); }
:root[data-theme="light"] .event-card.is-selected { border-color: rgba(15, 23, 17, .28); }
:root[data-theme="light"] .legend-row.is-active { box-shadow: inset 0 0 0 1px rgba(15, 23, 17, .28); }
:root[data-theme="light"] .scope-bar { border-color: rgba(15, 23, 17, .22); }
:root[data-theme="light"] .scope-bar:hover { background: rgba(15, 23, 17, .1); }
:root[data-theme="light"] .seismo-guide { border-top-color: rgba(15, 23, 17, .09); }
:root[data-theme="light"] .seismo-tick { border-left-color: rgba(15, 23, 17, .09); }
:root[data-theme="light"] .seismo-sel { background: rgba(15, 23, 17, .08); border-left-color: rgba(15, 23, 17, .35); border-right-color: rgba(15, 23, 17, .35); }
:root[data-theme="light"] .toast { border-color: rgba(15, 23, 17, .28); }
:root[data-theme="light"] .detail-mt { background: rgba(15, 23, 17, .04); }
:root[data-theme="light"] .dot-m6 { box-shadow: none; }
:root[data-theme="light"] .mag-badge.b-m6 { box-shadow: inset 0 0 0 1px rgba(125, 60, 20, .5); }
:root[data-theme="light"] .cmt-send:hover:not(:disabled) { background: #000; }
:root[data-theme="light"] .chip.is-active { color: #fff; }
:root[data-theme="light"] .cmt-send { color: #fff; }
:root[data-theme="light"] .lang-btn { background: rgba(255, 255, 255, .7); }
:root[data-theme="light"] .lang-list { background: #ffffff; }
:root[data-theme="light"] .activity-ctrl select, :root[data-theme="light"] #sortSelect { background: #ffffff; }

/* følt-punkter-knap i detaljepanelet */
.felt-map-btn {
  display: block; width: 100%;
  margin-top: 10px;
  padding: 8px 12px;
  border: 1px solid rgba(232, 180, 33, .4); border-radius: 9px;
  font-size: .78rem; font-weight: 600; color: var(--m4-t);
  background: rgba(232, 180, 33, .1);
  text-align: left;
}
.felt-map-btn:hover:not(:disabled) { background: rgba(232, 180, 33, .18); }
.felt-map-btn:disabled { opacity: .6; }
.felt-cc { display: block; margin-top: 4px; font-size: .6rem; color: var(--muted); }

/* pille når detaljepanelet viger for følt-punkterne */
.felt-pill {
  position: fixed; top: var(--panels-top, 86px); left: 50%; transform: translateX(-50%);
  z-index: 950;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px;
  background: var(--glass-2);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border: 1px solid rgba(232, 180, 33, .45); border-radius: 999px;
  font-size: .8rem; font-weight: 600; color: var(--ink);
  box-shadow: var(--shadow);
  cursor: pointer;
}
.felt-pill:hover { border-color: rgba(232, 180, 33, .7); }
@media (max-width: 900px) { .felt-pill { top: 12px; } }
