/* ============================================================
   Hundetræning – designsystem
   Inspireret af SWDI: dyb navy, gul handlingsfarve, orange accent.
   Højdekurverne i toppen (ikoner/topo.svg) giver et strejf af terræn og spor.
   Alle farver og mål er tokens her øverst.
   ============================================================ */

:root {
  /* Brandfarver */
  --navy: #032E47;
  --navy-deep: #021C2B;
  --navy-soft: #0B4263;
  --yellow: #FEC72E;
  --yellow-press: #F0B60F;
  --orange: #E8762B;
  --orange-text: #B4520F;
  --green: #1F8A5B;
  --red: #B42318;

  /* Flader og tekst (lyst tema) */
  --bg: #F3F1EA;
  --surface: #FFFFFF;
  --surface-2: #F8F6F0;
  --text: #0E1D27;
  --muted: #5A6A73;
  --line: #E4E0D5;
  --track: #EAE6DC;
  --border: rgba(3, 46, 71, 0.06);
  --on-navy: #FFFFFF;
  --on-navy-muted: rgba(255, 255, 255, 0.74);
  --chip-bg: #FFF2C7;
  --chip-text: #6B4E00;
  --ok-bg: #E2F3EA;
  --ok-text: #12603E;
  --icon-bg: #FDF0E6;

  /* Skrift */
  --font-head: "Montserrat", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --font-body: "Segoe UI Variable Text", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Mål */
  --radius: 20px;
  --radius-sm: 12px;
  --gutter: 16px;
  --tabbar-h: 68px;
  --tabbar-gap: 12px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --shadow: 0 1px 2px rgba(3, 46, 71, 0.05), 0 8px 24px -6px rgba(3, 46, 71, 0.12);
  --shadow-lg: 0 18px 50px -12px rgba(2, 28, 43, 0.45);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #01121C;
    --surface: #062536;
    --surface-2: #082E44;
    --text: #EAF1F5;
    --muted: #9AB0BD;
    --line: #11405B;
    --track: #133F59;
    --border: rgba(255, 255, 255, 0.06);
    --orange-text: #F5A46B;
    --chip-bg: #3A2E05;
    --chip-text: #FFD970;
    --ok-bg: #0D3A28;
    --ok-text: #7FDDB0;
    --icon-bg: rgba(232, 118, 43, 0.16);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px -6px rgba(0, 0, 0, 0.4);
    color-scheme: dark;
  }
}

/* ---------- Grundlag ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

h1, h2, h3 {
  font-family: var(--font-head);
  line-height: 1.15;
  margin: 0;
  letter-spacing: -0.02em;
}
h1 { font-size: clamp(1.85rem, 6vw, 2.4rem); font-weight: 800; }
h2 { font-size: 1.15rem; font-weight: 750; }
h3 { font-size: 1rem; font-weight: 700; }
p { margin: 0; }

a { color: inherit; text-decoration: none; }

button, input, textarea { font: inherit; color: inherit; }

:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 2px;
  border-radius: 8px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.icon { width: 24px; height: 24px; flex: none; }
.icon--sm { width: 18px; height: 18px; }
.icon--lg { width: 30px; height: 30px; }

/* Indholdet glider blidt ind ved sideskift */
.page { animation: page-in 0.32s var(--ease) both; }
@keyframes page-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Ramme: menu + indhold ---------- */

.shell { min-height: 100vh; min-height: 100dvh; }

.main {
  padding-bottom: calc(var(--tabbar-h) + var(--tabbar-gap) * 2 + var(--safe-b) + 24px);
}

