:root {
  color-scheme: light;

  /* Primitiv fargeskala — dypere/varmere grønntoner på en varm kremhvit bunn
     i stedet for den forrige blekgrønne/hvite paletten. */
  --color-forest-950: #0a1a11;
  --color-forest-800: #12301f;
  --color-forest-700: #1a4327;
  --color-forest-600: #2c6b3d;
  --color-forest-500: #3d7d4c;
  --color-cream-50: #faf8f2;
  --color-cream-100: #f1ecdf;
  --color-ink-900: #16201a;

  /* Semantiske aliaser — det resten av CSS-en faktisk bruker. */
  --surface-1: #ffffff;
  --page-plane: var(--color-cream-50);
  --text-primary: var(--color-ink-900);
  --text-secondary: #4c6355;
  --text-muted: #7d9286;
  --gridline: #e3ddcb;
  --border: rgba(20, 40, 25, 0.12);
  --card-shadow: 0 1px 2px rgba(13, 26, 17, 0.06), 0 10px 28px rgba(13, 26, 17, 0.07);

  --brand-primary: var(--color-forest-700);
  --brand-deep: var(--color-forest-950);
  --accent: var(--color-forest-500);
  --accent-deep: var(--color-forest-600);
  --accent-ink: #ffffff;

  --series-avdrag: #2a78d6;   /* blue   — categorical slot 1 */
  --series-rente: #eb6834;    /* orange — categorical slot 2 */
  --series-gebyr: #1baf7a;    /* aqua   — categorical slot 3 */

  --status-warning-bg: #fdf1de;
  --status-warning-border: #c98126;
  --status-critical: #b5433a;

  /* Avstandsskala */
  --space-3xs: 0.25rem;
  --space-2xs: 0.5rem;
  --space-xs: 0.75rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4.5rem;
  --space-3xl: 6.5rem;

  /* Rundingsskala */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  --radius-full: 50%;

  /* Skrifttyper — serif kun til hero-overskrift og footer-ordmerke, sans til alt annet. */
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Fraunces", Georgia, "Times New Roman", serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --surface-1: #14201a;
    --page-plane: #0d1712;
    --text-primary: #eef5f0;
    --text-secondary: #b9cabe;
    --text-muted: #7d9286;
    --gridline: #29392f;
    --border: rgba(238, 245, 240, 0.10);
    --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 28px rgba(0, 0, 0, 0.35);

    --brand-primary: #4fa367;
    --brand-deep: #060f0a;
    --accent: #4fa367;
    --accent-deep: #6fc084;

    --series-avdrag: #3987e5;
    --series-rente: #d95926;
    --series-gebyr: #199e70;

    --status-warning-bg: #332911;
    --status-warning-border: #d99a3f;
    --status-critical: #e08277;
  }
}

* {
  box-sizing: border-box;
}

/* Garanterer at [hidden] alltid faktisk skjuler elementet, uansett hvilken
   klasse det har. Uten denne kan en klasses egen "display"-regel (f.eks.
   display: flex/inline-block) stille overstyre hidden-attributtet, siden de
   har lik CSS-spesifisitet og klasseregler kommer etter nettleserens egen
   [hidden]-regel i kaskaden. */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--page-plane);
  color: var(--text-primary);
  line-height: 1.5;
}

/* ---------- Hero: typografidrevet, ingen bakgrunnsbilde ---------- */

.hero {
  position: relative;
  overflow: hidden;
  min-height: 380px;
  display: flex;
  flex-direction: column;
  background: var(--brand-deep);
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

/* Rolig, statisk gradient + et svært diskret prikkmønster i stedet for et
   fotografi — selve serif-overskriften er hero'ens visuelle midtpunkt, ikke
   bakgrunnen (se .hero-content h1 lenger ned). */
.hero-bg-surface {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 140% at 15% -10%, rgba(255, 255, 255, 0.06), transparent 55%),
    radial-gradient(circle, rgba(255, 255, 255, 0.05) 1px, transparent 1.5px) 0 0 / 26px 26px,
    linear-gradient(160deg, var(--brand-deep) 0%, var(--color-forest-800) 55%, var(--color-forest-700) 100%);
}

.hero-fade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 70px;
  background: linear-gradient(to bottom, transparent, var(--page-plane));
  z-index: 1;
}

.navbar {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  max-width: 1040px;
  width: 100%;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #ffffff;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.4rem;
  letter-spacing: 0;
  text-decoration: none;
  text-shadow: 0 1px 3px rgba(10, 26, 17, 0.5), 0 1px 10px rgba(10, 26, 17, 0.35);
}

.brand:hover {
  opacity: 0.85;
}

.brand-mark {
  display: flex;
  align-items: center;
  color: #ffffff;
}

.nav-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn-ghost {
  border-radius: 999px;
  color: #ffffff;
}

.btn-ghost:hover {
  filter: brightness(1.2);
}

.btn-ghost-dark {
  background: transparent;
  border: 1.5px solid var(--brand-primary);
  color: var(--brand-primary);
}

.btn-ghost-dark:hover {
  background: color-mix(in srgb, var(--brand-primary) 8%, var(--surface-1));
}

.nav-menu {
  position: relative;
}

.nav-menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-menu-chevron {
  transition: transform 0.15s ease;
}

.nav-menu-btn[aria-expanded="true"] .nav-menu-chevron {
  transform: rotate(180deg);
}

.nav-menu-panel {
  position: fixed;
  min-width: 220px;
  max-height: min(70vh, 420px);
  overflow-y: auto;
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(10, 26, 17, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.18);
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  z-index: 200;
}

.nav-menu-panel a {
  padding: 0.6rem 0.75rem;
  border-radius: 6px;
  color: #ffffff;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
}

.nav-menu-panel a:hover {
  background: rgba(255, 255, 255, 0.12);
}

.nav-menu-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.18);
  margin: 0.35rem 0.3rem;
}

/* .liquid-glass--on-dark setter position:relative (for ::before-kanten), som
   ellers ville slått ut .nav-menu-panels position:fixed pga. senere
   kildeposisjon i filen og lik selector-spesifisitet. Egen kombinert selector
   her har høyere spesifisitet og vinner uansett rekkefølge. */
.nav-menu-panel.liquid-glass--on-dark {
  position: fixed;
}

.hero-content {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.5rem 1.25rem 3rem;
  color: var(--brand-primary);
}

.eyebrow {
  display: block;
  margin-bottom: 0.6rem;
  font-family: var(--font-sans);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.68);
}

.hero-content h1 {
  margin: 0 0 0.5rem;
  font-family: var(--font-serif);
  font-weight: 360;
  font-size: clamp(2.75rem, 6vw + 1rem, 5.25rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: #ffffff;
  text-shadow: 0 2px 20px rgba(10, 26, 17, 0.4);
}

.hero-content h1 em {
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}

.hero-content .tagline {
  margin: 0;
  max-width: 540px;
  font-size: 1.05rem;
  color: #ffffff;
  text-shadow: 0 1px 8px rgba(10, 26, 17, 0.35);
}

.hero-cta-btn {
  margin-top: 1.4rem;
}

/* ---------- Liquid glass (glassmorfisme) ----------
   To varianter: "--on-dark" er for elementer som alltid ligger over hero'ens
   faste mørkegrønne bakgrunn (--brand-deep), uansett systemtema, f.eks.
   nav-knapper. Den vanlige varianten er tema-tilpasset, for kort/elementer
   som kan ligge over lyst ELLER mørkt sideinnhold. */

.liquid-glass {
  position: relative;
  overflow: hidden;
  border: none;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(10, 26, 17, 0.04);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.4);
}

.liquid-glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.4px;
  background: linear-gradient(
    180deg,
    rgba(10, 26, 17, 0.32) 0%,
    rgba(10, 26, 17, 0.1) 20%,
    rgba(10, 26, 17, 0) 40%,
    rgba(10, 26, 17, 0) 60%,
    rgba(10, 26, 17, 0.1) 80%,
    rgba(10, 26, 17, 0.32) 100%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.liquid-glass--on-dark {
  position: relative;
  overflow: hidden;
  border: none;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  background: rgba(18, 48, 31, 0.55);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.18);
}

