:root {
  --nav-background: #0d1f3d;
  --nav-text: #edf4ff;
  --nav-hover: rgba(255, 255, 255, 0.12);
  --nav-focus: #ffd166;
}

* {
  box-sizing: border-box;
}

body {
  font-family: Arial, Helvetica, sans-serif;
}
body.case-page {
  margin: 0;
  color: #1d2430;
  background: #f4f7fb;
  font: 16px/1.6 Arial, Helvetica, sans-serif;
}
body.case-page header {
  padding: 22px 20px;
  color: #fff;
  background: linear-gradient(135deg, #0d1f3d, #174b9b);
}
body.case-page header > div,
body.case-page main {
  width: min(960px, calc(100% - 40px));
  margin: 0 auto;
}
body.case-page header > div {
  display: flex;
  align-items: center;
  gap: 14px;
}
body.case-page .home-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 6px;
  color: #fff;
}
body.case-page .home-link:hover {
  background: rgba(255, 255, 255, 0.15);
}
body.case-page .home-link:focus-visible {
  outline: 2px solid var(--nav-focus);
  outline-offset: 2px;
}
body.case-page .home-link svg {
  width: 26px;
  height: 26px;
  fill: currentColor;
}
body.case-page img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 10px 0;
  border: 1px solid #d8e2f0;
  border-radius: 4px;
  background: #fff;
}
body.case-page img.w80 {
  width: 80%; height: auto;
}
body.case-page img.w60 {
  width: 60%; height: auto;
}
body.case-page img.w40 {
  width: 40%; height: auto;
}
.calc-image {
  display: block;
  max-width: min(560px, 100%);
  height: auto;
  margin: 24px auto;
  border: 1px solid #d8e2f0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 2px 14px rgba(13, 31, 61, 0.18);
}
body.case-page img.key {
  display: inline-block;
  vertical-align: middle;
  margin: 2px 4px;
}
body.case-page .toc ol {
  line-height: 2;
}
body.case-page code {
  padding: 1px 5px;
  border-radius: 3px;
  background: #eaf2ff;
  font-size: 0.95em;
}
body.case-page .toplink {
  font-size: 0.85rem;
}
body.case-page .site-nav {
  width: 100%;
  margin: 0 auto 20px;
  padding: 10px 0;
  background: transparent;
}
body.case-page h1,
body.case-page h2 {
  line-height: 1.25;
}
body.case-page h1 {
  margin: 0 0 6px;
}
body.case-page .lead {
  margin: 0;
  color: #e5edff;
}
body.case-page main {
  padding: 28px 0 48px;
}
body.case-page section {
  max-width: 820px;
  padding: 0 0 20px;
  border-bottom: 1px solid #d8e2f0;
}
body.case-page section + section {
  padding-top: 16px;
}
body.case-page .table-wrap {
  overflow-x: auto;
}
body.case-page table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}
body.case-page th,
body.case-page td {
  padding: 8px 10px;
  border: 1px solid #d8e2f0;
  text-align: left;
  vertical-align: top;
}
body.case-page th {
  background: #eaf2ff;
}
body.case-page a {
  color: #0b57d0;
}
body.case-page .site-nav a {
  color: var(--nav-text);
}
@media (max-width: 620px) {
  body.case-page header > div,
  body.case-page main {
    width: min(100% - 28px, 960px);
  }
  body.case-page header {
    padding: 18px 14px;
  }
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  width: 100%;
  margin: 0 auto;
  padding: 10px max(14px, calc((100% - 1100px) / 2));
  background: var(--nav-background);
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 10px;
  border-radius: 3px;
  color: var(--nav-text);
  font-weight: 600;
  text-decoration: none;
}

.site-nav a:first-child {
  margin-right: 4px;
  padding-right: 18px;
  border-right: 1px solid rgba(237, 244, 255, 0.55);
  border-radius: 0;
}

.site-nav a:hover {
  background: var(--nav-hover);
  text-decoration: none;
}

.site-nav a:focus-visible {
  outline: 2px solid var(--nav-focus);
  outline-offset: 2px;
}

@media (max-width: 620px) {
  .site-nav {
    gap: 2px 4px;
    padding: 8px 10px;
  }

  .site-nav a {
    padding: 6px 8px;
  }
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  max-width: 820px;
  padding: 0 0 20px;
}

.card {
  display: block;
  padding: 14px 16px;
  border: 1px solid #d8e2f0;
  border-radius: 6px;
  background: #fff;
  color: #1d2430;
  text-decoration: none;
}

.card:hover {
  border-color: #0b57d0;
}

.card h2 {
  margin: 0 0 6px;
  font-size: 1.1rem;
}

.card p {
  margin: 0;
  color: #46536a;
}

.card .pin {
  display: inline-block;
  width: 15px;
  height: 15px;
  margin-right: 5px;
  vertical-align: -2px;
  fill: #0b57d0;
}

@page {
  size: A4 landscape;
  margin: 8mm;
}

/* =============================================================
   Cheat sheet: kompakt "ark" (A4-landskab, 3 søjler;
   4 søjler via body.cheat.cols-4).
   Samme layout på skærm og ved print, så man ser præcis,
   hvad der bliver printet.
   ============================================================= */