.wrap {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Svævende menu nederst på telefonen */
.tabbar {
  position: fixed;
  left: var(--tabbar-gap);
  right: var(--tabbar-gap);
  bottom: calc(var(--tabbar-gap) + var(--safe-b));
  z-index: 20;
  display: flex;
  border-radius: 24px;
  background: rgba(2, 28, 43, 0.92);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: var(--shadow-lg), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.tabbar__brand { display: none; }

.tabbar__links { display: flex; flex: 1; }

.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: var(--tabbar-h);
  color: var(--on-navy-muted);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.01em;
}
.tab__icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 30px;
  border-radius: 99px;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.tab[aria-current="page"] { color: var(--on-navy); }
.tab[aria-current="page"] .tab__icon { background: var(--yellow); color: var(--navy-deep); }

@media (min-width: 900px) {
  .shell {
    display: grid;
    grid-template-columns: 260px 1fr;
  }
  .main { padding-bottom: 56px; }
  .tabbar {
    position: sticky;
    top: 0;
    left: auto; right: auto; bottom: auto;
    height: 100vh;
    flex-direction: column;
    padding: 28px 14px;
    border-radius: 0;
    background:
      url("../ikoner/topo.svg") center / cover no-repeat,
      var(--navy-deep);
    backdrop-filter: none;
    box-shadow: none;
  }
  .tabbar__brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 10px 32px;
    color: var(--on-navy);
  }
  .tabbar__brand img { width: 46px; height: 46px; }
  .tabbar__brand strong { display: block; font-family: var(--font-head); font-size: 1.1rem; font-weight: 800; letter-spacing: -0.01em; }
  .tabbar__brand span { display: block; font-size: 0.8rem; color: var(--on-navy-muted); }
  .tabbar__links { flex-direction: column; flex: none; gap: 4px; }
  .tab {
    flex-direction: row;
    justify-content: flex-start;
    gap: 10px;
    height: 50px;
    padding: 0 8px;
    border-radius: 14px;
    font-size: 0.95rem;
  }
  .tab__icon { width: 40px; height: 34px; border-radius: 10px; }
  .tab:hover { background: rgba(255, 255, 255, 0.05); color: var(--on-navy); }
  .tab[aria-current="page"] { background: rgba(255, 255, 255, 0.06); }
}

/* ---------- Hero (navy top med terræn) ---------- */

.hero {
  position: relative;
  background:
    url("../ikoner/topo.svg") center / cover no-repeat,
    radial-gradient(110% 90% at 100% 0%, rgba(232, 118, 43, 0.30), transparent 55%),
    radial-gradient(90% 80% at 0% 100%, rgba(254, 199, 46, 0.10), transparent 60%),
    linear-gradient(180deg, #04354F, var(--navy) 60%, #022A40);
  color: var(--on-navy);
  padding: calc(env(safe-area-inset-top, 0px) + 28px) 0 64px;
  border-radius: 0 0 32px 32px;
  overflow: hidden;
}
.hero--tight { padding-bottom: 32px; }
.hero h1 { margin-top: 8px; text-wrap: balance; }
.hero__lead { margin-top: 10px; color: var(--on-navy-muted); max-width: 52ch; font-size: 1.02rem; }
.hero__lead--clamp {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Hero med billede: fotoet fylder toppen og toner over i navy, hvor teksten står */
.hero--photo {
  display: flex;
  flex-direction: column;
  min-height: 460px;
  padding-top: calc(env(safe-area-inset-top, 0px) + 16px);
}
.hero > .hero__photo { position: absolute; inset: 0; z-index: 0; }
.hero__photo img { object-position: center 30%; }
.hero--photo::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(180deg,
    rgba(2, 28, 43, 0.55) 0%, rgba(2, 28, 43, 0.05) 22%, rgba(2, 28, 43, 0.35) 45%,
    rgba(3, 46, 71, 0.92) 68%, var(--navy) 100%);
  pointer-events: none;
}
.hero__top, .hero__content { position: relative; z-index: 1; width: 100%; }
.hero__content { margin-top: auto; padding-top: 120px; }
.hero--photo .backlink { background: rgba(2, 28, 43, 0.55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.hero--photo h1 { text-shadow: 0 2px 16px rgba(0, 0, 0, 0.35); }
@media (min-width: 900px) {
  .hero--photo { min-height: 520px; }
}

@media (min-width: 900px) {
  .hero { border-radius: 0 0 40px 40px; margin: 0 16px; padding-top: 44px; }
}

.eyebrow {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--orange-text);
}
.hero .eyebrow { color: var(--yellow); }

.backlink {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 40px;
  margin: -6px 0 6px -10px;
  padding: 0 14px 0 6px;
  border-radius: 99px;
  color: var(--on-navy);
  font-weight: 650;
  font-size: 0.92rem;
  background: rgba(255, 255, 255, 0.08);
  transition: background 0.15s ease;
}
.backlink:hover { background: rgba(255, 255, 255, 0.14); }

.lift { margin-top: -40px; position: relative; }

/* ---------- Kort og lister ---------- */

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 0 0 1px var(--border);
  padding: 20px;
}

.section { margin-top: 28px; }
.card.section { margin-top: 14px; }
.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.section__head a { color: var(--orange-text); font-weight: 650; font-size: 0.9rem; }

.card-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.badge-icon {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  flex: none;
  border-radius: 12px;
  background: var(--icon-bg);
  color: var(--orange);
}
.badge-icon .icon { width: 20px; height: 20px; }

.stack { display: grid; gap: 12px; }

/* ---------- Billeder ---------- */

/* Et billede, der fylder sin ramme. Bagved ligger terræn og en pote, som ses indtil billedet er hentet. */
.media {
  position: relative;
  overflow: hidden;
  background:
    url("../ikoner/topo.svg") center / cover no-repeat,
    var(--navy-deep);
}
.media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.35s ease, transform 0.5s var(--ease);
}
.media.is-loaded img { opacity: 1; }
.media__placeholder {
  position: absolute;
  left: 50%; top: 50%;
  width: 34px; height: 34px;
  transform: translate(-50%, -50%);
  color: var(--yellow);
  opacity: 0.45;
}

