/* =========================================================
   PROGRESS SUITE (Stripe-aktig)
   HTML-forventning: se progress-seksjonen jeg ga i forrige svar
   ========================================================= */

:root{
  --pr-card-bg: color-mix(in oklab, var(--surface) 96%, transparent);
  --pr-track: color-mix(in oklab, var(--surface) 78%, transparent);
  --pr-track-inner: color-mix(in oklab, var(--bg) 68%, transparent);
  --pr-line: var(--line);
  --pr-blue: var(--blue-2);
  --pr-blue-quiet: color-mix(in oklab, var(--blue-2) 18%, transparent);
  --pr-muted: var(--muted);
}

[data-theme="dark"]{
  --pr-card-bg: color-mix(in oklab, var(--surface) 86%, transparent);
  --pr-track: color-mix(in oklab, var(--surface) 52%, transparent);
  --pr-track-inner: color-mix(in oklab, var(--bg) 52%, transparent);
  --pr-blue: var(--blue-1);
  --pr-blue-quiet: color-mix(in oklab, var(--blue-1) 20%, transparent);
}

/* ===== wrapper ===== */
.progress-suite{
  display: grid;
  gap: 24px;
}

.progress-suite > .section-title{ margin: 0; }
.progress-suite > .section-sub{ margin: 0 0 8px; color: var(--pr-muted); }



/* ===== HUD ===== */
.progress-hud{
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px;
  padding: 32px 32px;
  border: 1px solid var(--pr-line);
  border-radius: 14px;
  background: var(--pr-card-bg);
}

.ring{
  position: relative;
  width: 112px; height: 112px;
}

.ring-svg{ width: 112px; height: 112px; display: block; }

/* bakgrunnssti */
.ring-bg{
  fill: none;
  stroke: var(--pr-track);
  stroke-width: 12;
}

/* fremdriftssti – JS setter stroke-dashoffset */
.ring-fg{
  fill: none;
  stroke: var(--pr-blue);
  stroke-linecap: round;
  stroke-width: 12;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  stroke-dasharray: 1 300; /* settes korrekt av JS ved init */
}