.liquid-glass--on-dark::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.4px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.45) 0%,
    rgba(255, 255, 255, 0.15) 20%,
    rgba(255, 255, 255, 0) 40%,
    rgba(255, 255, 255, 0) 60%,
    rgba(255, 255, 255, 0.15) 80%,
    rgba(255, 255, 255, 0.45) 100%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .liquid-glass {
    background: rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.12);
  }

  :root:not([data-theme="light"]) .liquid-glass::before {
    background: linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.4) 0%,
      rgba(255, 255, 255, 0.13) 20%,
      rgba(255, 255, 255, 0) 40%,
      rgba(255, 255, 255, 0) 60%,
      rgba(255, 255, 255, 0.13) 80%,
      rgba(255, 255, 255, 0.4) 100%
    );
  }
}

/* ---------- Bob: rolig, kontinuerlig svev for enkeltelementer ---------- */

@keyframes gentle-bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

.bob {
  display: inline-block;
  animation: gentle-bob 3s ease-in-out infinite;
}

.disclaimer {
  max-width: 880px;
  margin: 1.25rem auto 0;
  padding: 0.75rem 1rem;
  background: var(--status-warning-bg);
  border: 1px solid var(--status-warning-border);
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--text-primary);
}

/* ---------- Innloggings-/registreringsmodal ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 20, 26, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 100;
}

.modal-backdrop:not([hidden]) {
  display: flex;
}

.modal {
  position: relative;
  width: 100%;
  max-width: 360px;
  background: var(--surface-1);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
  padding: 1.75rem 1.5rem 1.5rem;
}

.modal-wide {
  max-width: 520px;
  max-height: 80vh;
  overflow-y: auto;
}

.modal h2 {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
  color: var(--brand-primary);
}

.modal-subtitle {
  margin: 0 0 1.25rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.btn-vipps {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.85rem 1.25rem;
  font-size: 1.02rem;
  background: #ff5b24;
  color: #ffffff;
}

.btn-vipps:hover {
  filter: brightness(1.08);
}

.vipps-wordmark {
  font-weight: 800;
}

.vipps-hint {
  margin: 0.6rem 0 0;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--text-muted);
  text-align: center;
}

/* ---------- Lasteanimasjon: mynter i lommeboken ---------- */

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(15, 24, 33, 0.72);
}

.loading-overlay:not([hidden]) {
  display: flex;
}

.loading-content {
  text-align: center;
  color: #ffffff;
}

.wallet-animation {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 0 auto 1.5rem;
}

.wallet-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 92px;
  height: 92px;
  color: var(--accent);
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.4));
  animation: walletBounce 1.5s ease-in-out infinite;
}

.coin {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  opacity: 0;
  animation: coinFly 1.5s ease-in infinite;
}

.coin-1 {
  --start-x: -75px;
  --start-y: -65px;
  animation-delay: 0s;
}

.coin-2 {
  --start-x: 75px;
  --start-y: -60px;
  animation-delay: 0.5s;
}

.coin-3 {
  --start-x: 0px;
  --start-y: -80px;
  animation-delay: 1s;
}

@keyframes coinFly {
  0% {
    transform: translate(var(--start-x), var(--start-y)) rotate(0deg) scale(1);
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  75% {
    opacity: 1;
  }
  100% {
    transform: translate(0, 8px) rotate(180deg) scale(0.3);
    opacity: 0;
  }
}

@keyframes walletBounce {
  0%,
  40%,
  100% {
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.1);
  }
  60% {
    transform: translate(-50%, -50%) scale(1);
  }
}

.loading-progress-bar {
  width: 220px;
  height: 6px;
  margin: 0 auto 1.25rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  overflow: hidden;
}

.loading-progress-fill {
  width: 40%;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  animation: progressSlide 1.3s ease-in-out infinite;
}

@keyframes progressSlide {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(280%);
  }
}

.loading-text {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  font-weight: 700;
}

.loading-subtext {
  margin: 0;
  max-width: 320px;
  color: #e6dcc9;
  font-size: 0.9rem;
}

/* Selve poenget med denne animasjonen er å vise tydelig at siden IKKE har fryst
   mens analysen pågår, så den skal aldri bli helt statisk, heller ikke når
   brukeren har skrudd på "reduser bevegelse" i operativsystemet. Vi bytter da
   til en mykere, men fortsatt tydelig pulserende versjon i stedet for å slå av
   all animasjon. */
@media (prefers-reduced-motion: reduce) {
  .wallet-icon,
  .coin,
  .bob {
    animation: none;
  }

  .coin {
    opacity: 1;
    transform: translate(0, 0) scale(0.6);
  }

  .wallet-icon,
  .loading-progress-fill {
    animation: loadingPulse 1.3s ease-in-out infinite;
  }

  .loading-progress-fill {
    width: 100%;
    transform: none;
  }
}

@keyframes loadingPulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 6px;
}

.modal-close:hover {
  background: var(--page-plane);
}

.modal form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.modal label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.modal input {
  font: inherit;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--gridline);
  border-radius: 6px;
  background: var(--page-plane);
  color: var(--text-primary);
}

.btn-block {
  width: 100%;
  text-align: center;
}

.modal-note {
  margin: 0.9rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
}

.container {
  max-width: 880px;
  margin: 0 auto;
  padding: 1rem 1rem 3rem;
}

.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--card-shadow);
  padding: var(--space-md);
  margin-top: 1.25rem;
}

.card h2 {
  margin-top: 0;
  font-size: 1.2rem;
}

.hint {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: -0.5rem;
}

.dropzone {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  border: 2px dashed var(--gridline);
  border-radius: 10px;
  color: var(--text-secondary);
  text-align: center;
  padding: 1rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  margin-bottom: 1rem;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}

.file-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.6rem 0.55rem 0.9rem;
  background: var(--page-plane);
  font-size: 0.9rem;
}

.file-item-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
}

.file-remove-btn {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}

.file-remove-btn:hover {
  background: color-mix(in srgb, var(--status-critical) 12%, transparent);
  color: var(--status-critical);
}

.btn {
  font: inherit;
  border: none;
  border-radius: var(--radius-pill);
  padding: var(--space-2xs) var(--space-md);
  cursor: pointer;
  font-weight: 600;
  display: inline-block;
  text-decoration: none;
  text-align: center;
  transition: filter 0.15s ease, transform 0.1s ease;
}

.btn-primary,
.btn-accent {
  background: var(--brand-deep);
  color: var(--accent-ink);
}

.btn-primary:hover,
.btn-accent:hover {
  filter: brightness(1.08);
}

.btn-primary:disabled,
.btn-accent:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-danger {
  background: var(--status-critical);
  color: #ffffff;
}

.btn-danger:hover {
  filter: brightness(1.08);
}

.btn-outline-brand {
  background: transparent;
  border: 1.5px solid var(--brand-primary);
  color: var(--brand-primary);
  font-weight: 700;
}

.btn-outline-brand:hover {
  background: color-mix(in srgb, var(--brand-primary) 8%, var(--surface-1));
}

.btn-excel {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--surface-1);
  border: 1.5px solid #1d6f42;
  color: #1d6f42;
  font-weight: 700;
}

.btn-excel:hover {
  background: color-mix(in srgb, #1d6f42 8%, var(--surface-1));
}

.excel-icon {
  flex-shrink: 0;
}

.btn-pdf {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--surface-1);
  border: 1.5px solid #b5433a;
  color: #b5433a;
  font-weight: 700;
}

.btn-pdf:hover {
  background: color-mix(in srgb, #b5433a 8%, var(--surface-1));
}

.pdf-icon {
  flex-shrink: 0;
}

.status {
  margin-top: 0.75rem;
  font-size: 0.92rem;
}

.status.error {
  color: var(--status-critical);
}

.status.loading {
  color: var(--text-secondary);
}

.konto-profile-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  display: grid;
  gap: 0.4rem;
}

.withdrawal-waiver {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin: 1rem 0 0.25rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.withdrawal-waiver input[type="checkbox"] {
  flex-shrink: 0;
  margin-top: 0.2rem;
  width: 1.1rem;
  height: 1.1rem;
}

.info-box {
  background: color-mix(in srgb, var(--accent) 8%, var(--surface-1));
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  font-size: 0.92rem;
  margin-bottom: 1.25rem;
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.review-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.review-grid input,
.review-grid select {
  font: inherit;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--gridline);
  border-radius: 6px;
  background: var(--surface-1);
  color: var(--text-primary);
}

.review-grid input.field-missing,
.review-grid select.field-missing {
  border-color: var(--status-warning-border);
  background: color-mix(in srgb, var(--status-warning-border) 8%, var(--surface-1));
}

.field-note {
  font-size: 0.78rem;
  color: var(--status-warning-border);
}

.warning-box {
  background: color-mix(in srgb, var(--status-warning-border) 10%, var(--surface-1));
  border: 1px solid var(--status-warning-border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}

.warning-box h3 {
  margin-top: 0;
  font-size: 1.02rem;
}

.warning-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.warning-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  background: var(--surface-1);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  font-size: 0.9rem;
  line-height: 1.45;
}

.warning-list li::before {
  content: "";
  display: block;
  width: 1.15em;
  height: 1.15em;
  margin-top: 0.15em;
  flex-shrink: 0;
  background-color: var(--status-warning-border);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z'/%3E%3C/svg%3E");
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

#more-terms-btn {
  margin-top: 1rem;
}

.fees-section {
  margin-bottom: 1.25rem;
}

.fees-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}