/* ---------- Plankort med billede ---------- */

.tile-grid { display: grid; gap: 16px; }
@media (min-width: 700px) {
  .tile-grid { grid-template-columns: repeat(2, 1fr); }
}

.plan-tile {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  border-radius: 22px;
  box-shadow: var(--shadow), inset 0 0 0 1px var(--border);
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.plan-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.plan-tile:hover .media img { transform: scale(1.04); }
.plan-tile:active { transform: scale(0.99); }

/* Meget bredere end 16:9, så teksten, der er brændt ind nederst i videoerne, skæres fra */
.plan-tile__media { aspect-ratio: 5 / 2; }
.plan-tile__media img { object-position: center 15%; }
.plan-tile__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(2, 28, 43, 0.35), transparent 35%);
  pointer-events: none;
}
.plan-tile__badge {
  position: absolute;
  top: 12px; left: 12px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 99px;
  background: var(--yellow);
  color: var(--navy-deep);
  font-size: 0.78rem;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}
.plan-tile__badge.is-done { background: var(--green); color: #fff; }

.plan-tile__body { display: grid; gap: 8px; padding: 16px 18px 18px; flex: 1; align-content: start; }
.plan-tile__title { font-size: 1.3rem; font-weight: 800; }
.plan-tile__teaser {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.plan-tile__foot {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.plan-tile__progress { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 0.8rem; font-weight: 700; color: var(--muted); }
.plan-tile__progress .progress { flex: 1; }
.plan-tile__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  font-weight: 750;
  font-size: 0.92rem;
  color: var(--orange-text);
  white-space: nowrap;
}

.facts { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 0.82rem; color: var(--muted); font-weight: 600; }
.facts span { display: inline-flex; align-items: center; gap: 5px; }
.facts .icon { width: 16px; height: 16px; color: var(--orange); }
.hero .facts { color: var(--on-navy-muted); margin-top: 14px; }
.hero .facts .icon { color: var(--yellow); }

/* ---------- Fremgangsring ---------- */

.ring {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
}
.ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.ring__track { stroke: var(--track); }
.ring__bar { stroke: var(--orange); transition: stroke-dashoffset 0.6s var(--ease); }
.ring--done .ring__bar { stroke: var(--green); }
.ring__label {
  position: relative;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1;
  text-align: center;
}
.ring__label small { display: block; font-size: 0.62rem; font-weight: 700; color: var(--muted); margin-top: 2px; letter-spacing: 0.02em; }
.ring__label .icon { color: var(--orange); }
.ring--done .ring__label .icon { color: var(--green); }
.ring--lg .ring__label { font-size: 1.25rem; }

.hero .ring__track { stroke: rgba(255, 255, 255, 0.14); }
.hero .ring__bar { stroke: var(--yellow); }
.hero .ring__label { color: var(--on-navy); }
.hero .ring__label small { color: var(--on-navy-muted); }

/* ---------- Fremgangsbjælke ---------- */

.progress {
  --p: 0%;
  height: 8px;
  border-radius: 99px;
  background: var(--track);
  overflow: hidden;
}
.progress > span {
  display: block;
  width: var(--p);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--orange), #F29A4A);
  transition: width 0.5s var(--ease);
}

/* Segmenter: ét felt pr. delmål øverst på delmålssiden */
.segments { display: flex; gap: 4px; margin: 4px 0 2px; }
.segments a {
  flex: 1;
  height: 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.18);
  transition: background 0.2s ease;
}
.segments a.is-done { background: var(--yellow); }
.segments a.is-current { background: var(--on-navy); box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25); }

