.kp-forecast-cards,
.realtime-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
  width: 100%;
  margin-bottom: 0.5em;
  padding: 0.2em 0.1em;
  box-sizing: border-box;
  align-items: start;
}
@media (max-width: 1000px) {
  .kp-forecast-cards,
  .realtime-cards { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 650px) {
  .kp-forecast-cards,
  .realtime-cards { grid-template-columns: 1fr; gap: 0.7rem; }
}

.kp-forecast-card,
.realtime-card {
  position: relative;
  background: #101820;
  border: 1.2px solid rgba(120,130,140,0.18);
  border-radius: 13px;
  box-shadow: 0 2px 12px #0002;
  padding: 1.1em 1.2em 1.05em 1.2em;
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 100%;
  transition: box-shadow 0.18s, border-color 0.18s;
  overflow: hidden;
  cursor: pointer;
  user-select: none;
  outline: none;
}

.kp-forecast-card::before,
.realtime-card::before {
  content: '';
  display: block;
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 7px;
  border-radius: 7px 0 0 7px;
  background-color: var(--stripe-color, #b0b0b0);
  transition: background-color 0.3s;
}
.kp-forecast-card.no-stripe::before { display: none !important; }

.kp-forecast-card:hover,
.realtime-card:hover {
  box-shadow: 0 4px 24px #0004;
  border-color: rgba(120,130,140,0.28);
}

.kp-forecast-card.kp-card-open,
.realtime-card.realtime-card-open {
  box-shadow: 0 6px 28px #0006;
}

.kp-card-toprow,
.realtime-card-toprow {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 0.18em;
  gap: 0.5em;
}

.kp-card-time,
.realtime-card-title {
  font-size: 1.35rem;
  color: #e6e6e6;
  font-weight: 600;
  flex: 1 1 auto;
  text-align: left;
  white-space: nowrap;
}

.kp-card-value,
.realtime-card-value {
  color: #e6e6e6;
  font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-align: right;
  margin-left: 0.7em;
  flex: 0 0 auto;
  line-height: 1.1;
}

.kp-card-desc,
.realtime-card-info {
  font-size: 1.01rem;
  color: #e6e6e6;
  font-style: italic;
  font-weight: 400;
  text-align: left;
  margin-top: 0.13em;
  width: 100%;
  white-space: normal;
  opacity: 1;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 0.35em;
}
.realtime-card-info {
  margin-top: 0.7em;
  transition: max-height 0.2s, opacity 0.2s;
}

.kp-card-details {
  margin-top: 0.7em;
  transition: max-height 0.2s, opacity 0.2s, padding 0.2s, margin 0.2s;
  opacity: 1;
  max-height: 500px;
  overflow: hidden;
  display: block;
  padding: 0.5em 0 0.2em 0;
  color: #e6e6e6 !important;
  background: none !important;
}
.kp-forecast-card .kp-card-details[style*='display: none'],
.kp-forecast-card:not(.kp-card-open) .kp-card-details {
  opacity: 0;
  max-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  display: none !important;
}

.kp-forecast-card.no-stripe .kp-card-value { color: #e6e6e6 !important; }

.kp-card-graph-container {
  width: 100%;
  height: 180px;
  min-height: 120px;
  max-height: 220px;
  margin: 0.5em 0 0.2em 0;
  padding: 0;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
}

.kp-card-graph-canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
  background: none;
}

.kp-forecast-card:not(.kp-card-open) .kp-card-graph-container,
.realtime-card:not(.realtime-card-open) .kp-card-graph-container {
  display: none !important;
}

.arrival-card-info {
  width: 100%;
  margin: 0.5em 0 0.2em 0;
  padding: 0;
  color: #e6e6e6;
  font-size: 0.98rem;
  line-height: 1.45;
}
.kp-forecast-card:not(.kp-card-open) .arrival-card-info,
.realtime-card:not(.realtime-card-open) .arrival-card-info {
  display: none !important;
}

.kp-forecast-card:focus-visible,
.realtime-card:focus-visible {
  box-shadow: 0 0 0 2px rgba(76,175,80,.5);
}

.kp-color-indicator {
  display: inline-block;
  width: 18px; height: 18px;
  border-radius: 50%;
  margin-right: 0.7em;
  vertical-align: middle;
  border: 2px solid #222;
  box-sizing: border-box;
}
.kp-color-indicator.kp-yellow { background: #ffe066; }
.kp-color-indicator.kp-gray { background: #b0b0b0; }
.kp-color-indicator.kp-green { background: #4CAF50; }
.kp-color-indicator.kp-orange { background: #ff9800; }
.kp-color-indicator.kp-red { background: #e53935; }
.kp-color-indicator.kp-lightgreen { background: #81c784; }
.kp-color-indicator.kp-darkred { background: #b71c1c; }
.kp-color-indicator.kp-burgundy { background: #6e0032; }

.nsgla-card {
  --sp-1: 6px;
  --sp-2: 10px;
  --sp-3: 12px;
  --sp-4: 16px;
  --tile-bg: rgba(16,18,16,.70);
  --tile-border: rgba(255,255,255,.06);
  --tile-r: 16px;
  --gap: var(--sp-3);
  --green: #4CAF50;
}

.nsgla-card .kp-forecast-graph-container {
  background: transparent !important;
  border-radius: var(--tile-r);
  padding: 0;
  box-shadow: none;
  border: none;
}

.nsgla-card .kp-forecast-cards,
.nsgla-card .realtime-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
  width: 100%;
  margin: 0 0 var(--sp-2) 0;
  padding: 0;
  align-items: stretch;
}
@media (max-width: 1000px) {
  .nsgla-card .kp-forecast-cards,
  .nsgla-card .realtime-cards { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 650px) {
  .nsgla-card .kp-forecast-cards,
  .nsgla-card .realtime-cards { grid-template-columns: 1fr; gap: .9rem; }
}

.nsgla-card .kp-forecast-card,
.nsgla-card .realtime-card {
  background: rgba(16, 24, 32, 0.72) !important;
  border: 1px solid rgba(52, 73, 94, .22) !important; /* 34495E @ 22% gir roligere kant */
  border-radius: var(--tile-r);
  padding: var(--gap);

  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);

  box-shadow:
    0 6px 14px rgba(0, 0, 0, .22), /* Softere dybde */
    0 1px 0 rgba(255,255,255,.04) inset; /* SÅ VIDT merkbar lyskant */

  transition:
    transform .18s ease,
    box-shadow .18s ease,
    border-color .18s ease;
}


.nsgla-card .kp-forecast-card::before,
.nsgla-card .realtime-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  border-radius: var(--tile-r) 0 0 var(--tile-r);
  background-color: var(--stripe-color, #b0b0b0);
  opacity: .95;
  transition: background-color .2s, opacity .2s;
}

.nsgla-card .kp-forecast-card:hover,
.nsgla-card .realtime-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(0,0,0,.28);
}

.nsgla-card .kp-forecast-card.kp-card-open,
.nsgla-card .realtime-card.realtime-card-open {
  box-shadow: 0 14px 28px rgba(0,0,0,.32);
}

.nsgla-card .kp-card-time,
.nsgla-card .realtime-card-title {
  font-size: 1.15rem;
  color: rgba(255,255,255,.92);
  font-weight: 600;
}

.nsgla-card .kp-card-value,
.nsgla-card .realtime-card-value {
  font-size: 1.15rem;
  font-weight: 700;
  color: #e6e6e6;
  line-height: 1.1;
}

.nsgla-card .kp-card-desc,
.nsgla-card .realtime-card-info {
  font-size: 1.01rem;
  color: rgba(255,255,255,.90);
}

.nsgla-card .kp-card-details {
  margin-top: var(--sp-2);
  padding: .5em 0 .2em 0;
  color: rgba(255,255,255,.92) !important;
  background: none !important;
}

.nsgla-card .kp-card-graph-container {
  width: 100%;
  height: 180px;
  margin: var(--sp-2) 0 var(--sp-1) 0;
  border-radius: 10px;
  overflow: hidden;
}

.nsgla-card .kp-forecast-card.no-stripe::before { display: none; }
/* Maks 2 per rad for forecast-kort */
.kp-forecast-cards {
  grid-template-columns: repeat(2, 1fr);
}

/* Respons: 1 per rad på små skjermer som før */
@media (max-width: 650px) {
  .kp-forecast-cards { grid-template-columns: 1fr; }
}

/* Hvis du bruker nsgla-card-varianten rundt forecast-kortene */
.nsgla-card .kp-forecast-cards {
  grid-template-columns: repeat(2, 1fr);
}
@media (max-width: 650px) {
  .nsgla-card .kp-forecast-cards { grid-template-columns: 1fr; }
}
/* Kp Forecast Graph container */
.kp-graph {
  position: relative;
  width: 100%;
  min-height: 220px;
  max-height: 340px;
  background: var(--bg-content, rgba(30,30,30,0.92));
  border: 1.2px solid rgba(120,130,140,0.18);
  border-radius: 13px;
  box-shadow: 0 2px 12px #0002;
  padding: 0.8em 1em 1em 1em;
  margin-bottom: 1.1em;
  box-sizing: border-box;
  overflow: hidden;
}

.kp-graph canvas.kp-forecast-graph-canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
  background: transparent;
}

/* nsgla-card variant */
.nsgla-card .kp-graph {
  background: var(--tile-bg, rgba(16,18,16,0.70));
  border: 1px solid var(--tile-border, rgba(255,255,255,0.06));
  border-radius: var(--tile-r, 16px);
  box-shadow: 0 8px 18px rgba(0,0,0,.24);
  padding: var(--sp-3, 12px);
  min-height: 200px;
}

.nsgla-card .kp-graph canvas.kp-forecast-graph-canvas {
  border-radius: var(--tile-r, 16px);
  background: none;
}

/* Labeler over graf (for [kp_day1_label] etc.) */
.kp-forecast-day-label {
  display: inline-block;
  font-size: 1.1rem;
  font-weight: 600;
  color: #e6e6e6;
  margin: 0.3em 0 0.6em 0;
  padding: 0.2em 0.6em;
  background: rgba(255,255,255,0.08);
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* Respons */
@media (max-width: 700px) {
  .kp-graph { min-height: 180px; }
  .nsgla-card .kp-graph { min-height: 160px; }
  .kp-forecast-day-label { font-size: 1rem; padding: 0.2em 0.5em; }
}

.nlsvk-graph {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 1; /* 2:1 bredde:høyde */
}

.nlsvk-graph-canvas {
  width: 100% !important;
  height: 100% !important;
}
/* Ramme og bakgrunn */
.nlsvk-graph,
.kp-card-graph-container {
  position: relative;
  border: 1px solid rgba(230,230,230,0.35);
  border-radius: 6px;
  background: rgba(255,255,255,0.03);
}

/* Fullskjerm-knapp oppe til høyre */
.nl-fullscreen-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  line-height: 26px;
  text-align: center;
  font-size: 16px;
  color: #e6e6e6;
  background: rgba(20,20,20,0.6);
  border: 1px solid rgba(230,230,230,0.35);
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
}
.nl-fullscreen-btn:hover { background: rgba(20,20,20,0.8); }

/* Når elementet er i fullscreen, strekk canvas pent */
:fullscreen .nlsvk-graph-canvas,
:fullscreen .kp-card-graph-container canvas {
  width: 100% !important;
  height: 100% !important;
}
/* Kun for kortkode-grafene */
.nlsvk-graph {
  position: relative;
}

/* Fullskjerm-knapp */
.nl-fullscreen-btn{
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 6px;
  background: rgba(0,0,0,0.35);
  color: #e6e6e6;
  line-height: 1;
  cursor: pointer;
}
.nl-fullscreen-btn:hover{ background: rgba(255,255,255,0.08); }
.nl-fullscreen-btn:focus{ outline: 2px solid #FFD600; outline-offset: 2px; }
/* Kun for kortkode-grafer */
.nlsvk-graph { position: relative; }

.nlsvk-graph .nl-fullscreen-btn{
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 6px;
  background: rgba(0,0,0,0.35);
  color: #e6e6e6;
  line-height: 1;
  cursor: pointer;
}
.nlsvk-graph .nl-fullscreen-btn:hover{ background: rgba(255,255,255,0.08); }
.nlsvk-graph .nl-fullscreen-btn:focus{ outline: 2px solid #FFD600; outline-offset: 2px; }
/* Felles beholder for graf-canvas */
.nlsvk-graph,
.kp-card-graph-container {
  position: relative;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  overflow: hidden;
}

/* Fullskjerm-knapp kun i kortkode-grafen */
.nlsvk-graph .nl-fullscreen-btn{
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 6px;
  background: rgba(0,0,0,0.35);
  color: #e6e6e6;
  line-height: 1;
  cursor: pointer;
}
.nlsvk-graph .nl-fullscreen-btn:hover{ background: rgba(255,255,255,0.08); }