.fees-section-header h3 {
  font-size: 1rem;
  margin: 0;
}

.link-btn {
  background: none;
  border: none;
  color: var(--accent-deep);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.2rem 0.3rem;
}

.link-btn:hover {
  text-decoration: underline;
}

.fee-summary-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.fee-summary-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--page-plane);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
  font-size: 0.9rem;
}

.fee-summary-name {
  color: var(--text-primary);
  font-weight: 600;
}

.fee-summary-amount {
  color: var(--text-secondary);
  white-space: nowrap;
}

.fee-edit-box {
  margin-top: 0.75rem;
}

.fee-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 2fr;
  gap: 0.5rem;
  align-items: center;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--gridline);
  font-size: 0.88rem;
}

.fee-row input,
.fee-row select {
  font: inherit;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--gridline);
  border-radius: 6px;
  background: var(--surface-1);
  color: var(--text-primary);
}

.comparison-box {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-tile {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem;
  background: var(--page-plane);
}

.stat-tile .stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.3rem;
}

.stat-tile .stat-value {
  font-size: 1.4rem;
  font-weight: 700;
}

.stat-tile.highlight {
  background: color-mix(in srgb, var(--status-critical) 10%, var(--surface-1));
  border-color: var(--status-critical);
}

.stat-tile.highlight .stat-value {
  color: var(--status-critical);
}

.chart-wrap {
  margin-bottom: 1.5rem;
  position: relative;
}

.table-wrap {
  overflow-x: auto;
  max-height: 420px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
}

thead th {
  position: sticky;
  top: 0;
  background: var(--surface-1);
  text-align: right;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--gridline);
  color: var(--text-secondary);
  font-weight: 600;
}

thead th:first-child,
tbody td:first-child {
  text-align: left;
}

tbody td {
  text-align: right;
  padding: 0.4rem 0.75rem;
  border-bottom: 1px solid var(--gridline);
  color: var(--text-primary);
}

tbody tr:last-child td {
  border-bottom: none;
}

/* ---------- Forsinket betaling / inkasso ---------- */

.rate-compare {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.rate-tile {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.25rem;
  background: var(--page-plane);
}

.rate-tile--danger {
  background: color-mix(in srgb, var(--status-critical) 8%, var(--surface-1));
  border-color: var(--status-critical);
}

.rate-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.rate-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
}

.rate-tile--danger .rate-value {
  color: var(--status-critical);
}

.rate-sub {
  margin-top: 0.3rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.late-payment-steps h3 {
  font-size: 1rem;
  margin-bottom: 0.6rem;
}

.late-payment-steps ol {
  margin: 0;
  padding-left: 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.late-payment-steps li strong {
  color: var(--text-primary);
}

.late-payment-example {
  margin-top: 1.25rem;
  background: var(--status-warning-bg);
  border: 1px solid var(--status-warning-border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  font-size: 0.9rem;
}

.late-payment-example h3 {
  margin: 0 0 0.5rem;
  font-size: 0.98rem;
}

.late-payment-example p {
  margin: 0;
}

/* ---------- Story-seksjoner (illustrerte fakta-avsnitt på forsiden) ---------- */

.story-section {
  padding: var(--space-2xl) 1.25rem;
  border-top: 1px solid var(--border);
}

.story-section--alt {
  background: var(--surface-1);
}

.story-inner {
  max-width: 760px;
  margin: 0 auto;
}

.story-section .eyebrow {
  color: var(--text-muted);
}

.story-section h2 {
  margin: 0 0 1rem;
  font-size: clamp(1.5rem, 2.5vw + 1rem, 2rem);
  line-height: 1.2;
  max-width: 20ch;
}

.story-figure {
  margin: 0 0 2rem;
}

.story-figure-value {
  font-weight: 800;
  font-size: clamp(2.75rem, 6vw, 4rem);
  line-height: 1;
  color: var(--brand-primary);
}

.story-figure-label {
  margin-top: 0.5rem;
  max-width: 480px;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.story-bars {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin: 1.5rem 0 2rem;
  max-width: 560px;
}

.story-bar-row {
  display: grid;
  grid-template-columns: 100px minmax(100px, 220px) 44px;
  align-items: center;
  gap: 0.75rem;
}

.story-bar-name {
  font-size: 0.86rem;
  color: var(--text-secondary);
}

.story-bar-track {
  position: relative;
  height: 16px;
  background: var(--gridline);
  border-radius: 4px;
  overflow: hidden;
}

.story-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  height: 100%;
  border-radius: 0 4px 4px 0;
  background: var(--text-muted);
}

.story-bar-value {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.story-bar-row--emphasis .story-bar-name,
.story-bar-row--emphasis .story-bar-value {
  color: var(--brand-primary);
  font-weight: 700;
}

.story-bar-row--emphasis .story-bar-fill {
  background: var(--accent);
}

.story-compare-legend {
  display: flex;
  gap: 1.5rem;
  margin: 0 0 0.5rem;
}

.story-compare-legend-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.story-compare-swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.story-compare-swatch--no {
  background: var(--accent);
}

.story-compare-swatch--se {
  background: var(--series-avdrag);
}

.story-compare-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.1rem;
}

.story-compare-group:last-child {
  margin-bottom: 0;
}

.story-compare-group-label {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-primary);
}

.story-compare-bars .story-bar-row {
  grid-template-columns: 70px minmax(100px, 220px) 90px;
}

.story-bar-fill--no {
  background: var(--accent);
}

.story-bar-fill--se {
  background: var(--series-avdrag);
}

.story-bar-fill--warn {
  background: var(--status-critical);
  min-width: 10px;
}

.story-bar-row--total .story-bar-name,
.story-bar-row--total .story-bar-value {
  font-weight: 600;
  color: var(--text-primary);
}

/* "Sammenlign med andre banker"-panelet (steg 5-bonus) */
#compare-banks-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.compare-banks-icon {
  flex-shrink: 0;
}

.compare-banks-card {
  scroll-margin-top: 16px;
}

.compare-banks-header {
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.compare-banks-header h2 {
  margin-top: 0.15rem;
}

.renate-ai-tools-card {
  scroll-margin-top: 16px;
}

.renate-ai-tools-header {
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.renate-ai-tools-header h2 {
  margin-top: 0.15rem;
}

.renate-ai-tools-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.renate-ai-tab {
  font: inherit;
  font-size: 0.85rem;
  padding: 0.45rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: var(--surface-1);
  color: var(--text-secondary);
  cursor: pointer;
}

.renate-ai-tab:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}

.renate-ai-tab.is-active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface-1));
  color: var(--text-primary);
}

.renate-ai-tool-form {
  margin-bottom: 1rem;
}

.renate-ai-tool-result {
  margin-bottom: 1rem;
}

.renate-ai-tool-result p {
  margin: 0 0 0.5rem;
}

.renate-ai-tool-result p:last-child {
  margin-bottom: 0;
}

.loan-priority-rows {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.loan-priority-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  align-items: end;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.loan-priority-row label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.loan-priority-row input {
  font: inherit;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--gridline);
  border-radius: 6px;
  background: var(--surface-1);
  color: var(--text-primary);
}

.loan-priority-remove-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  text-decoration: underline;
  padding: 0;
  justify-self: start;
}

.loan-priority-extra-label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
  max-width: 280px;
  margin-bottom: 0.75rem;
}

.loan-priority-extra-label input {
  font: inherit;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--gridline);
  border-radius: 6px;
  background: var(--surface-1);
  color: var(--text-primary);
}

.loan-priority-bulk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

/* ---------- /renate-ai: egen side med avtalevelger, chat-kolonne og verktøy ---------- */

.container--wide {
  max-width: 1180px;
}