/* ---------- Nøgletal ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.stat {
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--shadow), inset 0 0 0 1px var(--border);
  padding: 14px 12px 12px;
  display: grid;
  gap: 2px;
}
.stat .icon { width: 20px; height: 20px; color: var(--orange); margin-bottom: 6px; }
.stat strong {
  font-family: var(--font-head);
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.stat span { font-size: 0.78rem; color: var(--muted); line-height: 1.3; }

/* ---------- Fortsæt-kortet ---------- */

.continue { display: grid; gap: 18px; }
.continue__media {
  position: relative;
  display: block;
  aspect-ratio: 5 / 2;
  margin: -20px -20px 0;
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
}
.continue__media .media { position: absolute; inset: 0; }
.continue__media .media img { object-position: center 15%; }
.continue__play {
  position: absolute;
  left: 50%; top: 50%;
  display: grid;
  place-items: center;
  width: 60px; height: 60px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--yellow);
  color: var(--navy-deep);
  box-shadow: 0 0 0 8px rgba(254, 199, 46, 0.25), 0 12px 24px -8px rgba(0, 0, 0, 0.5);
}
.continue__play .icon { margin-left: 3px; }
.continue__row { display: flex; gap: 16px; align-items: center; }
.continue__title { font-family: var(--font-head); font-weight: 800; font-size: 1.2rem; letter-spacing: -0.01em; margin-top: 2px; }
.continue__meta { color: var(--muted); font-size: 0.9rem; }

/* ---------- Knapper ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 22px;
  border: 0;
  border-radius: 14px;
  font-weight: 750;
  font-size: 1rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s ease, transform 0.15s var(--ease), box-shadow 0.15s ease;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn--block { display: flex; width: 100%; }
.btn--primary {
  background: var(--yellow);
  color: var(--navy-deep);
  box-shadow: 0 6px 18px -6px rgba(254, 199, 46, 0.7), inset 0 -2px 0 rgba(0, 0, 0, 0.08);
}
.btn--primary:hover { background: var(--yellow-press); }
.btn--navy { background: var(--navy); color: var(--on-navy); }
.btn--navy:hover { background: var(--navy-soft); }
.btn--ghost {
  background: var(--surface);
  color: var(--text);
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.btn--ghost:hover { box-shadow: inset 0 0 0 1.5px var(--muted); }
.btn--danger { background: transparent; color: var(--red); box-shadow: inset 0 0 0 1.5px currentColor; }
.btn--link {
  background: none;
  min-height: 44px;
  padding: 0 10px;
  color: var(--muted);
  font-weight: 650;
}
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn--danger { color: #FF8A80; }
  :root:not([data-theme="light"]) .btn--navy { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
}

/* ---------- Delmål som spor (planside) ---------- */

.trail {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}
.trail li { position: relative; padding-left: 56px; }
.trail li + li { margin-top: 10px; }

/* Sporet: en stiplet linje mellem markørerne, fuld streg hvor delmålet er bestået */
.trail li::before {
  content: "";
  position: absolute;
  left: 21px;
  top: 44px;
  bottom: -10px;
  width: 0;
  border-left: 2.5px dashed var(--line);
}
.trail li:last-child::before { display: none; }
.trail li.is-done::before { border-left-style: solid; border-color: var(--green); }