body.cheat {
  font-size: 9px;
  line-height: 1.3;
  color: #000;
  background: #dfe7f2;
}

body.cheat header {
  padding: 8px 16px;
}

/* Selve "arket": hvid baggrund i A4-landskabs bredde, centreret */
body.cheat main {
  width: min(1123px, 100%);
  max-width: none;
  margin: 14px auto 24px;
  padding: 8mm;
  background: #fff;
  box-shadow: 0 2px 14px rgba(13, 31, 61, 0.18);
  column-count: 3;
  column-gap: 6mm;
  column-rule: 1px solid #cfd8e6;
}

/* 4 søjler til indholdstunge ark (f.eks. TI-30X-lommeregneren) */
body.cheat.cols-4 main {
  column-count: 4;
  column-gap: 5mm;
}

body.cheat main h1 {
  margin: 0 0 2px;
  font-size: 18px;
  line-height: 1.2;
  column-span: all;
}

body.cheat .subtitle {
  margin: 0 0 6px;
  color: #46536a;
  font-size: 9px;
  column-span: all;
}

body.cheat .sheet-footer {
  margin: 8px 0 0;
  padding-top: 4px;
  border-top: 1px solid #d8e2f0;
  color: #46536a;
  font-size: 8px;
  column-span: all;
}

body.cheat section {
  max-width: none;
  margin: 0 0 3px;
  padding: 0 0 3px;
  border-bottom: 1px solid #d8e2f0;
  break-inside: avoid;
}
body.cheat section:last-of-type {
  border-bottom: none;
}

body.cheat h2,
body.cheat h3 {
  break-after: avoid;
}
body.cheat h2 {
  font-size: 11px;
  margin: 0 0 2px;
}
body.cheat h3 {
  font-size: 10px;
  margin: 2px 0 1px;
}
body.cheat p {
  margin: 2px 0;
}
body.cheat ul,
body.cheat ol {
  margin: 2px 0;
  padding-left: 13px;
}
body.cheat th,
body.cheat td {
  padding: 2px 4px;
  font-size: 9px;
}
body.cheat code {
  padding: 0;
  background: none;
}
body.cheat img {
  margin: 2px 0;
}
/* Tast-ikoner: brug ensartet HØJDE (ikke bredde i %), så alle taster bliver
   lige store, uanset billedets naturlige størrelse. Bredden følger automatisk
   med (width: auto) og bevarer forholdet.
   Finjustér ikonerne samlet ved at ændre "height" her. */
body.cheat img.key {
  height: 18px;
  width: auto;
  margin: 0 2px;
}

/* Finjustering af ENKELTE ikoner: sæt en størrelses-modifier på <img>.
   F.eks. <img class="key key--lg" ...>. Modifieren overskriver standardhøjden
   (18px), og bredden følger stadig automatisk (width: auto). */
body.cheat img.key--sm {
  height: 14px;
}
body.cheat img.key--lg {
  height: 26px;
}
body.cheat img.key--xl {
  height: 40px;
}
body.cheat .table-wrap {
  overflow: visible;
}

/* Reference-format elementer (jf. docs4ai/cheat-sheet-format): kodeblokke, noter, callouts */
body.cheat pre {
  margin: 2px 0 4px;
  padding: 3px 5px;
  background: #f2f5fb;
  border: 1px solid #d8e2f0;
  border-radius: 3px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 8.5px;
  line-height: 1.3;
  white-space: pre-wrap;
  break-inside: avoid;
}
body.cheat pre code {
  font-family: inherit;
  font-size: inherit;
  padding: 0;
  background: none;
}
body.cheat .note {
  font-size: 8.3px;
  color: #46536a;
}
body.cheat .important {
  margin: 2px 0;
  padding: 2px 5px;
  color: #513b00;
  background: #fff6d8;
  border-left: 3px solid #d6a600;
  break-inside: avoid;
}
body.cheat .operators {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 1px 4px;
  align-items: baseline;
  font-size: 8.5px;
}
body.cheat .operators > code {
  font-family: Consolas, "Courier New", monospace;
  font-weight: bold;
  padding: 0.5px 3px;
  color: #0b3d6b;
  background: #eaf2ff;
  border: 1px solid #b9cfe9;
  border-radius: 2px;
}
body.cheat .operators > span {
  padding: 0.5px 0;
  border-bottom: 1px solid #e5e5e5;
}

/* Skalér "arket" ned på lave skærme, så hele arket er synligt uden rulning.
   Gælder kun @media screen – print kører i fuld størrelse (se @media print). */
@media screen and (max-height: 820px) {
  body.cheat:not(.duplex) main {
    zoom: 0.86;
  }
}
@media screen and (max-height: 760px) {
  body.cheat:not(.duplex) main {
    zoom: 0.78;
  }
}

@media print {
  .site-nav {
    display: none !important;
  }
  body.cheat {
    background: #fff;
  }
  body.cheat header {
    display: none;
  }
  body.cheat main {
    width: 100%;
    margin: 0;
    padding: 0;
    box-shadow: none;
  }
  body.cheat a {
    color: #000;
    text-decoration: none;
  }
}