.renate-ai-empty-state {
  text-align: center;
  max-width: 620px;
  margin-left: auto;
  margin-right: auto;
}

.renate-ai-empty-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.renate-ai-picker-card {
  margin-bottom: 1.5rem;
}

.renate-ai-picker-header h2 {
  margin-top: 0.15rem;
}

.renate-ai-picker-row {
  margin-top: 0.75rem;
}

.renate-ai-loan-select {
  width: 100%;
  max-width: 420px;
  font: inherit;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--gridline);
  border-radius: 8px;
  background: var(--surface-1);
  color: var(--text-primary);
}

.renate-ai-layout {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
}

/* .card.renate-ai-chat-col (to feil klasser) for å garantert vinne over senere
   .card-regler i filen (f.eks. desktop-polish-seksjonen) uavhengig av rekkefølge. */
.card.renate-ai-chat-col {
  order: 2;
  flex: 1 1 380px;
  position: sticky;
  top: 16px;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  min-height: 520px;
  max-height: calc(100vh - 32px);
}

.renate-ai-tools-col {
  order: 1;
  flex: 2 1 480px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-width: 0;
}

.renate-chat-col-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface-1));
}

.renate-chat-messages--col {
  flex: 1;
  min-height: 0;
}

.renate-ai-base-loan .hint {
  margin-top: -0.5rem;
}

.renate-ai-tool-copy {
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin-top: -0.3rem;
}

@media (max-width: 900px) {
  .renate-ai-layout {
    flex-direction: column;
  }

  .card.renate-ai-chat-col {
    order: 1;
    position: static;
    max-height: none;
    min-height: 420px;
  }

  .renate-ai-tools-col {
    order: 2;
  }
}

.bank-compare-caption {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0 0 0.2rem;
}

.bank-compare-row {
  display: flex;
  flex-direction: column;
}

.bank-compare-fees {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0.2rem 0 0;
}

.bank-compare-fees--estimate {
  color: var(--status-critical);
}

.bank-compare-disclaimer {
  font-size: 0.78rem;
  font-style: italic;
  color: var(--text-secondary);
  margin: 0 0 0.6rem;
}

.bank-compare-bars .story-bar-row {
  grid-template-columns: 140px minmax(100px, 220px) 150px;
  align-items: start;
}

.bank-compare-bars .story-bar-value {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
}

.bank-compare-delta {
  font-size: 0.76rem;
  font-weight: 600;
  white-space: nowrap;
}

.bank-compare-delta--down {
  color: var(--accent);
}

.bank-compare-delta--up {
  color: var(--status-critical);
}

.bank-compare-extra {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.bank-compare-extra--estimate {
  color: var(--status-critical);
}

.bank-compare-effective-rate {
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.bank-compare-effective-rate--estimate {
  color: var(--status-critical);
}

@media (max-width: 560px) {
  .bank-compare-bars .story-bar-row {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }

  .bank-compare-bars .story-bar-value {
    align-items: flex-start;
  }
}

.story-copy {
  max-width: 620px;
  color: var(--text-secondary);
}

.story-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.story-stat-tile {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  background: var(--page-plane);
}

.story-stat-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.story-stat-value {
  margin-top: 0.3rem;
  font-weight: 800;
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  color: var(--brand-primary);
}

.story-stat-sub {
  margin-top: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.story-rates {
  margin-top: 0.75rem;
}

/* Rentene på forbrukslån/kredittkort er poenget med seksjonen (det er DISSE vi vil ha
   ned), så de skal dominere visuelt over boliglånsrenten, som bare er der som normalt
   sammenligningsgrunnlag. */
.story-rates .rate-tile--danger .rate-value {
  font-size: 2rem;
  font-weight: 800;
}

.story-rates .rate-tile--muted {
  background: transparent;
  border-style: dashed;
}

.story-rates .rate-tile--muted .rate-value {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.story-figure-value--danger {
  color: var(--status-critical);
}

.story-source {
  margin-top: 1.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.story-source a {
  color: inherit;
}

@media (max-width: 560px) {
  .story-bar-row {
    grid-template-columns: 84px 1fr 40px;
    gap: 0.5rem;
  }

  .story-compare-bars .story-bar-row {
    grid-template-columns: 56px 1fr 74px;
    gap: 0.5rem;
  }
}

.app-footer {
  border-top: 1px solid var(--border);
  margin-top: 2rem;
  padding: 2rem 1rem 2.5rem;
}

.footer-wordmark {
  font-family: var(--font-serif);
  font-weight: 340;
  font-style: italic;
  font-size: clamp(3.5rem, 13vw, 8rem);
  line-height: 0.85;
  letter-spacing: -0.02em;
  color: var(--brand-primary);
  text-align: center;
  margin: 0 0 var(--space-sm);
  overflow: hidden;
}

.footer-inner {
  max-width: 880px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}

.footer-inner p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  max-width: 480px;
}

.footer-links {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.82rem;
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--accent-deep);
  text-decoration: underline;
}

/* ---------- Om oss / kontakt-side ---------- */

.hero--compact {
  min-height: 200px;
}

.hero--compact .hero-content {
  padding-bottom: 2rem;
}

.hero--compact .hero-content h1 {
  font-size: clamp(2.1rem, 3.5vw + 1rem, 3rem);
}

.about-lede {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 640px;
}

.about-card {
  display: grid;
  grid-template-columns: minmax(220px, 300px) 1fr;
  gap: var(--space-lg);
  align-items: start;
}

.about-portrait {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  align-self: stretch;
  background:
    radial-gradient(120% 140% at 15% -10%, rgba(255, 255, 255, 0.06), transparent 55%),
    radial-gradient(circle, rgba(255, 255, 255, 0.05) 1px, transparent 1.5px) 0 0 / 26px 26px,
    linear-gradient(160deg, var(--brand-deep) 0%, var(--color-forest-800) 55%, var(--color-forest-700) 100%);
}

.about-portrait img,
.about-illustration {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 220px;
  object-fit: cover;
}

.contact-photo-badge {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 2.5rem 1rem 0.85rem;
  background: linear-gradient(to bottom, transparent, rgba(10, 26, 17, 0.85));
  color: #ffffff;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  text-align: center;
}

.mission-list {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem;
}

.mission-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: var(--page-plane);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
  font-size: 0.92rem;
}

.mission-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--accent) 16%, var(--surface-1));
  color: var(--accent-deep);
}

.icon-text {
  display: inline-block;
  width: 1.15em;
  height: 1.15em;
  vertical-align: -0.22em;
  margin-right: 0.3em;
  flex-shrink: 0;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1.1rem;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.25rem;
  background: var(--page-plane);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.1s ease;
}

.contact-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.contact-card--disabled {
  cursor: default;
}

.contact-card--disabled:hover {
  border-color: var(--border);
  transform: none;
}

.contact-card--disabled .contact-value {
  color: var(--text-muted);
}

.contact-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 16%, var(--surface-1));
  color: var(--accent-deep);
}

.contact-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.contact-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.contact-value {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--brand-primary);
  word-break: break-word;
}

/* ---------- Historikk (lagres lokalt i nettleseren) ---------- */

.history-panel {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 151;
  width: min(320px, 85vw);
  /* Bevisst IKKE overflow-y:auto her: å sette overflow-y uten overflow-x gjør at
     nettleseren klipper x-retningen også, noe som ville skjult pil-fanen som
     stikker ut til høyre for panelet med "right: -34px" under. Selve
     scrollingen skjer i stedet i .history-panel-body under. */
  overflow: visible;
  transform: translateX(-100%);
  transition: transform 0.25s ease;
}

.history-panel.is-open {
  transform: translateX(0);
}

.history-panel-body {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1.5rem 1.25rem;
  background: var(--surface-1);
  box-shadow: 6px 0 24px rgba(0, 0, 0, 0.15);
  overflow-y: auto;
  overflow-x: hidden;
}

.history-panel-tab {
  position: absolute;
  top: 50%;
  right: -44px;
  transform: translateY(-50%);
  width: 44px;
  height: 172px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  border: none;
  border-radius: 0 12px 12px 0;
  background: var(--gold);
  color: #0a1a11;
  cursor: pointer;
  box-shadow: 5px 0 16px rgba(0, 0, 0, 0.16);
  animation: history-tab-peek 2.4s ease 0.6s 1;
}

.history-panel-tab:hover {
  background: #f0cd6c;
}