.trail__marker {
  position: absolute;
  left: 0;
  top: 12px;
  width: 44px; height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: inset 0 0 0 2px var(--line);
  color: var(--muted);
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 0.95rem;
  z-index: 1;
}
.is-done .trail__marker { background: var(--green); color: #fff; box-shadow: none; }
.is-next .trail__marker {
  background: var(--yellow);
  color: var(--navy-deep);
  box-shadow: 0 0 0 6px rgba(254, 199, 46, 0.25);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 5px rgba(254, 199, 46, 0.25); }
  50% { box-shadow: 0 0 0 10px rgba(254, 199, 46, 0.08); }
}

.trail__card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  padding: 12px 12px 12px 16px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow), inset 0 0 0 1px var(--border);
  transition: transform 0.15s var(--ease);
}
.trail__card:hover { transform: translateX(3px); }
.is-next .trail__card { box-shadow: var(--shadow), inset 0 0 0 2px var(--yellow); }

/* Lille billede fra delmålets video med en afspil-knap ovenpå */
.trail__card:has(.trail__thumb) { align-items: flex-start; padding: 10px 12px 10px 10px; }
.trail__thumb {
  position: relative;
  flex: none;
  width: 96px;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
}
.trail__thumb .media { position: absolute; inset: 0; }
.trail__play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(2, 28, 43, 0.25);
}
.trail__play .icon {
  width: 30px; height: 30px;
  padding: 7px 6px 7px 8px;
  border-radius: 50%;
  background: rgba(2, 28, 43, 0.75);
  color: #fff;
}
.is-done .trail__thumb .media img { filter: saturate(0.6); }
@media (min-width: 600px) {
  .trail__thumb { width: 132px; }
}
.trail__body { flex: 1; min-width: 0; }
.trail__title { font-weight: 700; }
.trail__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 3px;
}
.trail__meta span { display: inline-flex; align-items: center; gap: 4px; }
.trail__meta .is-next-label { color: var(--orange-text); font-weight: 700; }
.trail__meta .is-done-label { color: var(--ok-text); font-weight: 700; }
.trail__card > .icon { color: var(--muted); }

.plan-summary { display: flex; align-items: center; gap: 16px; margin-top: 22px; }
.plan-summary strong { display: block; font-family: var(--font-head); font-size: 1.05rem; font-weight: 750; }
.plan-summary span { color: var(--on-navy-muted); font-size: 0.9rem; }

/* ---------- Chips ---------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 750;
  background: var(--chip-bg);
  color: var(--chip-text);
}
.chip--ok { background: var(--ok-bg); color: var(--ok-text); }
.hero .chip { background: rgba(255, 255, 255, 0.12); color: var(--on-navy); }
.hero .chip--ok { background: var(--green); color: #fff; }

/* ---------- Delmålssiden ---------- */

.step-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.step-top .backlink { margin-bottom: 0; }
.step-top__count {
  font-family: var(--font-head);
  font-size: 0.85rem;
  color: var(--on-navy-muted);
  font-weight: 700;
  white-space: nowrap;
}

.video {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  margin: 16px 0 0;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 20px 40px -16px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.video video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}
.video--empty {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  text-align: center;
  padding: 16px;
  background:
    url("../ikoner/topo.svg") center / cover no-repeat,
    var(--navy-deep);
  color: var(--on-navy-muted);
  font-size: 0.95rem;
}
.video--empty .icon {
  width: 52px; height: 52px;
  padding: 12px;
  border-radius: 50%;
  background: rgba(254, 199, 46, 0.12);
  color: var(--yellow);
}

.step-head { margin-top: 20px; display: grid; gap: 10px; justify-items: start; }
.step-head h1 { margin-top: 0; }

.prose p + p { margin-top: 10px; }

.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.checks li { display: flex; gap: 12px; align-items: flex-start; }
.checks .icon {
  width: 22px; height: 22px;
  padding: 3px;
  border-radius: 50%;
  background: var(--ok-bg);
  color: var(--green);
  margin-top: 1px;
}

