/* KLARHED – forløbet på addmind.dk. Bygger videre på ../assets/css/style.css */

.kh { --lime: #C6E35A; --amber-soft: #FFF4DC; --shadow: 0 14px 36px rgba(1, 29, 65, .08); }
.kh main { min-height: 60vh; outline: none; }
.kh-loading { padding: 120px 24px; color: var(--muted); }
[hidden] { display: none !important; }

/* Gemmestatus */
.kh-savebar {
  position: fixed; right: 16px; bottom: 16px; z-index: 60;
  background: var(--navy); color: var(--white); border-radius: 999px;
  padding: 8px 16px; font-size: .88rem; font-weight: 500;
  box-shadow: var(--shadow); opacity: 0; transform: translateY(8px); pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.kh-savebar.show { opacity: 1; transform: none; }
.kh-savebar.err { background: #9A2B1B; pointer-events: auto; cursor: pointer; }

/* Fælles */
.kh-section { padding: 64px 0 96px; }
.kh-narrow { max-width: 760px; }
.kh-lead { font-size: 1.2rem; color: var(--muted); max-width: 36em; }
.kh-muted { color: var(--muted); }
.kh-small { font-size: .92rem; }
.kh-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; align-items: center; }
.kh-link { background: none; border: 0; padding: 0; font: inherit; color: var(--teal-dark); text-decoration: underline; cursor: pointer; }
.kh-box { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; }
.kh-box + .kh-box { margin-top: 24px; }
.kh-box h2, .kh-box h3 { margin-top: 0; }
.kh-dark { background: var(--navy); color: #C9D3E0; border-color: var(--navy); }
.kh-dark h2, .kh-dark h3 { color: var(--white); }
.kh-dark .eyebrow { color: #7CC4C1; }
@media (max-width: 600px) { .kh-section { padding: 36px 0 72px; } .kh-box { padding: 24px 20px; } }

/* Bogstavrækken */
.kh-letters { display: flex; gap: 8px; flex-wrap: wrap; margin: 28px 0 8px; }
.kh-letters span {
  width: 56px; height: 64px; display: grid; place-items: center;
  background: var(--white); border: 1px solid var(--line); border-radius: 12px;
  font-size: 1.9rem; font-weight: 700; color: var(--teal);
}
.kh-letters span small { display: none; }
@media (max-width: 600px) { .kh-letters span { width: 40px; height: 48px; font-size: 1.4rem; } }

/* Landingsside */
.kh-hero { padding: 64px 0 72px; }
.kh-hero .wrap { display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; }
.kh-hero h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); letter-spacing: .04em; margin-bottom: .2em; }
.kh-hero h1 + p.kh-sub { font-size: 1.35rem; font-weight: 600; color: var(--teal-dark); margin-bottom: 1em; }
.kh-hero-card { background: var(--navy); color: #C9D3E0; border-radius: 200px 200px var(--radius) var(--radius); padding: 96px 48px 40px; }
.kh-hero-card blockquote { margin: 0; font-size: 1.45rem; line-height: 1.3; color: var(--white); font-weight: 600; }
.kh-hero-card cite { display: block; margin-top: 18px; font-style: normal; color: #7CC4C1; font-size: .95rem; }
.kh-model { display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; }
.kh-model div { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 14px; }
.kh-model b { display: block; font-size: 2rem; color: var(--teal); line-height: 1; margin-bottom: 8px; }
.kh-model strong { display: block; font-size: 1rem; margin-bottom: 6px; }
.kh-model p { font-size: .86rem; color: var(--muted); margin: 0; line-height: 1.45; }
.kh-split { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 1000px) { .kh-model { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 900px) { .kh-hero .wrap, .kh-split { grid-template-columns: 1fr; gap: 32px; } .kh-hero { padding: 32px 0 56px; } }
@media (max-width: 600px) { .kh-model { grid-template-columns: 1fr 1fr; } }

/* Måling */
.kh-steps { display: flex; gap: 6px; margin: 0 0 28px; }
.kh-steps i { flex: 1; height: 6px; border-radius: 6px; background: var(--line); }
.kh-steps i.on { background: var(--teal); }
.kh-q { padding: 22px 0; border-top: 1px solid var(--line); }
.kh-q:first-of-type { border-top: 0; }
.kh-q p { font-weight: 500; font-size: 1.1rem; margin-bottom: 14px; }
.kh-scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.kh-scale button {
  font: inherit; font-weight: 600; font-size: 1.1rem; padding: 12px 0;
  border: 2px solid var(--line); background: var(--white); color: var(--navy); border-radius: 12px; cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.kh-scale button:hover { border-color: var(--teal); }
.kh-scale button[aria-pressed="true"] { background: var(--teal); border-color: var(--teal); color: var(--white); }
.kh-scale-legend { display: flex; justify-content: space-between; font-size: .82rem; color: var(--muted); margin-top: 6px; }
.kh-group-head { display: flex; align-items: center; gap: 18px; margin-bottom: 8px; }
.kh-group-head b { font-size: 3.2rem; line-height: 1; color: var(--teal); }

/* Profil og søjler */
.kh-bars { display: grid; gap: 14px; }
.kh-bar { display: grid; grid-template-columns: 34px 110px 1fr 64px; gap: 14px; align-items: center; }
.kh-bar b { font-size: 1.5rem; color: var(--teal); }
.kh-bar span { font-weight: 500; }
.kh-bar .track { position: relative; height: 14px; background: var(--teal-soft); border-radius: 999px; overflow: hidden; }
.kh-bar .fill { position: absolute; inset: 0 auto 0 0; background: var(--teal); border-radius: 999px; transition: width .5s ease; }
.kh-bar .fill.before { background: #9FB3C6; height: 6px; bottom: auto; }
.kh-bar em { font-style: normal; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.kh-bar.low .fill { background: #D98E2B; }
@media (max-width: 600px) { .kh-bar { grid-template-columns: 26px 1fr 52px; } .kh-bar span { display: none; } }
.kh-insight { border-left: 4px solid var(--teal); padding: 4px 0 4px 18px; margin: 18px 0; }
.kh-insight.warm { border-color: #D98E2B; }
.kh-insight h3 { margin-bottom: .3em; }
.kh-insight p { color: var(--muted); margin: 0; }

/* Dashboard */
.kh-dash-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; align-items: flex-end; margin-bottom: 32px; }
.kh-progress { height: 10px; background: var(--teal-soft); border-radius: 999px; overflow: hidden; min-width: 220px; }
.kh-progress div { height: 100%; background: var(--teal); transition: width .4s; }
.kh-continue { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between; }
.kh-units { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-top: 16px; }
.kh-unit {
  display: flex; gap: 18px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.kh-unit:hover { border-color: var(--teal); box-shadow: var(--shadow); transform: translateY(-2px); }
.kh-unit .ltr { flex: 0 0 56px; font-size: 2.6rem; font-weight: 700; line-height: 1; color: var(--teal); }
.kh-unit.case .ltr, .kh-unit.interlude .ltr, .kh-unit.intro .ltr { font-size: 1.5rem; padding-top: 8px; }
.kh-unit h3 { margin: 0 0 4px; font-size: 1.15rem; }
.kh-unit p { margin: 0 0 10px; font-size: .9rem; color: var(--muted); line-height: 1.45; }
.kh-unit .meta { display: flex; gap: 10px; align-items: center; font-size: .82rem; color: var(--muted); }
.kh-unit .meta .kh-progress { min-width: 0; flex: 1; height: 6px; }
.kh-unit.done { border-color: var(--teal); background: linear-gradient(180deg, var(--white), var(--teal-soft)); }
.kh-unit.case { background: var(--paper); border-style: dashed; }
.kh-tag { display: inline-block; font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--teal-dark); background: var(--teal-soft); border-radius: 999px; padding: 3px 10px; }
.kh-toggle { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.kh-toggle input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--teal); flex: none; }

/* Lektionsvisning */
.kh-lesson-wrap { display: grid; grid-template-columns: 260px 1fr; gap: 48px; padding-top: 40px; padding-bottom: 96px; }
.kh-outline { position: sticky; top: 100px; align-self: start; }
.kh-outline a.back { display: inline-block; margin-bottom: 16px; color: var(--muted); text-decoration: none; font-size: .92rem; }
.kh-outline a.back:hover { color: var(--teal); }
.kh-outline .head { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.kh-outline .head b { font-size: 2.2rem; color: var(--teal); line-height: 1; }
.kh-outline .head strong { font-size: 1.1rem; line-height: 1.2; }
.kh-outline ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.kh-outline li a {
  display: flex; gap: 10px; padding: 8px 10px; border-radius: 10px; text-decoration: none;
  color: var(--muted); font-size: .92rem; line-height: 1.35;
}
.kh-outline li a:hover { background: var(--white); color: var(--navy); }
.kh-outline li a.cur { background: var(--white); color: var(--navy); font-weight: 600; box-shadow: inset 3px 0 0 var(--teal); }
.kh-outline li a i { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); margin-top: 1px; font-style: normal; }
.kh-outline li a.ok i { background: var(--teal); border-color: var(--teal); position: relative; }
.kh-outline li a.ok i::after { content: ""; position: absolute; left: 4px; top: 1px; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.kh-lesson { max-width: 740px; min-width: 0; }
.kh-lesson .kind { margin-bottom: .8em; }
.kh-lesson h1 { font-size: clamp(1.8rem, 3.6vw, 2.5rem); }
.kh-lesson .prose p { font-size: 1.12rem; line-height: 1.75; }
.kh-pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); flex-wrap: wrap; }
@media (max-width: 900px) {
  .kh-lesson-wrap { grid-template-columns: 1fr; gap: 0; padding-top: 20px; }
  .kh-lesson-wrap > * { min-width: 0; }
  .kh-outline { position: static; }
  .kh-outline ol { display: none; }
  .kh-outline.open ol { display: grid; margin-bottom: 24px; }
  .kh-outline .head { margin-bottom: 20px; }
}
.kh-outline-toggle { display: none; }
@media (max-width: 900px) { .kh-outline-toggle { display: inline-flex; margin: -8px 0 20px; } }

/* Lektionstyper */
.kh-story { background: var(--white); border-radius: var(--radius); padding: 36px 40px; border: 1px solid var(--line); position: relative; }
.kh-story p { font-size: 1.15rem; line-height: 1.8; }
.kh-story p:last-child { margin-bottom: 0; }
.kh-quote { margin: 0; padding: 48px 0; }
.kh-quote p { font-size: clamp(1.6rem, 3.4vw, 2.3rem); line-height: 1.25; font-weight: 600; color: var(--navy); }
.kh-quote p::before { content: "“"; color: var(--teal); }
.kh-quote p::after { content: "”"; color: var(--teal); }
.kh-quote cite { font-style: normal; color: var(--muted); }
.kh-callout { background: var(--navy); color: var(--white); border-radius: var(--radius); padding: 36px 40px; font-size: 1.35rem; line-height: 1.4; font-weight: 600; }
.kh-case { background: var(--paper); border: 1px dashed #9FB3C6; border-radius: var(--radius); padding: 32px 36px; }
.kh-case .who { font-size: .78rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--teal); margin-bottom: 6px; }
.kh-case h2 { font-size: 1.5rem; margin-bottom: .2em; }
.kh-case .sub { color: var(--muted); margin-bottom: 1.2em; }
.kh-theory { background: var(--teal-soft); border-radius: var(--radius); padding: 28px 32px; }
.kh-theory p:last-child { margin: 0; }
@media (max-width: 600px) { .kh-story, .kh-callout, .kh-case { padding: 24px 20px; } .kh-theory { padding: 22px 20px; } }

.kh-field { margin: 0 0 26px; }
.kh-field label { display: block; font-weight: 600; margin-bottom: 8px; line-height: 1.4; }
.kh-field textarea, .kh-field input[type=text], .kh-field input[type=date] {
  width: 100%; font: inherit; font-size: 1.02rem; line-height: 1.6; color: var(--navy);
  background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
  resize: vertical; min-height: 56px;
}
.kh-field textarea { min-height: 96px; overflow: hidden; }
.kh-field textarea:focus, .kh-field input:focus { outline: 2px solid var(--teal); outline-offset: 1px; border-color: var(--teal); }
.kh-twocol { display: grid; grid-template-columns: 140px 1fr 1fr; gap: 10px 12px; align-items: start; }
.kh-twocol .h { font-weight: 600; font-size: .9rem; color: var(--teal-dark); text-transform: uppercase; letter-spacing: .08em; }
.kh-twocol .r { font-weight: 600; padding-top: 14px; font-size: .95rem; }
.kh-twocol textarea { min-height: 72px; }
@media (max-width: 700px) { .kh-twocol { grid-template-columns: 1fr 1fr; } .kh-twocol .r { grid-column: 1 / -1; padding-top: 10px; } .kh-twocol .h.blank { display: none; } }
.kh-dialogue { counter-reset: d; list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.kh-dialogue li { counter-increment: d; display: grid; grid-template-columns: 40px 1fr; gap: 14px; background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.kh-dialogue li::before { content: counter(d); width: 32px; height: 32px; border-radius: 50%; background: var(--teal); color: var(--white); display: grid; place-items: center; font-weight: 700; }
.kh-dialogue strong { display: block; }
.kh-dialogue .min { color: var(--muted); font-size: .85rem; font-weight: 500; margin-left: 6px; }
.kh-pillars { display: grid; gap: 16px; }
.kh-pillar { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.kh-pillar h3 { display: flex; gap: 12px; align-items: baseline; }
.kh-pillar h3 b { color: var(--teal); }
.kh-selfeval .kh-q p { font-size: 1.02rem; }
.kh-sum { display: flex; justify-content: space-between; align-items: center; background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; margin-top: 16px; font-weight: 600; }
.kh-refs { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 26px; margin-bottom: 28px; }
.kh-refs .item { padding: 10px 0; border-top: 1px solid var(--line); }
.kh-refs .item:first-of-type { border-top: 0; }
.kh-refs .q { font-size: .88rem; color: var(--muted); margin: 0 0 2px; }
.kh-refs .a { margin: 0; font-style: italic; white-space: pre-wrap; }
.kh-days { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.kh-days button { font: inherit; font-weight: 600; border: 2px solid var(--line); background: var(--white); border-radius: 999px; padding: 6px 14px; cursor: pointer; color: var(--navy); }
.kh-days button.has { border-color: var(--teal); }
.kh-days button[aria-pressed="true"] { background: var(--teal); color: var(--white); border-color: var(--teal); }
.kh-pace { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.kh-pace button { text-align: left; font: inherit; color: inherit; background: var(--white); border: 2px solid var(--line); border-radius: var(--radius); padding: 24px; cursor: pointer; }
.kh-pace button[aria-pressed="true"] { border-color: var(--teal); background: var(--teal-soft); }
.kh-pace strong { display: block; font-size: 1.3rem; margin-bottom: 6px; }
.kh-pace span { color: var(--muted); font-size: .95rem; }
@media (max-width: 700px) { .kh-pace { grid-template-columns: 1fr; } }
.kh-letter { background: var(--white); border-radius: var(--radius); padding: 48px; border: 1px solid var(--line); }
.kh-letter p { font-size: 1.15rem; line-height: 1.8; }
.kh-letter p:last-child { white-space: pre-line; font-weight: 600; }
@media (max-width: 600px) { .kh-letter { padding: 28px 22px; } }
.kh-cta { margin-top: 40px; }

/* Tabeller i admin */
.kh-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.kh-table th, .kh-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.kh-table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.kh-table-wrap { overflow-x: auto; }
.kh-inline-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin: 12px 0 20px; }
.kh-inline-form input { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
.kh-code { font-family: ui-monospace, Menlo, monospace; font-weight: 600; }

/* Udskrift: Mit KLARHED-dokument */
.kh-doc h2 { margin-top: 1.6em; padding-top: .8em; border-top: 2px solid var(--navy); }
.kh-doc h3 { font-size: 1rem; margin: 1.2em 0 .2em; color: var(--muted); font-weight: 600; }
.kh-doc .ans { white-space: pre-wrap; margin: 0 0 .6em; }
@media print {
  .site-header, .site-footer, .kh-savebar, .kh-noprint, .skip { display: none !important; }
  body { background: #fff; font-size: 11pt; }
  .kh-section { padding: 0; }
  .kh-box { border: 0; padding: 0; }
  .kh-doc h2 { break-after: avoid; }
  .kh-doc section { break-inside: avoid-page; }
}

/* Lille toast */
.kh-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 70;
  background: var(--white); border: 1px solid var(--line); box-shadow: var(--shadow);
  border-radius: var(--radius); padding: 16px 20px; display: flex; gap: 16px; align-items: center; max-width: calc(100% - 32px);
}
.kh-toast b { font-size: 1.6rem; color: var(--teal); }
.kh-toast p { margin: 0; color: var(--muted); font-size: .92rem; }
.kh-toast strong { display: block; }

/* Login med adgangskode og "glemt adgangskode" */
details.kh-box > summary { cursor: pointer; list-style: none; display: flex; align-items: baseline; gap: .5em; flex-wrap: wrap; }
details.kh-box > summary::-webkit-details-marker { display: none; }
details.kh-box > summary::before { content: "+"; color: var(--teal); font-weight: 700; transition: transform .2s; }
details.kh-box[open] > summary::before { transform: rotate(45deg); }
.kh-linklogin summary { color: var(--muted); }
.kh-linklogin summary strong { color: var(--navy); }