/* midtstilt prosent */
.ring-center{
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.ring-percent{
  font: 800 22px/1 "Space Grotesk", Inter, system-ui, sans-serif;
  color: var(--pr-blue);
}

/* HUD-tekst */
.hud-info{ display: grid; align-content: center; gap: 6px; }
.hud-title{
  font: 700 24px/1.25 "Space Grotesk", Inter, system-ui, sans-serif;
}
.hud-time{ font-weight: 700; font-size: 28px; margin-top: 8px; display: flex; flex-direction: column; gap: 8px;}
.hud-since{ color: var(--pr-muted); font-weight: 600; opacity: 0.5; }

/* ===== Leg-kort ===== */
.leg-card{
  display: grid;
  gap: 12px;
  padding: 64px 64px;
  border: 1px solid var(--pr-line);
  border-radius: 14px;
  background: var(--pr-card-bg);
}

@media (max-width: 720px){
  .leg-card{
    padding: 32px 32px;
  }
  .hud-info {
    display: flex;
    flex-direction: column;
    text-align: center;  
  }
}


.leg-head{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 32px;

}
.leg-head h4{
  margin: 0;
  font: 700 20px/1.2 "Space Grotesk", Inter, system-ui, sans-serif;
font-size: 24px;
}
.leg-head .small{
  color: var(--pr-muted);
  opacity: 0.5;
  font: 600 16px/1.2 Inter, system-ui, sans-serif;
}
.leg-head .small .km{
  color: var(--pr-muted);
  opacity: .9;
  margin-left: 6px;
}

/* ===== Track (uten glow) ===== */
.leg-track{
  position: relative;
  height: 14px;
  width: 100%;
  border-radius: 999px;
  background: var(--pr-track);
  border: 1px solid var(--pr-line);
  overflow: visible;
}

/* subtil indre base for dybde – ingen glow */
.leg-track::before{
  content: "";
  position: absolute; inset: 2px;
  border-radius: inherit;
  background: var(--pr-track-inner);
}

/* blå fyll – settes i JS med width:% */
.leg-track .fill{
  position: absolute; inset: 0 auto 0 0;
  width: 0%;
  border-radius: 999px;
  background: var(--pr-blue);
  z-index: 1;
}

/* ===== Milestones (porter) ===== */
.milestone{
  position: absolute; top: 50%; transform: translate(-50%, -50%);
  width: 48px; height: 48px;
  border-radius: 999px;
  background: var(--bg);
  border: 2px solid var(--pr-line);
  display: grid; place-items: center;
  z-index: 2;
}
.milestone .flag{
  width: 32px; height: 32px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

@media (max-width: 720px){
.milestone .flag{
  width: 24px; height: 24px;
  }
  }

@media (max-width: 720px){
.milestone {
  width: 32px; height: 32px;
  }
  }

/* state: fullført / nåværende */
.milestone.done{ border-color: var(--pr-blue); }
.milestone.now{ outline: 3px solid var(--pr-blue-quiet); }

/* ===== Tooltips (Stripe-ish) ===== */
.milestone .tip{
  position: absolute;
  bottom: 34px; left: 50%;
  transform: translateX(-50%) translateY(8px);
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--pr-line);
  background: var(--bg);
  color: var(--text);
  font: 600 12px/1.2 Inter, system-ui, sans-serif;
  white-space: nowrap;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity .16s ease, transform .16s ease;
}
.milestone:hover .tip{
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== Leg 1 – mobil: del i to etapper ===== */
.leg1-mobile{
  display: none; /* kun mobil */
  gap: 32px;
}
.stage{ display: grid; gap: 6px; }
.stage-track{
  position: relative;
  height: 12px; border-radius: 999px;
  background: var(--pr-track);
  border: 1px solid var(--pr-line);
}
.stage-track .fill{
  position: absolute; inset: 0 auto 0 0; width: 0%;
  border-radius: 999px; background: var(--pr-blue);
}
.stage-stats{
  font: 600 13px/1.2 Inter, system-ui, sans-serif;
}
.stage-stats .km{ color: var(--pr-muted); margin-left: 6px; }

/* ===== Responsivitet ===== */
@media (max-width: 720px){
  .progress-hud{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 32px 16px;
  }

  .leg-head{
    align-items: start;
    flex-direction: column;
    gap: 6px;
  }

  /* Bytt til etappe-visning på mobil for Leg 1 */
  #leg1Track{ display: none; }
  .leg1-mobile{ display: grid; }
}

/* litt ekstra luft mellom leg-kortene */
.progress-suite .leg-card + .leg-card{ margin-top: 4px; }

/* sikkerhetsfallback om color-mix ikke støttes */
@supports not (background: color-mix(in oklab, white 10%, black)){
  .leg-track{ background: rgba(0,0,0,.08); }
  [data-theme="dark"] .leg-track{ background: rgba(255,255,255,.12); }
  .ring-bg{ stroke: rgba(0,0,0,.15); }
  [data-theme="dark"] .ring-bg{ stroke: rgba(255,255,255,.15); }
}
/* Ring background stroke colors (exact) */
.progress-hud .ring-bg {
  stroke: #e5e5e5;         /* light mode */
}

[data-theme="dark"] .progress-hud .ring-bg {
  stroke: #283041;         /* dark mode */
}

/* Constrain overall progress section width like the rest of the site */
#progress {
  max-width: var(--max);   /* your --max is 1440px */
  margin-inline: auto;
  padding-inline: var(--pad-2);
}

/* Tighter card width (both HUD + tracks) */
#progress.progress-suite {
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--pad-2);
}

/* === FIX: Progress card skal ikke styles som et vanlig .card === */
#progress.card.progress-suite {
  background: none;
  border: none;
  box-shadow: none;
}
#leg1StageA {
    max-width: 50%;
}
.km-muted {
    opacity: 0.5;
}


@media (max-width: 720px){
  #hudCountdown{
    display: flex;
    font-size: 24px;
    justify-content: center;
    margin-top: 4px;
    gap: 4px !important;
    margin-left: -16px;
  }
  .hud-time {
      display: grid;
  }
  #hudNext {
      font-size: 24px;
  }
}

#hudCountdown {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
    color: #df6969;
    margin-left: -20px;
}

.hud-time .label {
  font-size: 18px;
}

/* Bruk tabulære sifre OG gi hvert tall en fast ch-bredde */
.countdown-num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "lnum" 1; /* sikre monospaced sifre */
  display: inline-block;
  text-align: right;
  min-width: 2ch; /* alltid 2 tegn for hh, mm, ss */
}
