/* Thanks. Bygget på skitsen til TH001 (docs/skitse/th001.html), godkendt 28.11.2026.
   Sidebjælke på stor skærm, faner i bunden på telefon (TH025). Sedlen skalerer med sin egen bredde (cqi),
   så teksten ombrydes ens på alle skærme (fase 1, Afklaringer, punkt 5). Lys og mørk følger systemet. */
:root {
  --page: #F4F4F6; --chrome: #EBEBEF; --raise: #FFFFFF; --ink: #1C1C1E; --sub: #6C6C70; --hair: rgba(60,60,67,.18);
  --note: #FFF1A6; --note2: #FDE993; --note3: #F9E07F; --note-ink: #2B2615; --rule: rgba(122,96,20,.22); --num: #7A5F14;
  --shadow: rgba(0,0,0,.10); --btn: #1C1C1E; --btn-ink: #FFFFFF; --sel: #FFE9A3; --accent: #8A5A00; --accent-soft: rgba(138,90,0,.12);
  --focus: rgba(138,90,0,.10); --warn: #B3261E; --scrim: rgba(0,0,0,.38);
  --font: -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #111113; --chrome: #1A1A1D; --raise: #1F1F22; --ink: #F2F2F7; --sub: #9A9AA0; --hair: rgba(84,84,88,.6);
    --note: #3A3420; --note2: #322D1B; --note3: #2A2617; --note-ink: #F4EBC8; --rule: rgba(244,235,200,.16); --num: #E2C56B;
    --shadow: rgba(0,0,0,.5); --btn: #F2F2F7; --btn-ink: #111113; --sel: #4A4128; --accent: #F2C14E; --accent-soft: rgba(242,193,78,.14);
    --focus: rgba(242,193,78,.10); --warn: #FF8A80; --scrim: rgba(0,0,0,.6);
  }
}
[hidden] { display: none !important; }
body {
  margin: 0; background: var(--page); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.4;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: .6; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { text-wrap: balance; }

/* Humørikonerne (TH002): egne SVG-filer, farvet med tekstens farve */
.hik { display: inline-block; flex: none; width: 40px; height: 40px; background-color: currentColor;
  -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }
.hik-straalende { -webkit-mask-image: url(ikoner/straalende.svg); mask-image: url(ikoner/straalende.svg); }
.hik-glad { -webkit-mask-image: url(ikoner/glad.svg); mask-image: url(ikoner/glad.svg); }
.hik-rolig { -webkit-mask-image: url(ikoner/rolig.svg); mask-image: url(ikoner/rolig.svg); }
.hik-traet { -webkit-mask-image: url(ikoner/traet.svg); mask-image: url(ikoner/traet.svg); }
.hik-trist { -webkit-mask-image: url(ikoner/trist.svg); mask-image: url(ikoner/trist.svg); }
.hik.s26 { width: 26px; height: 26px; }
.hik.s28 { width: 28px; height: 28px; }

/* Start og login */
.start { max-width: 400px; margin: 0 auto; padding: calc(56px + env(safe-area-inset-top, 0px)) 0 48px; display: flex; flex-direction: column; gap: 14px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 10px; color: var(--accent); }
.brand .hik { width: 26px; height: 26px; }
.brand span:last-child { font-size: 20px; font-weight: 700; letter-spacing: -0.2px; color: var(--ink); }
.brand.stor { padding: 0; }
.brand.stor .hik { width: 34px; height: 34px; }
.brand.stor span:last-child { font-size: 26px; }
.startbesked:empty, .loginbesked:empty { display: none; }
.startbesked, .loginbesked { margin: 0; color: var(--sub); }
.login { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.login h1 { margin: 0; }
.login .under { margin: 0 0 8px; }
.login .label { margin: 6px 0 0; }
.felt { box-sizing: border-box; height: 44px; padding: 0 12px; border: 1px solid var(--hair); border-radius: 10px; background: var(--raise); color: var(--ink); font: inherit; font-size: 16px; }
.login .gem { flex: none; margin-top: 6px; }

.app { display: flex; gap: clamp(24px, 4vw, 56px); align-items: flex-start; }
.side { display: none; position: sticky; top: calc(16px + env(safe-area-inset-top, 0px)); flex: none; width: 212px; box-sizing: border-box; margin-block: 16px; padding: 22px 12px 14px; flex-direction: column; gap: 20px; border-radius: 14px; background: var(--chrome); }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a, .side nav .off { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: 8px; font-size: 15px; }
.side nav a[aria-current="page"] { background: var(--accent-soft); font-weight: 600; }
.side nav a svg { color: var(--sub); }
.side nav a[aria-current="page"] svg { color: var(--accent); }
.side .off { color: var(--sub); border: 0; background: none; width: 100%; text-align: left; }
.fase { margin-left: auto; padding: 1px 7px; border-radius: 9px; background: var(--sel); font-size: 11px; font-weight: 600; color: var(--num); }
.sidebund { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-top: 8px; }
.eksport { height: 34px; padding: 0 12px; border: 1px solid var(--hair); border-radius: 8px; background: var(--raise); font-size: 13px; }
.logud { border: 0; background: none; padding: 4px 12px; font-size: 13px; color: var(--sub); }

main { flex: 1; min-width: 0; padding-block: 28px 56px; }
.dato { margin: 0; font-size: 15px; font-weight: 500; color: var(--sub); }
h1 { margin: 2px 0 0; font-size: 34px; line-height: 41px; font-weight: 700; letter-spacing: -0.4px; }
.under { margin: 8px 0 0; font-size: 15px; color: var(--sub); }

.aften { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 40px 56px; align-items: flex-start; }
.skriv { flex: 1 1 320px; max-width: 440px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.seneste { display: none; flex: 1 1 300px; max-width: 520px; min-width: 0; }
.seneste .hd { display: flex; justify-content: space-between; align-items: baseline; }
.seneste h2 { margin: 0; font-size: 20px; font-weight: 700; }
.seneste .hd a { font-size: 14px; font-weight: 500; color: var(--accent); }
.seneste .liste { display: flex; flex-direction: column; gap: 18px; margin-top: 14px; }

/* Sedlen. Alle mål er brøkdele af sedlens bredde: 9 linjer, skrift og luft skalerer sammen. */
.note { container-type: inline-size; width: 100%; max-width: 440px; }
.paper { position: relative; box-sizing: border-box; aspect-ratio: 1; padding: 7cqi 6.4cqi 0; border-radius: 6px; background: var(--note); color: var(--note-ink); box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 10px 28px var(--shadow); }
/* Linjerne tegnes med tekstens egen linjehøjde (lh), så de følger med, hvis enheden gør skriften større. Den første værdi er til browsere uden lh. */
.lines { --L: 9.36cqi; height: calc(var(--L) * 9); height: 9lh; font-size: 4.7cqi; line-height: var(--L);
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--L) - 1px), var(--rule) calc(var(--L) - 1px), var(--rule) var(--L));
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(1lh - 1px), var(--rule) calc(1lh - 1px), var(--rule) 1lh); }
.item { display: flex; gap: 2.9cqi; border-radius: 3px; }
.item:focus-within { background: var(--focus); }
.num { flex: none; width: 4.7cqi; font-weight: 600; color: var(--num); }
.lines textarea { flex: 1; min-width: 0; display: block; margin: 0; padding: 0; border: 0; outline: none; background: transparent; color: inherit; font: inherit; line-height: inherit; resize: none; overflow: hidden; height: var(--L); white-space: pre-wrap; overflow-wrap: break-word; }
.lines textarea::placeholder { color: var(--num); opacity: .55; }
.count { position: absolute; right: 5cqi; bottom: 2.6cqi; font-size: 3.4cqi; color: var(--num); font-variant-numeric: tabular-nums; }
.count.fuld { color: var(--warn); font-weight: 600; }
.paper.blink { animation: ryst .28s ease-in-out; }
@keyframes ryst { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@media (prefers-reduced-motion: reduce) { .paper.blink { animation: none; } }
/* En gemt seddel, der læses: vokser, hvis en anden skrift giver flere linjer */
.paper.laes { aspect-ratio: auto; min-height: 100cqi; padding-bottom: 6cqi; }
.paper.laes .lines { height: auto; min-height: calc(var(--L) * 9); min-height: 9lh; }
.lines .txt { flex: 1; min-width: 0; margin: 0; white-space: pre-wrap; overflow-wrap: break-word; }

.label { margin: 0 0 8px; font-size: 13px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; color: var(--sub); }
.label small { font-weight: 500; letter-spacing: 0; text-transform: none; }
.humoer { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.humoer button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 0 6px; border: 0; border-radius: 14px; background: transparent; }
.humoer button span:last-child { font-size: 12px; color: var(--sub); }
.humoer button[aria-pressed="true"] { background: var(--sel); }
.humoer button[aria-pressed="true"] span:last-child { color: var(--ink); font-weight: 600; }
.gemrk { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.gem { flex: 1 1 auto; height: 50px; padding: 0 22px; border: 0; border-radius: 14px; background: var(--btn); color: var(--btn-ink); font-size: 17px; font-weight: 600; }
.genvej { display: none; font-size: 13px; color: var(--sub); }
.ekstra { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-top: -8px; }
.link { border: 0; background: none; padding: 4px 0; font-size: 14px; font-weight: 500; color: var(--accent); }
.link.fare { color: var(--warn); margin-left: auto; }
.aftenvalg { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--sub); }
.aftenvalg .felt { height: 36px; font-size: 15px; }
.bekraeft { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--raise); box-shadow: 0 1px 3px var(--shadow); }
.bekraeft p { margin: 0 auto 0 0; font-weight: 600; }
.fareknap { height: 36px; padding: 0 16px; border: 0; border-radius: 9px; background: var(--warn); color: #fff; font-weight: 600; }
.sek { height: 36px; padding: 0 16px; border: 0; border-radius: 9px; background: var(--chrome); font-weight: 600; }

/* Stakken */
.segment { margin-top: 16px; display: inline-grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; width: min(100%, 330px); padding: 2px; box-sizing: border-box; border-radius: 9px; background: var(--chrome); }
.segment button { height: 28px; border: 0; border-radius: 7px; background: transparent; font-size: 13px; font-weight: 500; }
.segment button[aria-pressed="true"] { background: var(--raise); font-weight: 600; box-shadow: 0 1px 3px var(--shadow); }
.stakhoved { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.telefonknapper { display: none; gap: 6px; }
.telefonknapper .eksport { margin: 0; }
.gruppe { margin-top: 26px; }
.gruppe .aar { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; color: var(--sub); }
.gruppe h2 { margin: 2px 0 0; font-size: 22px; line-height: 28px; font-weight: 700; }
.gitter { margin-top: 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 20px 28px; }
.stakwrap .shd { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.stakwrap h3 { margin: 0; font-size: 15px; font-weight: 600; }
.stakwrap .shd span { font-size: 13px; color: var(--sub); white-space: nowrap; }
.stak { position: relative; display: block; width: 100%; height: 196px; padding: 0; border: 0; background: none; text-align: left; }
.stak .b1, .stak .b2 { position: absolute; top: 0; height: 172px; border-radius: 6px; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.stak .b1 { left: 16px; right: 8px; background: var(--note3); transform: rotate(2.2deg); }
.stak .b2 { left: 6px; right: 16px; top: 6px; background: var(--note2); transform: rotate(-1.7deg); }
.stak .top { position: absolute; left: 0; right: 0; top: 16px; height: 172px; box-sizing: border-box; padding: 12px 18px 0; border-radius: 6px; background: var(--note); color: var(--note-ink); box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 8px 22px var(--shadow); display: block; overflow: hidden; }
.stak:hover .top { transform: translateY(-2px); }
.stak .shead { display: flex; justify-content: space-between; align-items: center; height: 28px; }
.stak .dag { font-size: 13px; font-weight: 600; color: var(--num); }
.stak .rl { display: block; margin-top: 4px; font-size: 15px; line-height: 36px; background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 35px, var(--rule) 35px, var(--rule) 36px); background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(1lh - 1px), var(--rule) calc(1lh - 1px), var(--rule) 1lh); }
.stak .ln { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stak .ln b { color: var(--num); font-weight: 600; }
.tom { margin-top: 24px; color: var(--sub); }

/* Telefonens faner */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; justify-content: space-around; padding: 8px max(16px, env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); background: var(--chrome); border-top: .5px solid var(--hair); }
.tabs a, .tabs button { width: 96px; display: flex; flex-direction: column; align-items: center; gap: 3px; border: 0; background: none; padding: 0; font-size: 11px; font-weight: 500; color: var(--sub); }
.tabs a[aria-current="page"] { color: var(--accent); font-weight: 600; }
.tabs .off { opacity: .45; }

/* Åbnet stak og eksporten */
.ov { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-start; justify-content: center; overflow: auto; background: var(--scrim);
  padding: calc(24px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.panel { width: 100%; max-width: 1000px; box-sizing: border-box; padding: 20px clamp(16px, 3vw, 28px) 28px; border-radius: 16px; background: var(--raise); box-shadow: 0 20px 60px var(--shadow); }
.panel.smal { max-width: 460px; }
.panel .phd { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.panel h2 { margin: 0; font-size: 22px; line-height: 28px; }
.panel .phd p { margin: 2px 0 0; color: var(--sub); font-size: 14px; }
.luk { flex: none; height: 34px; padding: 0 14px; border: 0; border-radius: 9px; background: var(--chrome); font-size: 14px; font-weight: 600; }
.noter { margin-top: 20px; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 28px; }
.laeshd { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 30px; margin-bottom: 8px; font-size: 14px; font-weight: 600; }
.laeshd .h { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; color: var(--sub); margin-left: auto; }
.laeshd .link { font-size: 14px; }
.forkl { max-width: 62ch; color: var(--sub); font-size: 14px; }
.eksportvalg { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.eksportvalg .gem { flex: 1 1 180px; height: 44px; font-size: 15px; border-radius: 12px; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(96px + env(safe-area-inset-bottom, 0px)); z-index: 30; max-width: min(90vw, 420px); padding: 10px 16px; border-radius: 12px; background: var(--btn); color: var(--btn-ink); font-size: 14px; box-shadow: 0 8px 24px var(--shadow); }

@media (min-width: 760px) {
  .side { display: flex; }
  .tabs { display: none; }
  .toast { bottom: calc(28px + env(safe-area-inset-bottom, 0px)); }
  .genvej { display: inline; }
  .gem { flex: 0 0 auto; height: 44px; font-size: 15px; border-radius: 12px; }
  .seneste { display: block; }
}
@media (max-width: 759.98px) {
  main { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
  .telefonknapper { display: inline-flex; }
}