.history-tab-label {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.history-tab-arrow {
  flex-shrink: 0;
  transition: transform 0.25s ease;
}

/* Én diskret "kikk ut og tilbake" idet siden laster, for å gjøre folk
   oppmerksom på at fanen finnes -- spilles kun én gang (ikke repeterende),
   se prefers-reduced-motion-unntaket lenger ned i filen. */
@keyframes history-tab-peek {
  0%, 15% {
    transform: translateY(-50%) translateX(0);
  }
  40% {
    transform: translateY(-50%) translateX(10px);
  }
  70%, 100% {
    transform: translateY(-50%) translateX(0);
  }
}

.history-panel.is-open .history-tab-arrow {
  transform: rotate(180deg);
}

.history-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.history-panel-header h2 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--brand-primary);
}

.history-note {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: var(--page-plane);
  border-radius: 8px;
  padding: 0.65rem 0.8rem;
}

.history-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.history-empty {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.history-item {
  display: flex;
  align-items: stretch;
  gap: 0.4rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.history-item-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  background: var(--page-plane);
  border: none;
  padding: 0.6rem 0.75rem;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.history-item-main:hover {
  background: color-mix(in srgb, var(--accent) 8%, var(--page-plane));
}

.history-item-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.history-item-sub {
  font-size: 0.78rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.history-item-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.history-item-delete,
.history-item-pin {
  flex-shrink: 0;
  width: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: var(--page-plane);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.95rem;
}

.history-item-delete:hover {
  background: color-mix(in srgb, var(--status-critical) 14%, var(--page-plane));
  color: var(--status-critical);
}

.history-item-pin:hover,
.history-item-pin.is-pinned {
  background: color-mix(in srgb, var(--accent) 14%, var(--page-plane));
  color: var(--accent);
}

.history-item-confirm {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: color-mix(in srgb, var(--status-critical) 8%, var(--page-plane));
  padding: 0.65rem 0.75rem;
}

.history-item-confirm-text {
  font-size: 0.82rem;
  color: var(--text-primary);
}

.history-item-confirm-actions {
  display: flex;
  gap: 0.5rem;
}

.history-item-confirm-actions .btn {
  flex: 1;
}

/* ---------- Bekreftelsesboks (f.eks. før sletting) ---------- */

.confirm-popover-wrap {
  position: relative;
}

.confirm-popover {
  position: absolute;
  bottom: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  z-index: 10;
  background: var(--surface-1);
  border: 1px solid var(--status-critical);
  border-radius: 10px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
  padding: 0.9rem;
}

.confirm-popover p {
  margin: 0 0 0.7rem;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.confirm-popover-actions {
  display: flex;
  gap: 0.5rem;
}

.confirm-popover-actions .btn {
  flex: 1;
}

/* ---------- Excel-eksport ---------- */

.excel-export-box {
  margin-top: 1.25rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border);
}

.excel-export-box .hint {
  margin-top: 0.5rem;
  margin-bottom: 0;
}

.export-buttons-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ---------- Prisplaner ---------- */

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.25rem;
  margin-top: 1.25rem;
  align-items: stretch;
}

.pricing-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  background: var(--page-plane);
}

.pricing-card.featured {
  border: 1.5px solid var(--accent);
  box-shadow: 0 10px 28px rgba(13, 26, 17, 0.16), inset 0 1px 1px rgba(255, 255, 255, 0.4);
  /* .liquid-glass sets overflow:hidden, men "Spar 40 %"-merket stikker bevisst
     opp over kortets toppkant (top: -12px på .pricing-badge) og må ikke klippes. */
  overflow: visible;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .pricing-card.featured {
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.12);
  }
}

.pricing-badge {
  position: absolute;
  top: -12px;
  right: 1.25rem;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.pricing-card h3 {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
  color: var(--brand-primary);
}

.price-row {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  margin: 0.5rem 0 1.1rem;
}

.price-amount {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
}

.price-period {
  color: var(--text-secondary);
  font-size: 0.88rem;
}

.price-vat {
  color: var(--text-secondary);
  font-size: 0.72rem;
  margin: -0.95rem 0 1.1rem;
}

.plan-features {
  list-style: none;
  margin: 0 0 1.4rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
  flex: 1;
}

.plan-features li {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
}

.plan-features li::before {
  content: "";
  display: block;
  width: 1.1em;
  height: 1.1em;
  margin-top: 0.15em;
  flex-shrink: 0;
  background-color: var(--series-gebyr);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='m4.5 12.75 6 6 9-13.5'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='m4.5 12.75 6 6 9-13.5'/%3E%3C/svg%3E");
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

.plan-features li.plan-feature--bonus {
  color: var(--accent-deep);
  font-weight: 700;
}

.plan-features li.plan-feature--bonus::before {
  background-color: var(--accent);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M12 2.5l2.9 6.02 6.6.77-4.86 4.53 1.27 6.6L12 17.4l-5.9 3.02 1.27-6.6L2.5 9.29l6.6-.77L12 2.5Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M12 2.5l2.9 6.02 6.6.77-4.86 4.53 1.27 6.6L12 17.4l-5.9 3.02 1.27-6.6L2.5 9.29l6.6-.77L12 2.5Z'/%3E%3C/svg%3E");
}

.plan-features li.plan-feature--highlight {
  color: var(--gold-deep);
  font-weight: 700;
}

.plan-features li.plan-feature--highlight::before {
  background-color: var(--gold);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M12 2.5l2.9 6.02 6.6.77-4.86 4.53 1.27 6.6L12 17.4l-5.9 3.02 1.27-6.6L2.5 9.29l6.6-.77L12 2.5Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M12 2.5l2.9 6.02 6.6.77-4.86 4.53 1.27 6.6L12 17.4l-5.9 3.02 1.27-6.6L2.5 9.29l6.6-.77L12 2.5Z'/%3E%3C/svg%3E");
}

.plan-features li.plan-feature--excluded {
  color: var(--text-muted);
}

.plan-features li.plan-feature--excluded::before {
  background-color: var(--status-critical);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E");
}

.pricing-card .btn {
  margin-top: auto;
}

.addon-qty-input {
  font: inherit;
  font-size: 2rem;
  font-weight: 800;
  width: 2.6ch;
  padding: 0 0 0.1rem;
  border: none;
  border-bottom: 2px dashed var(--gridline);
  background: transparent;
  color: var(--text-primary);
  text-align: left;
}

.addon-qty-input:focus {
  outline: none;
  border-bottom-color: var(--accent);
}

/* ---------- Bankoversikt ---------- */

.card h2 + .lender-grid,
.lender-grid + h2 {
  margin-top: 1rem;
}

.lender-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.lender-card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  background: var(--page-plane);
}

.lender-card h3 {
  margin: 0;
  font-size: 1.05rem;
}

.lender-type {
  margin: -0.4rem 0 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.lender-products {
  margin: 0;
  font-size: 0.88rem;
}

.lender-facts {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.lender-fact {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.lender-fact dt {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.lender-fact dd {
  margin: 0;
  font-size: 0.9rem;
}

.warning-list--compact li {
  font-size: 0.82rem;
  padding: 0.5rem 0.7rem;
}

.lender-link {
  margin-top: auto;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-deep);
  text-decoration: none;
}

.lender-link:hover {
  text-decoration: underline;
}

/* ---------- Personvern / vilkår (juridisk tekst) ---------- */

.legal-updated {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-style: italic;
  margin-top: -0.75rem;
}

.legal-placeholder {
  display: inline-block;
  background: var(--status-warning-bg);
  border: 1px dashed var(--status-warning-border);
  color: var(--status-warning-border);
  padding: 0.05rem 0.45rem;
  border-radius: 4px;
  font-weight: 700;
}

.card section + section {
  margin-top: 1.75rem;
}

.card h2.legal-h2 {
  font-size: 1.1rem;
  margin-bottom: 0.6rem;
}

.card h3.legal-h3 {
  font-size: 0.98rem;
  margin: 1.1rem 0 0.4rem;
}

.card .legal-body p,
.card .legal-body li {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text-primary);
}

.card .legal-body ul,
.card .legal-body ol {
  margin: 0.4rem 0 0.8rem;
  padding-left: 1.3rem;
}

/* ---------- Ta eksamen ---------- */

#exam-intro .btn {
  margin-top: 1rem;
}

.exam-progress {
  margin-bottom: 1.5rem;
}

.exam-progress-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.exam-progress-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--gridline);
  overflow: hidden;
}

.exam-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.2s ease;
}

.exam-question {
  font-size: 1.15rem;
  margin: 0 0 1.1rem;
}