.note-form { display: grid; gap: 10px; }
.field {
  width: 100%;
  min-height: 50px;
  padding: 13px 14px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field::placeholder { color: var(--muted); opacity: 0.8; }
.field:focus { border-color: var(--yellow-press); outline: none; box-shadow: 0 0 0 4px rgba(254, 199, 46, 0.3); }
textarea.field { min-height: 100px; resize: vertical; }
.label { display: block; font-weight: 650; font-size: 0.9rem; margin-bottom: 6px; }

.notes { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 10px; }
.note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 12px 12px 16px;
  border-radius: 14px;
  background: var(--surface-2);
  position: relative;
}
.note::before {
  content: "";
  position: absolute;
  left: 0; top: 12px; bottom: 12px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--orange);
}
.note__body { flex: 1; min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.note__date { display: block; font-size: 0.76rem; color: var(--muted); font-weight: 700; margin-bottom: 2px; letter-spacing: 0.01em; }
.icon-btn {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  margin: -6px -6px -6px 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.icon-btn:hover { background: var(--line); color: var(--text); }

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}
.pager .btn { justify-content: space-between; padding: 0 16px; font-weight: 650; }
.pager .btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pager .btn--next { grid-column: 2; }

/* Handlingsbjælken ligger lige over den svævende menu */
.actionbar {
  position: sticky;
  bottom: calc(var(--tabbar-h) + var(--tabbar-gap) * 2 + var(--safe-b));
  z-index: 10;
  margin-top: 20px;
  padding: 8px;
  border-radius: 22px;
  background: var(--navy);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 8px;
}
.actionbar .btn { flex: 1; min-width: 0; }
.actionbar .btn--compact { flex: none; padding: 0 18px; }
.actionbar__done {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 6px;
  color: var(--on-navy);
  font-weight: 750;
}
.actionbar__done .icon {
  width: 34px; height: 34px; padding: 7px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  animation: pop 0.4s var(--ease);
}
@keyframes pop {
  0% { transform: scale(0.4); }
  70% { transform: scale(1.12); }
  100% { transform: scale(1); }
}
.actionbar .btn--link { color: var(--on-navy-muted); flex: none; }
.actionbar .btn--link:hover { color: var(--on-navy); }
@media (min-width: 900px) {
  .actionbar { bottom: 16px; }
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .actionbar { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), var(--shadow-lg); }
}

/* ---------- Plansiden: sammenfoldelige sektioner og tekstblokke ---------- */

.disclosure { padding: 0; }
.disclosure summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  cursor: pointer;
  list-style: none;
  border-radius: var(--radius);
}
.disclosure summary::-webkit-details-marker { display: none; }
.disclosure__title { flex: 1; min-width: 0; }
.disclosure__title span { display: block; font-size: 0.85rem; color: var(--muted); margin-top: 2px; }
.disclosure__chevron { color: var(--muted); transition: transform 0.2s var(--ease); }
.disclosure[open] .disclosure__chevron { transform: rotate(90deg); }
.disclosure__body { padding: 0 20px 20px; display: grid; gap: 18px; }

.info-block h3 {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--orange-text);
  margin-bottom: 8px;
}

.lead { font-size: 1.05rem; line-height: 1.6; }
.card--tip { background: linear-gradient(135deg, var(--chip-bg), var(--surface) 70%); }

.trail__excerpt {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.progress--mini { height: 5px; margin-top: 8px; }

/* ---------- Kriterieplan ---------- */

.crit-head { display: grid; gap: 6px; margin-bottom: 14px; }
.crit-head__row { display: flex; justify-content: space-between; font-size: 0.88rem; color: var(--muted); }
.crit-head__row strong { color: var(--text); font-family: var(--font-head); }

.rule {
  margin-bottom: 14px;
  border-radius: 14px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
}
.rule summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 650;
  font-size: 0.92rem;
  color: var(--orange-text);
  list-style: none;
}
.rule summary::-webkit-details-marker { display: none; }
.rule .prose { padding: 0 14px 14px; font-size: 0.92rem; }