.exam-options {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1.5rem;
}

.exam-option {
  font: inherit;
  text-align: left;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--surface-1);
  color: var(--text-primary);
  cursor: pointer;
}

.exam-option:hover:not(:disabled) {
  border-color: var(--accent);
}

.exam-option:disabled {
  cursor: default;
}

.exam-option.correct {
  border-color: var(--series-gebyr);
  background: color-mix(in srgb, var(--series-gebyr) 16%, var(--surface-1));
  color: var(--text-primary);
  font-weight: 600;
}

.exam-option.wrong {
  border-color: var(--status-critical);
  background: color-mix(in srgb, var(--status-critical) 16%, var(--surface-1));
  color: var(--text-primary);
  font-weight: 600;
}

.exam-nav {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

.exam-review-heading {
  margin-top: 2rem;
}

.exam-review-item {
  border: 1px solid var(--border);
  border-left: 4px solid var(--status-critical);
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
  margin-top: 1rem;
  background: var(--page-plane);
}

.exam-review-item.correct {
  border-left-color: var(--series-gebyr);
}

.exam-review-question {
  font-weight: 600;
  margin: 0 0 0.6rem;
}

.exam-review-options {
  list-style: none;
  margin: 0 0 0.6rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.88rem;
}

.exam-review-options li.is-correct,
.exam-review-options li.is-wrong {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
}

.exam-review-options li.is-correct {
  color: var(--series-gebyr);
}

.exam-review-options li.is-wrong {
  color: var(--status-critical);
}

.exam-review-options li.is-correct::before,
.exam-review-options li.is-wrong::before {
  content: "";
  display: block;
  width: 1em;
  height: 1em;
  flex-shrink: 0;
  background-color: currentColor;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}

.exam-review-options li.is-correct::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='m4.5 12.75 6 6 9-13.5'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='m4.5 12.75 6 6 9-13.5'/%3E%3C/svg%3E");
}

.exam-review-options li.is-wrong::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M6 18 18 6M6 6l12 12'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M6 18 18 6M6 6l12 12'/%3E%3C/svg%3E");
}

.exam-review-explanation {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

/* ---------- Resultater som slides ---------- */

.slides-card {
  display: none;
  flex-direction: column;
}

.slides-card:not([hidden]) {
  display: flex;
}

.slide-progress {
  margin-bottom: 1.25rem;
}

.slide-progress-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}

.slide-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--brand-primary);
}

.btn-small {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  flex-shrink: 0;
  white-space: nowrap;
}

.slide-dots {
  display: flex;
  gap: 0.4rem;
}

.slide-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gridline);
  transition: background 0.15s ease, transform 0.15s ease;
}

.slide-dot.is-active {
  background: var(--accent);
  transform: scale(1.25);
}

.slide-dot.is-done {
  background: color-mix(in srgb, var(--accent) 55%, var(--gridline));
}

.slide {
  min-height: 120px;
}

.monthly-payment-box {
  text-align: center;
  background: var(--page-plane);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.monthly-payment-box .monthly-payment-label {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.monthly-payment-box .monthly-payment-value {
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--brand-primary);
}

.monthly-payment-box .monthly-payment-sub {
  margin-top: 0.3rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

#toggle-table-btn {
  margin-bottom: 1rem;
}

#toggle-chart-btn {
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

.slide-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

@media (max-width: 560px) {
  .card {
    padding: 1.1rem;
  }

  .fee-row {
    grid-template-columns: 1fr;
  }

  .about-card {
    grid-template-columns: 1fr;
  }

  .about-portrait img {
    min-height: 160px;
  }

  thead th,
  tbody td {
    padding: 0.4rem 0.5rem;
  }

  .hero {
    min-height: 280px;
  }

  .navbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .nav-actions {
    width: 100%;
  }

  .nav-actions .btn {
    flex: 1;
  }

  /* .nav-actions .nav-priser-btn (to klasser) for å garantert vinne over den
     senere, ubetingede .btn { display: inline-flex } -regelen lenger ned i
     filen, som ellers har lik spesifisitet og vinner på kildekode-rekkefølge. */
  .nav-actions .nav-priser-btn,
  .nav-actions .nav-renate-ai-btn {
    display: none;
  }

  .slide-nav {
    flex-wrap: wrap;
  }

  .slide-nav .btn {
    flex: 1 1 auto;
  }

  .slide-progress-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .fee-summary-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
  }

  .renate-chat-panel {
    right: 0.75rem;
    bottom: 5.25rem;
    width: min(340px, calc(100vw - 1.5rem));
  }

  .renate-chat-toggle {
    right: 1rem;
    bottom: 1rem;
  }
}

/* ---------- Chat med Renate ---------- */

.renate-chat-toggle {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  width: 64px;
  height: 64px;
  padding: 0;
  border: 2px solid var(--border);
  border-radius: 50%;
  background: var(--surface-1);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  z-index: 140;
  transition: transform 0.15s ease;
}

.renate-chat-toggle:hover {
  transform: scale(1.06);
}

.renate-face {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 50%;
  object-fit: cover;
}

.renate-face-small {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.renate-chat-panel {
  position: fixed;
  right: 1.5rem;
  bottom: 6.5rem;
  z-index: 140;
  width: min(360px, calc(100vw - 2rem));
  max-height: min(520px, 70vh);
  display: flex;
  flex-direction: column;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

.renate-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface-1));
}

.renate-chat-header-info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.renate-chat-title {
  font-weight: 800;
  color: var(--brand-primary);
}

.renate-chat-subtitle {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.renate-chat-close {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 6px;
  padding: 0.25rem 0.5rem;
  flex-shrink: 0;
}

.renate-chat-close:hover {
  background: var(--page-plane);
}

.renate-chat-tools-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.55rem 1rem;
  border: none;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--accent) 14%, var(--surface-1));
  color: var(--text-primary);
  cursor: pointer;
  flex-shrink: 0;
}

.renate-chat-tools-cta:hover {
  background: color-mix(in srgb, var(--accent) 22%, var(--surface-1));
}

.renate-chat-messages {
  flex: 1;
  min-height: 220px;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.chat-msg {
  max-width: 85%;
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.chat-msg--assistant {
  align-self: flex-start;
  background: var(--page-plane);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

.chat-msg--user {
  align-self: flex-end;
  background: var(--accent);
  color: var(--accent-ink);
  border-bottom-right-radius: 4px;
}

.chat-msg-link {
  display: inline-block;
  margin-top: 0.5rem;
  font-weight: 700;
  color: var(--accent-deep);
  text-decoration: underline;
}

.renate-chat-form {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid var(--border);
}

.renate-chat-form input {
  flex: 1;
  font: inherit;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--gridline);
  border-radius: 8px;
  background: var(--page-plane);
  color: var(--text-primary);
  min-width: 0;
}

.renate-chat-form input:disabled {
  opacity: 0.6;
}

#renate-chat-status {
  margin: 0 0.75rem 0.75rem;
}

/* =====================================================================
   Polish-lag (lanseringsversjon)
   Samlet til slutt i filen slik at det overstyrer de eldre reglene over
   uten å måtte skrive dem om. Bygger på de samme fargetokenene.
   ===================================================================== */

:root {
  --gold: #e8c15a;
  --gold-deep: #c9a23c;
  --on-dark: #ffffff;
  --on-dark-muted: #c9dccf;
  --color-excel: #1d6f42;
  --color-pdf: var(--status-critical);
  --status-success: #2c6b3d;

  --shadow-sm: 0 1px 2px rgba(13, 26, 17, 0.06), 0 2px 6px rgba(13, 26, 17, 0.05);
  --shadow-md: 0 1px 2px rgba(13, 26, 17, 0.06), 0 12px 32px rgba(13, 26, 17, 0.08);
  --shadow-lg: 0 2px 4px rgba(13, 26, 17, 0.06), 0 24px 56px rgba(13, 26, 17, 0.14);
  --shadow-overlay: 0 24px 64px rgba(6, 15, 10, 0.35);
  --card-shadow: var(--shadow-md);

  --focus-ring: 0 0 0 3px var(--surface-1), 0 0 0 5px var(--gold-deep);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: 150ms;
  --dur-med: 280ms;
  --dur-slow: 600ms;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 32px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.4), 0 24px 56px rgba(0, 0, 0, 0.5);
    --card-shadow: var(--shadow-md);
    --status-success: #6fc084;
    --color-excel: #4fb07a;
  }
}

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

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection {
  background: color-mix(in srgb, var(--gold) 45%, transparent);
  color: var(--text-primary);
}

#upload-card,
#slides-card {
  scroll-margin-top: 1rem;
}

body.is-busy,
body.modal-open {
  overflow: hidden;
}

/* ---------- Tastaturfokus: tydelig, men kun ved tastaturbruk ---------- */

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

.btn:focus-visible {
  border-radius: var(--radius-pill);
}

.hero :focus-visible,
.app-footer :focus-visible {
  box-shadow: 0 0 0 3px var(--gold);
}

.slide-title:focus-visible,
.exam-question:focus-visible,
#exam-result-heading:focus-visible {
  box-shadow: none;
}

/* ---------- Hero: bakgrunnsvideo (kun forsiden, .hero--video) ----------
   Videoen får hele toppflaten for seg selv, uten tekst oppå innholdet. Navigasjonen
   ligger over videoens øverste kant (knappene til høyre, R-logoen fra videoen alene i
   venstre hjørne), og knappene og tillitspunktene står under videoen. */

.hero--video {
  --video-h: min(56.25vw, 100svh);
  min-height: 0;
}

.hero--video .hero-bg {
  bottom: auto;
  height: var(--video-h);
}

.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Forankret i toppen så R-logoen øverst til venstre i videoen aldri klippes bort. */
  object-position: center top;
}

/* Svak toning øverst (lesbar navigasjon) og en myk overgang nederst inn i hero-fargen. */
.hero-video-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(6, 15, 10, 0.45) 0%,
    rgba(6, 15, 10, 0) 16%,
    rgba(6, 15, 10, 0) 93%,
    var(--brand-deep) 100%
  );
}

.hero--video .navbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
}

/* Videoen har R-logoen i hjørnet, så navigasjonens egen logo skjules her for å unngå
   to logoer. visibility (ikke display) beholder plassen, så knappene står der de pleier. */
.hero--video .navbar .brand {
  visibility: hidden;
}

.hero--video .hero-content {
  justify-content: flex-start;
  padding-top: calc(var(--video-h) + 1.5rem);
  padding-bottom: 3rem;
}

.hero--video .hero-cta-row {
  margin-top: 0;
}

/* Stående skjermer (mobil): stående 9:16-video, like bred som skjermen. */
@media (max-aspect-ratio: 10/11) {
  .hero--video {
    --video-h: min(177.78vw, 100svh);
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hero {
  min-height: 460px;
  isolation: isolate;
}

.hero--compact {
  min-height: 300px;
}

.hero-content > * {
  animation: hero-rise var(--dur-slow) var(--ease-out) both;
}

.hero-content > :nth-child(2) { animation-delay: 60ms; }
.hero-content > :nth-child(3) { animation-delay: 120ms; }
.hero-content > :nth-child(4) { animation-delay: 180ms; }
.hero-content > :nth-child(5) { animation-delay: 240ms; }

@keyframes hero-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.hero-content .tagline {
  max-width: 580px;
  font-size: clamp(1rem, 0.6vw + 0.9rem, 1.15rem);
  line-height: 1.6;
  color: var(--on-dark-muted);
}

.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.hero-cta-row .hero-cta-btn {
  margin-top: 0;
}

.hero .btn-accent {
  background: var(--gold);
  color: #0a1a11;
  box-shadow: 0 6px 20px rgba(232, 193, 90, 0.22);
}

.hero .btn-accent:hover:not(:disabled) {
  background: #f0cd6c;
  filter: none;
  box-shadow: 0 10px 28px rgba(232, 193, 90, 0.3);
}

.hero-trust {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.4rem;
  margin: 1.6rem 0 0;
  padding: 0;
  font-size: 0.86rem;
  color: var(--on-dark-muted);
}

.hero-trust li {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.hero-trust li::before {
  content: "";
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  background-color: var(--gold);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='m4.5 12.75 6 6 9-13.5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='m4.5 12.75 6 6 9-13.5'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Skarp, avrundet underkant i stedet for en toning mot kremhvit, som ga et
   gråaktig bånd i lyst tema. */
.hero-fade {
  display: none;
}

.hero {
  border-radius: 0 0 clamp(20px, 3.5vw, 40px) clamp(20px, 3.5vw, 40px);
}

.hero-content {
  padding-bottom: 4rem;
}

/* ---------- Knapper: løft ved hover, trykk ved klikk ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 44px;
  line-height: 1.2;
  transition:
    transform var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out),
    background-color var(--dur-fast) ease,
    filter var(--dur-fast) ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: var(--shadow-md);
}

.btn-small {
  min-height: 36px;
}

.btn-lg {
  min-height: 52px;
  padding: 0.8rem 1.6rem;
  font-size: 1.02rem;
}

.btn:disabled {
  cursor: not-allowed;
}

.btn.is-loading {
  position: relative;
  color: transparent !important;
}

.btn.is-loading svg {
  visibility: hidden;
}

.btn.is-loading::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--text-secondary);
  border-right-color: transparent;
  border-left-color: transparent;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.btn-excel {
  border-color: var(--color-excel);
  color: var(--color-excel);
}

.btn-excel:hover {
  background: color-mix(in srgb, var(--color-excel) 8%, var(--surface-1));
}

.btn-pdf {
  border-color: var(--color-pdf);
  color: var(--color-pdf);
}

.btn-pdf:hover {
  background: color-mix(in srgb, var(--color-pdf) 8%, var(--surface-1));
}

/* ---------- Kort og innhold ---------- */

.container {
  padding: 1.5rem 1rem 3.5rem;
}

.card {
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 3vw, 2rem);
  margin-top: 1.5rem;
}

.card h2 {
  font-size: clamp(1.15rem, 0.6vw + 1rem, 1.35rem);
  letter-spacing: -0.01em;
}

.disclaimer {
  border-radius: var(--radius-md);
  line-height: 1.55;
  margin-left: 1rem;
  margin-right: 1rem;
}

@media (min-width: 912px) {
  .disclaimer {
    margin-left: auto;
    margin-right: auto;
  }
}

.pricing-card,
.contact-card:not(.contact-card--disabled),
.lender-card,
.story-stat-tile,
.stat-tile,
.rate-tile {
  transition: transform var(--dur-med) var(--ease-out), box-shadow var(--dur-med) var(--ease-out);
}

.pricing-card:hover,
.contact-card:not(.contact-card--disabled):hover,
.lender-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.stat-value,
.rate-value,
.monthly-payment-value,
.story-stat-value,
.story-figure-value,
.price-amount {
  font-variant-numeric: tabular-nums;
}

/* ---------- Scroll-inntoning (se nav.js) ---------- */

.reveal-ready .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity var(--dur-slow) var(--ease-out) var(--reveal-delay, 0ms),
    transform var(--dur-slow) var(--ease-out) var(--reveal-delay, 0ms),
    box-shadow var(--dur-med) var(--ease-out);
}

.reveal-ready .reveal.is-visible {
  opacity: 1;
  transform: none;
}

.reveal-ready .reveal.is-visible:is(.pricing-card, .lender-card, .contact-card:not(.contact-card--disabled)):hover {
  transform: translateY(-3px);
  transition-delay: 0ms;
}

/* ---------- Opplasting ---------- */

.dropzone {
  flex-direction: column;
  gap: 0.35rem;
  min-height: 170px;
  border-radius: var(--radius-md);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--gridline));
  background: color-mix(in srgb, var(--accent) 3%, var(--surface-1));
  transition:
    border-color var(--dur-fast) ease,
    background-color var(--dur-fast) ease,
    transform var(--dur-med) var(--ease-out);
}

.dropzone-icon {
  color: var(--accent);
  margin-bottom: 0.2rem;
  transition: transform var(--dur-med) var(--ease-spring);
}

.dropzone:hover .dropzone-icon,
.dropzone.dragover .dropzone-icon {
  transform: translateY(-4px);
}

.dropzone.dragover {
  transform: scale(1.01);
  border-style: solid;
}

.dropzone:focus-visible {
  border-radius: var(--radius-md);
}

#dropzone-text {
  font-weight: 600;
  color: var(--text-primary);
}