.crit-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.crit {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 8px 10px 4px;
  border-radius: 14px;
  transition: background 0.15s ease;
}
.crit.is-current { background: var(--chip-bg); padding-left: 8px; }
.crit.is-done .crit__body p { color: var(--muted); }
.crit__check {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  margin-top: -2px;
  border: 0;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: inset 0 0 0 2px var(--line);
  color: var(--muted);
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s var(--ease);
}
.crit__check:hover { box-shadow: inset 0 0 0 2px var(--green); color: var(--green); }
.crit__check:active { transform: scale(0.92); }
.is-current .crit__check { box-shadow: inset 0 0 0 2px var(--yellow-press); color: var(--text); }
.is-done .crit__check { background: var(--green); color: #fff; box-shadow: none; animation: pop 0.35s var(--ease); }
.crit__body { flex: 1; min-width: 0; padding-top: 7px; font-size: 0.95rem; line-height: 1.5; }
.crit__now {
  display: inline-block;
  margin-bottom: 4px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--orange-text);
}
.crit__date { display: block; margin-top: 4px; font-size: 0.78rem; font-weight: 650; color: var(--ok-text); }

/* ---------- Video: forside før afspilning, faner og link ---------- */

.video iframe { display: block; width: 100%; height: 100%; border: 0; }

.video--poster {
  background:
    url("../ikoner/topo.svg") center / cover no-repeat,
    radial-gradient(70% 90% at 50% 50%, rgba(232, 118, 43, 0.25), transparent 70%),
    var(--navy-deep);
}
/* Videoens eget billede bag afspilknappen, dæmpet så knap og tekst kan læses */
.video--poster .media { position: absolute; inset: 0; }
.video--poster .media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(2, 28, 43, 0.35), rgba(2, 28, 43, 0.75));
}
.video__play { z-index: 1; }
.video__play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  width: 100%;
  border: 0;
  background: none;
  color: var(--on-navy);
  cursor: pointer;
}
.video__play-icon {
  display: grid;
  place-items: center;
  width: 68px; height: 68px;
  margin-bottom: 6px;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--navy-deep);
  box-shadow: 0 0 0 10px rgba(254, 199, 46, 0.18), 0 16px 30px -10px rgba(0, 0, 0, 0.6);
  transition: transform 0.2s var(--ease);
}
.video__play-icon .icon { width: 30px; height: 30px; margin-left: 4px; }
.video__play:hover .video__play-icon { transform: scale(1.06); }
.video__play-text { font-family: var(--font-head); font-weight: 800; font-size: 1.05rem; }
.video__play-sub { font-size: 0.8rem; color: var(--on-navy-muted); }

.video__ext {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  margin-top: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--on-navy-muted);
}
.video__ext:hover { color: var(--on-navy); }

.video-tabs { display: flex; gap: 8px; margin-top: 14px; overflow-x: auto; }
.video-tabs button {
  flex: none;
  min-height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--on-navy);
  font-weight: 650;
  font-size: 0.88rem;
  cursor: pointer;
}
.video-tabs button[aria-selected="true"] { background: var(--yellow); color: var(--navy-deep); }
.video-tabs + div .video { margin-top: 10px; }

/* ---------- Søgning ---------- */

.search {
  position: relative;
  margin-top: 20px;
}
.search .icon {
  position: absolute;
  left: 16px; top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.search input {
  width: 100%;
  min-height: 52px;
  padding: 0 16px 0 48px;
  border: 0;
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}
.search input:focus { outline: none; box-shadow: 0 0 0 4px rgba(254, 199, 46, 0.5); }

/* ---------- Tom tilstand ---------- */

.empty {
  text-align: center;
  padding: 18px 8px 6px;
  color: var(--muted);
  display: grid;
  gap: 10px;
  justify-items: center;
}
.empty > .icon {
  width: 60px; height: 60px;
  padding: 15px;
  border-radius: 20px;
  background: var(--icon-bg);
  color: var(--orange);
}
.empty strong { color: var(--text); font-family: var(--font-head); font-size: 1.15rem; font-weight: 800; }
.empty .btn { margin-top: 6px; }

/* ---------- Profil ---------- */

.avatar {
  width: 68px; height: 68px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--yellow), #FFB020);
  color: var(--navy-deep);
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.45rem;
  flex: none;
  box-shadow: 0 10px 24px -8px rgba(254, 199, 46, 0.6);
}
.profile-head { display: flex; align-items: center; gap: 16px; }
.profile-head h1 { font-size: 1.6rem; margin: 0; }
.profile-head p { color: var(--on-navy-muted); margin-top: 4px; }