.dropzone-formats {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.file-item {
  animation: item-in var(--dur-med) var(--ease-out);
}

.file-item-name {
  flex: 1;
  min-width: 0;
}

.file-item-size {
  flex-shrink: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

@keyframes item-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

#analyze-btn {
  min-width: 220px;
}

.analyze-btn-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.analyze-btn-row .hint {
  margin: 0;
}

/* ---------- Skjemafelter ---------- */

.review-grid input,
.review-grid select,
.fee-row input,
.fee-row select,
.renate-chat-form input {
  min-height: 44px;
  border-radius: 10px;
  transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}

.review-grid input:hover,
.review-grid select:hover,
.fee-row input:hover,
.fee-row select:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--gridline));
}

.review-grid input:focus,
.review-grid select:focus,
.fee-row input:focus,
.fee-row select:focus,
.renate-chat-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

.review-grid label {
  font-weight: 500;
}

/* Et felt som mangler i kontrakten markeres også med tekst, ikke bare farge
   (når det ikke allerede står en egen forklaring under feltet). */
.review-grid label:has(input.field-missing, select.field-missing):not(:has(.field-note:not([hidden])))::after {
  content: "Ikke funnet i kontrakten, sjekk tallet";
  font-size: 0.78rem;
  color: var(--status-warning-border);
}

/* ---------- Slides: stegindikator og overganger ---------- */

.slide-title {
  margin: 0;
  outline: none;
}

.slide-dots {
  gap: 0.35rem;
}

.slide-dot {
  appearance: none;
  position: relative;
  width: 10px;
  height: 10px;
  padding: 0;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition:
    width var(--dur-med) var(--ease-out),
    background-color var(--dur-med) ease;
}

/* Større klikkflate enn selve prikken. */
.slide-dot::before {
  content: "";
  position: absolute;
  inset: -10px -4px;
}

.slide-dot.is-active {
  width: 28px;
  transform: none;
}

.slide-dot:disabled {
  cursor: default;
  opacity: 0.55;
}

.slide-dot:not(:disabled):not(.is-active):hover {
  background: color-mix(in srgb, var(--accent) 70%, var(--gridline));
}

.slide-enter-forward {
  animation: slide-in-forward var(--dur-med) var(--ease-out);
}

.slide-enter-back {
  animation: slide-in-back var(--dur-med) var(--ease-out);
}

@keyframes slide-in-forward {
  from { opacity: 0; transform: translateX(18px); }
  to { opacity: 1; transform: none; }
}

@keyframes slide-in-back {
  from { opacity: 0; transform: translateX(-18px); }
  to { opacity: 1; transform: none; }
}

.slide-nav #slide-done-btn {
  margin-left: auto;
}

/* ---------- Tabeller ---------- */

.table-wrap {
  border-radius: var(--radius-md);
  scrollbar-width: thin;
}

thead th {
  background: color-mix(in srgb, var(--accent) 6%, var(--surface-1));
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
}

tbody tr:nth-child(even) td {
  background: color-mix(in srgb, var(--page-plane) 70%, var(--surface-1));
}

tbody tr:hover td {
  background: color-mix(in srgb, var(--accent) 7%, var(--surface-1));
}

tbody td {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

/* ---------- Statusmeldinger ---------- */

.status:not([hidden]) {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  line-height: 1.45;
}

.status.error {
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--status-critical) 9%, var(--surface-1));
  border: 1px solid color-mix(in srgb, var(--status-critical) 35%, transparent);
  animation: item-in var(--dur-med) var(--ease-out);
}

.status.success {
  color: var(--status-success);
  font-weight: 600;
}

.status.loading::before {
  content: "";
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid var(--accent);
  border-right-color: transparent;
  animation: spin 0.8s linear infinite;
}

/* ---------- Lasteskjerm ---------- */

.loading-overlay {
  background: rgba(6, 15, 10, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fade-in var(--dur-med) ease;
}

.loading-cancel {
  margin-top: 1.4rem;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---------- Modaler ---------- */

.modal-backdrop {
  background: rgba(6, 15, 10, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-backdrop:not([hidden]) {
  animation: fade-in var(--dur-fast) ease;
}

.modal {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-overlay);
  animation: modal-in var(--dur-med) var(--ease-out);
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

/* ---------- Historikkpanel ---------- */

.history-panel {
  transition: transform var(--dur-med) var(--ease-out);
}

body.history-open::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(6, 15, 10, 0.35);
  animation: fade-in var(--dur-fast) ease;
}

/* ---------- Chat ---------- */

.renate-chat-toggle {
  transition: transform var(--dur-med) var(--ease-spring), box-shadow var(--dur-med) ease;
  animation: pop-in 420ms var(--ease-spring) both;
}

.renate-chat-toggle:hover {
  transform: scale(1.08) rotate(-3deg);
  box-shadow: var(--shadow-lg);
}

@keyframes pop-in {
  from { opacity: 0; transform: scale(0.6); }
  to { opacity: 1; transform: none; }
}

.renate-chat-panel:not([hidden]) {
  transform-origin: bottom right;
  animation: modal-in var(--dur-med) var(--ease-out);
  box-shadow: var(--shadow-overlay);
  border-radius: var(--radius-lg);
}

.chat-msg {
  animation: item-in var(--dur-med) var(--ease-out);
}

/* Sørg for at chat-knappen ikke dekker footer-lenkene. */
body:has(.renate-chat-toggle:not([hidden])) .app-footer {
  padding-bottom: 6.5rem;
}

/* ---------- Footer ---------- */

.footer-copy {
  margin: 1.5rem 0 0;
  text-align: center;
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* ---------- Reksamen ---------- */

.exam-option {
  transition:
    transform var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) ease,
    background-color var(--dur-fast) ease;
}

.exam-option:hover:not([aria-disabled="true"]) {
  transform: translateX(3px);
}

.exam-option[aria-disabled="true"] {
  cursor: default;
}

.exam-option.correct,
.exam-option.wrong {
  animation: item-in var(--dur-med) var(--ease-out);
}

.exam-option.correct::after {
  content: " \2713";
  font-weight: 700;
}

.exam-option.wrong::after {
  content: " \2715";
  font-weight: 700;
}

.exam-feedback {
  min-height: 1.4em;
  margin: 0.25rem 0 0.75rem;
  font-weight: 600;
  font-size: 0.92rem;
}

.exam-feedback.is-correct {
  color: var(--status-success);
}

.exam-feedback.is-wrong {
  color: var(--status-critical);
}

.exam-progress-fill {
  transition: width var(--dur-med) var(--ease-out);
}

.exam-question {
  outline: none;
}

/* ---------- Feilside ---------- */

.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ---------- Mobil og nettbrett ---------- */

@media (max-width: 900px) {
  .hero {
    min-height: 420px;
  }
}

@media (max-width: 560px) {
  .hero {
    min-height: 0;
  }

  .hero--compact {
    min-height: 0;
  }

  .hero-content {
    padding-top: 1.25rem;
    padding-bottom: 3.25rem;
  }

  .hero-cta-row {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .hero-trust {
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
  }

  .navbar {
    padding: 0.9rem 1rem;
  }

  .nav-actions {
    flex-wrap: nowrap;
    gap: 0.4rem;
  }

  .nav-actions .btn {
    flex: 1 1 auto;
    min-height: 40px;
    padding: 0.4rem 0.7rem;
    font-size: 0.86rem;
    white-space: nowrap;
  }

  .slide-nav #slide-done-btn {
    margin-left: 0;
  }

  .dropzone {
    min-height: 150px;
  }

  #analyze-btn {
    width: 100%;
  }

  .analyze-btn-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ---------- Redusert bevegelse: slå av all dekorativ animasjon ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .hero-content > *,
  .slide-enter-forward,
  .slide-enter-back,
  .file-item,
  .chat-msg,
  .modal,
  .modal-backdrop,
  .renate-chat-toggle,
  .renate-chat-panel,
  .status.error,
  .exam-option.correct,
  .exam-option.wrong,
  .history-panel-tab {
    animation: none !important;
  }

  .btn:hover:not(:disabled),
  .pricing-card:hover,
  .lender-card:hover,
  .contact-card:hover {
    transform: none;
  }
}

/* Når analyseresultatet vises, skal hero-videoen/-teksten være borte uten å
   etterlate det store tomrommet .hero sin egen min-height ellers krever --
   navigasjonen går da tilbake til normal (ikke-absolutt) plassering, slik at
   .hero kun blir så høy som selve navbaren, i stedet for full hero-høyde. */
.hero--collapsed {
  min-height: 0;
}

.hero--collapsed .navbar {
  position: relative;
  top: auto;
  left: auto;
  right: auto;
}

.hero--collapsed .navbar .brand {
  visibility: visible;
}