.inline-form { display: flex; gap: 10px; }
.inline-form .field { flex: 1; min-width: 0; }
.inline-form .btn { flex: none; }

.info-row { display: flex; gap: 12px; align-items: flex-start; color: var(--muted); font-size: 0.92rem; }

.form-hint { display: flex; gap: 6px; align-items: flex-start; margin-top: 6px; color: var(--muted); font-size: 0.85rem; }
.form-hint .icon { margin-top: 1px; color: var(--orange); }
.notes__who { margin: -4px 0 12px; }
.form-grid { display: grid; gap: 14px; }
select.field { appearance: auto; }
select.field:disabled, .btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* ---------- Brugere (fagkoordinator og admin) ---------- */

.user-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.user-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow), inset 0 0 0 1px var(--border);
  color: var(--text);
}
.user-row:hover { box-shadow: var(--shadow), inset 0 0 0 1.5px var(--line); }
.user-row > .icon { color: var(--muted); }
.user-row.is-inactive { opacity: 0.6; }
.user-row__body { flex: 1; min-width: 0; }
.user-row__title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.user-row__title strong { font-family: var(--font-head); font-weight: 750; }
.user-row__title .chip { padding: 2px 9px; font-size: 0.72rem; }
.avatar.avatar--sm { width: 46px; height: 46px; border-radius: 15px; font-size: 1rem; box-shadow: none; }
.chip--off { background: var(--track); color: var(--muted); }

.user-steps { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 14px; }
.user-steps__head { display: flex; align-items: center; gap: 10px; }
.user-steps__head strong { flex: 1; min-width: 0; font-weight: 700; }
.user-steps__dot {
  width: 30px; height: 30px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px var(--line);
  color: var(--muted);
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 0.85rem;
}
.user-steps .is-done .user-steps__dot { background: var(--green); box-shadow: none; color: #fff; }
.user-steps .notes { margin: 8px 0 0 40px; }

/* ---------- Login ---------- */

.login {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 32px var(--gutter);
  background:
    url("../ikoner/topo.svg") center / cover no-repeat,
    radial-gradient(80% 60% at 100% 0%, rgba(232, 118, 43, 0.32), transparent 60%),
    radial-gradient(70% 50% at 0% 100%, rgba(254, 199, 46, 0.12), transparent 60%),
    var(--navy);
  color: var(--on-navy);
}
.login__inner { width: 100%; max-width: 400px; display: grid; gap: 28px; animation: page-in 0.5s var(--ease) both; }
.login__brand { text-align: center; display: grid; gap: 10px; justify-items: center; }
.login__brand img {
  width: 96px; height: 96px;
  border-radius: 28px;
  box-shadow: 0 20px 50px -12px rgba(0, 0, 0, 0.6), 0 0 0 8px rgba(255, 255, 255, 0.05);
}
.login__brand h1 { font-size: 2.1rem; margin-top: 8px; }
.login__brand p { color: var(--on-navy-muted); }
.login .card { color: var(--text); display: grid; gap: 16px; padding: 24px; border-radius: 24px; }
.login__error {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: #FDECEA;
  color: var(--red);
  font-weight: 650;
  font-size: 0.92rem;
}
.login__note {
  text-align: center;
  font-size: 0.85rem;
  color: var(--on-navy-muted);
}
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  background: rgba(254, 199, 46, 0.16);
  color: var(--yellow);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  top: calc(env(safe-area-inset-top, 0px) + 14px);
  z-index: 50;
  transform: translate(-50%, -16px);
  opacity: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 32px);
  padding: 12px 18px 12px 14px;
  border-radius: 99px;
  background: var(--navy-deep);
  color: var(--on-navy);
  font-weight: 650;
  box-shadow: var(--shadow-lg), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
  pointer-events: none;
}
.toast .icon { width: 26px; height: 26px; padding: 5px; border-radius: 50%; background: var(--yellow); color: var(--navy-deep); }
.toast--show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 900px) {
  .toast { left: calc(50% + 130px); }
}

/* ---------- Indlæsning ---------- */

.loading {
  display: grid;
  place-items: center;
  min-height: 50vh;
  color: var(--muted);
}
.spinner {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 3px solid var(--track);
  border-top-color: var(--orange);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
