/* Support-skitse: kun små tilføjelser oven på Stocks base.css + app.css */
a.prim-btn, .tabs a { display: inline-flex; align-items: center; text-decoration: none; }
.tabs a { font-family: inherit; font-size: .76rem; font-weight: 500; letter-spacing: 1px; text-transform: uppercase; color: var(--ink);
  background: var(--white); border: 1px solid var(--ink); border-radius: var(--r-btn); padding: 8px 14px; white-space: nowrap; }
.tabs a:hover { background: var(--bg); }
.tabs a[aria-current="page"] { background: var(--ink); color: var(--white); }
.tabs a .tag { font-size: .86em; text-transform: none; letter-spacing: 0; font-weight: 300; opacity: .7; margin-left: 4px; }
.s-ny { color: #1d4ed8; background: rgba(59,130,246,.12); }
.s-udkast { color: var(--good); background: var(--good-tint); }
.s-kun { color: var(--bad); background: var(--bad-tint); }
.s-afventer { color: #7a5a00; background: rgba(160,120,0,.10); }
.s-loest { color: var(--muted); background: rgba(27,33,26,.07); }
table.data.app td a.rowlink { color: var(--ink); text-decoration: none; font-weight: 500; }
table.data.app td a.rowlink:hover { text-decoration: underline; }
.pair2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.mailbox { white-space: pre-wrap; font-size: .9rem; line-height: 1.55; color: var(--ink); min-height: 230px; }
.mailbox.empty { color: var(--muted); }
.card h3.ch { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; font-weight: 500; margin: 0 0 12px; }
.ph { color: #1d4ed8; background: rgba(59,130,246,.10); border-radius: 4px; padding: 0 3px; }
.real { background: rgba(19,97,46,.09); border-radius: 4px; padding: 0 3px; }
textarea.in.draft { min-height: 230px; font-family: inherit; font-size: .9rem; line-height: 1.55; width: 100%; }
.draft-ro { min-height: 230px; align-items: flex-start !important; padding-top: 10px; }
.btnrow { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; align-items: center; }
.btnrow .ab-hint { color: var(--muted); font-size: .8rem; }
.skitse-banner { background: #fff8e1; color: #7a5a00; text-align: center; font-size: .78rem; padding: 6px 12px; letter-spacing: .3px; }
@media (max-width: 760px) { .pair2 { grid-template-columns: 1fr; } }
.in.ro.preview { display: block; white-space: pre-wrap; font-weight: 300; min-height: 120px; padding-top: 10px; padding-bottom: 10px; height: auto; }
.in.ro.preview.empty { font-weight: 300; }
/* v4: løst, grupper, ventende udkast */
.s-loest { color: #2f6b3a; background: rgba(47,107,58,.10); }
table.data tr.row-loest td { opacity: .55; }
table.data tr.row-loest:hover td { opacity: .85; }
table.data tr.grp td { background: transparent; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 500; padding-top: 18px; padding-bottom: 6px; border-bottom: 1px solid rgba(27,33,26,.10); }
table.data tr.grp:first-child td { padding-top: 8px; }
table.data tr.grp .grp-hint { text-transform: none; letter-spacing: 0; font-weight: 300; margin-left: 6px; }
table.data tr.grp-loest td { color: #2f6b3a; }
.solved-note { display: inline-block; margin: 4px 0 10px; padding: 6px 12px; border-radius: 999px; background: rgba(47,107,58,.10); color: #2f6b3a; font-weight: 500; font-size: 14px; }
.solved-note[hidden] { display: none; }
.in.ro.waiting { display: block; min-height: 120px; padding-top: 10px; color: var(--muted); font-style: italic; font-weight: 300; height: auto; }
/* v5: Følsom (rolig skifer-lilla, ikke rød) */
.s-kun { color: #4e4560; background: rgba(78,69,96,.10); }
svg.lock { display: inline-block; vertical-align: -1px; margin-right: 4px; }
table.data tr.grp td svg.lock { vertical-align: 0; }
/* v5: tydelige gruppe-blokke i "Alle" */
.grp-block { --gc: var(--muted); --gt: rgba(27,33,26,.05); margin: 0 0 34px; padding: 14px 16px 16px 18px; border-left: 5px solid var(--gc); background: var(--gt); border-radius: var(--r-card); }
.grp-block.g-s-kun { --gc: #4e4560; --gt: rgba(78,69,96,.07); }
.grp-block.g-s-udkast { --gc: var(--good); --gt: rgba(19,97,46,.06); }
.grp-block.g-s-ny { --gc: #1d4ed8; --gt: rgba(59,130,246,.07); }
.grp-block.g-s-afventer { --gc: #7a5a00; --gt: rgba(160,120,0,.07); }
.grp-block.g-s-loest { --gc: #2f6b3a; --gt: rgba(47,107,58,.05); }
.grp-h { display: flex; align-items: baseline; gap: 10px; margin: 0 0 12px; font-size: 1.25rem; font-weight: 600; color: var(--gc); letter-spacing: 0; text-transform: none; }
.grp-h svg.lock { width: 15px; height: 15px; vertical-align: -1px; margin-right: 6px; }
.grp-cnt { font-size: .8rem; font-weight: 600; color: var(--gc); background: var(--white); border: 1px solid var(--gc); border-radius: 999px; padding: 1px 9px; }
.grp-h .grp-hint { font-size: .8rem; font-weight: 300; color: var(--muted); }
.grp-block .table-wrap { margin: 0; }
table.grp-table { table-layout: fixed; width: 100%; }
/* v5: rolig info-linje på ticket-siden */
.info-strip { display: flex; flex-wrap: wrap; gap: 6px 26px; padding: 10px 0 12px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: .8rem; }
.info-strip .si { display: flex; gap: 6px; align-items: baseline; white-space: nowrap; }
.info-strip .si-l { color: var(--faint); font-size: .68rem; text-transform: uppercase; letter-spacing: .8px; }
.info-strip .si-v { color: var(--text); font-weight: 400; }
.info-strip .si-v.empty { color: var(--faint); }
.details-sec h2.h-quiet { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; font-weight: 500; margin-bottom: 6px; }
/* v6: Følsom som markering + "Sådan virker listen" */
.fol-chip { margin-left: 4px; }
.tabs a.tab-fol svg.lock { margin-right: 5px; }
details.list-help { margin: 4px 0 24px; }

/* v7: tjek-felter, send-spærre, meta-linje, tråd-fold, klinikker */
.meta-line { margin: 6px 0 0; color: var(--muted); font-size: .82rem; font-weight: 300; }
.draft-wrap { position: relative; background: #fff; border-radius: 3px; }
.draft-wrap .draft-hl { position: absolute; inset: 0; pointer-events: none; white-space: pre-wrap; overflow-wrap: break-word; overflow: hidden; color: transparent; border-style: solid; border-color: transparent; box-sizing: border-box; }
.draft-wrap textarea.in.draft { position: relative; background: transparent; }
mark.chk { background: #fde68a; color: inherit; border-radius: 3px; box-shadow: 0 0 0 1px #f59e0b; }
.draft-hl mark.chk { color: transparent; }
textarea.in.draft.has-chk { border-color: #f59e0b; }
.btnrow .block-msg { background: #fef3c7; color: #92400e; border: 1px solid #f59e0b; border-radius: 3px; padding: 4px 8px; font-size: .8rem; font-weight: 500; }
.btnrow .block-msg[hidden] { display: none; }
.btnrow .btn:disabled { background: #e7e5e4 !important; color: #a8a29e !important; border-color: #d6d3d1 !important; cursor: not-allowed; }
.thread-fold { margin-top: 4px; }
.thread-fold .intro-body { padding-top: 10px; }
.klinik-card + .klinik-card { margin-top: 14px; }
.klinik-card.eks { border: 1px dashed #c9c4cc; background: #fbfafb; }
.klinik-h { margin: 0 0 10px; }
.vpill.s-eks { background: #eceaf0; color: #5b5566; }
.in.ro.rule { height: auto; min-height: 0; padding-top: 8px; padding-bottom: 8px; white-space: normal; line-height: 1.45; }
.vpill.s-stale { background: #fef3c7; color: #92400e; border: 1px solid #f3d27a; }
.in.ro.waiting.stale-w { color: #92400e; }

/* v8: tilbage til tickets */
.brand .back-btn { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 14px; text-decoration: none; }
.brand .back-btn span { font-size: 1rem; line-height: 1; }

/* v9: kundens mail er det vigtigste */
.pair2.mail-pair { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; }
.card.mail-main { background: #fff; }
.card.mail-main h3.ch { color: var(--ink); font-weight: 600; }
.card.mail-main .mailbox { font-size: 1rem; font-weight: 400; color: var(--ink); line-height: 1.6; }
.card.mail-bot { background: #eef0f3; box-shadow: none !important; border: 1px solid #e3e6ea; padding: 16px 18px; }
.card.mail-bot h3.ch { font-size: .64rem; }
.card.mail-bot .mailbox { font-size: .8rem; color: #7b8088; font-weight: 300; min-height: 0; }
.card.mail-bot .mailbox .ph { color: #4b6cb7; background: rgba(59,130,246,.08); }
.card.mail-bot .btnrow .btn { background: #fff; }
@media (max-width: 760px) { .pair2.mail-pair { grid-template-columns: 1fr; } }

/* v10: grå = botten, hvid = virkeligheden */
.bot-tag { display: inline-block; font-size: .62rem; font-weight: 600; letter-spacing: .8px; text-transform: uppercase; color: #5f6670; background: #e3e6ea; border: 1px solid #d5d9de; border-radius: 3px; padding: 1px 6px; margin-right: 8px; vertical-align: 1px; }
.draft-fld.is-bot .draft-wrap { background: #eef0f3; }
.draft-fld.is-bot textarea.in.draft { color: #6b7079; border-color: #e0e3e7; box-shadow: none; font-size: .85rem; }
.draft-fld.is-bot textarea.in.draft:focus { color: var(--ink); }
.real-fld > span { color: var(--ink); font-weight: 600; }
.real-fld .in.ro.preview { background: #fff; color: #000; font-weight: 400; font-size: .95rem; border: 1px solid #cfd3d8; border-radius: 3px; padding: 12px 14px; }
.real-fld .in.ro.preview.empty { color: var(--muted); }
.real-fld .preview .real { background: rgba(19,97,46,.12); color: #0f4d24; font-weight: 500; }

/* v11: altid synlig vej tilbage */
.backbar { background: #fff; border-top: 1px solid #eceef1; }
.backbar-inner { max-width: var(--page); margin: 0 auto; padding: 6px 32px; display: flex; align-items: center; gap: 14px; min-height: 44px; }
.backbar .back-btn { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; padding: 6px 12px; min-height: 32px; }
.backbar-t { color: var(--muted); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btnrow .back-link { color: var(--ink); font-size: .78rem; font-weight: 500; letter-spacing: 1px; text-transform: uppercase; text-decoration: none; padding: 0 6px; }
.btnrow .back-link:hover { text-decoration: underline; }
@media (max-width: 520px) { .backbar-inner { padding: 6px 14px; } }

/* v12: egen tone til tilbage-baren (varm grå) */
.backbar { background: #ebe8e3; border-top: 1px solid #ddd8d0; border-bottom: 1px solid #d3cdc4; }
.backbar .back-btn { background: var(--white); }
.backbar-t { color: #5a554e; }

/* v13: én kolonne, ens bokse (Mathias 19:44) */
.tk-col { max-width: 880px; display: flex; flex-direction: column; gap: 16px; margin-top: 22px; }
.tk-box { display: block; box-sizing: border-box; width: 100%; margin: 0; background: #fff; border: 1px solid #dfe2e7; border-radius: var(--r-card); padding: 20px 24px; box-shadow: none; }
.tk-box.is-bot { background: #eef0f3; border-color: #dfe2e7; }
.tk-box .ch { display: flex; align-items: center; gap: 0; font-size: .7rem; text-transform: uppercase; letter-spacing: 1px; font-weight: 500; color: var(--muted); margin: 0 0 12px; }
.tk-box.is-real > .ch { color: var(--ink); font-weight: 600; }
.tk-box .mailbox { min-height: 0; }
.tk-box.mail-main .mailbox { font-size: 1rem; line-height: 1.6; color: var(--ink); }
.tk-box.draft-fld .draft-wrap { background: #fff; }
.tk-box.draft-fld.is-bot .draft-wrap { background: #eef0f3; }
.tk-box.draft-fld textarea.in.draft { min-height: 200px; }
.tk-box .in.ro.waiting { min-height: 120px; display: block; padding: 10px 12px; color: var(--muted); }
.tk-box.real-fld .in.ro.preview { min-height: 120px; }
.tk-box .btnrow { margin-top: 16px; }
.tk-note { font-size: .8rem; color: var(--muted); margin: 10px 0 0; } .tk-note .empty { color: var(--faint); }
details.tk-fold { padding: 0; }
details.tk-fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 16px 24px; flex-wrap: wrap; }
details.tk-fold > summary::-webkit-details-marker { display: none; }
details.tk-fold > summary .ch { margin: 0; }
details.tk-fold > summary .tk-sum { font-size: .78rem; color: var(--muted); font-weight: 300; }
details.tk-fold:not([open]) > summary .fold-chev::before { transform: translateX(-.12em) rotate(-45deg); }
details.tk-fold .tk-fold-body { padding: 0 24px 20px; }
details.tk-fold.is-bot .tk-fold-body .mailbox { font-size: .85rem; color: #6b7079; font-weight: 300; }
details.tk-fold.is-bot .btnrow .btn { background: #fff; }
details.tk-fold .table-wrap { margin: 0; }
@media (max-width: 720px) { .tk-box { padding: 16px; } details.tk-fold > summary { padding: 14px 16px; } details.tk-fold .tk-fold-body { padding: 0 16px 16px; } }

/* v13b: handlingsknapper ≠ faner (Mathias 19:45) */
.tk-box .btnrow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.tk-box .btnrow .btn.act-btn { text-transform: none; letter-spacing: 0; font-size: .88rem; font-weight: 500; border: 1px solid #dfe2e7; background: #f1f3f5; color: var(--ink); border-radius: 999px; padding: 8px 16px; display: inline-flex; align-items: center; gap: 7px; box-shadow: none; }
.tk-box .btnrow .btn.act-btn:hover:not(:disabled) { background: #e6e9ed; }
.tk-box .btnrow .btn.act-ok { background: var(--good-tint); border-color: rgba(19,97,46,.22); color: var(--good); }
.tk-box .btnrow .btn.act-ok:hover:not(:disabled) { background: rgba(19,97,46,.16); }
.tk-box .btnrow .btn.act-btn:disabled { background: #f4f5f7; color: #a3a8b0; border-color: #e6e8ec; }
.tk-box .btnrow .btn.act-btn .ic { font-size: 1rem; line-height: 1; }
.tk-box .btnrow .back-link { text-transform: none; letter-spacing: 0; font-size: .85rem; font-weight: 400; color: var(--muted); text-decoration: underline; text-underline-offset: 2px; padding: 0 4px; margin-left: 4px; }
.tk-box .btnrow .back-link:hover { color: var(--ink); }

/* v13c: hvid tilbage-bar, tekstlink (Mathias 19:47) */
.backbar { background: #fff; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line); }
.backbar-inner { min-height: 38px; padding-top: 4px; padding-bottom: 4px; }
.backbar .bar-link { font-size: .85rem; font-weight: 500; color: var(--ink); text-decoration: none; display: inline-flex; gap: 6px; align-items: center; }
.backbar .bar-link:hover { text-decoration: underline; text-underline-offset: 2px; }
.backbar-t { color: var(--muted); }

/* v13d: ét svarfelt (Mathias 19:48) */
.tk-box .src-tag { display: inline-block; margin-left: 10px; font-size: .62rem; font-weight: 500; letter-spacing: .6px; text-transform: none; color: var(--muted); background: #f1f3f5; border: 1px solid #e3e6ea; border-radius: 999px; padding: 2px 9px; }
.tk-box .src-tag[hidden] { display: none; }
.tk-box.draft-fld .draft-wrap { background: #fff; }
.tk-box.draft-fld textarea.in.draft { color: var(--ink); font-size: .95rem; font-weight: 400; background: transparent; border: 1px solid #cfd3d8; min-height: 240px; }
mark.rv { background: rgba(19,97,46,.12); border-radius: 3px; color: transparent; }
.tk-box .tk-note { margin: 10px 0 0; }

/* v14: skjult-for-botten = rolig skifer-blå, ikke grøn (Mathias 19:52) */
mark.rv { background: rgba(71, 85, 125, .10); box-shadow: inset 0 -1px 0 rgba(71, 85, 125, .45); border-radius: 2px; color: transparent; }

/* v15: én grå markering for alt, botten ikke ser (Mathias 19:58) */
.ph, .card.mail-bot .mailbox .ph, details.tk-fold .mailbox .ph { color: inherit; background: rgba(27,33,26,.08); box-shadow: inset 0 -1px 0 rgba(27,33,26,.30); border-radius: 2px; padding: 0 2px; }
details.tk-fold.is-bot .tk-fold-body .mailbox .ph { color: #4a4f57; }
mark.rv { background: rgba(27,33,26,.08); box-shadow: inset 0 -1px 0 rgba(27,33,26,.30); border-radius: 2px; color: transparent; }
.tk-box .ch .tk-hint { margin-left: 10px; font-size: .74rem; text-transform: none; letter-spacing: 0; font-weight: 300; color: var(--muted); }
.tk-box .ch .tk-hint [hidden] { display: none; }

/* v16: alle bokse hvide; kundens mail i samme indre felt som svaret (Mathias 20:03) */
.tk-box, .tk-box.is-bot, details.tk-fold.is-bot { background: #fff; border: 1px solid #dfe2e7; border-radius: var(--r-card); box-shadow: none; }
.tk-box .field-frame, .tk-box.mail-main .mailbox, details.tk-fold .tk-fold-body .mailbox, .tk-box.draft-fld textarea.in.draft, .tk-box .in.ro.waiting {
  box-sizing: border-box; width: 100%; border: 1px solid #cfd3d8; border-radius: var(--r-btn); padding: 9px 11px; background: #fff;
  font-family: inherit; font-size: .95rem; line-height: 1.6; font-weight: 400; color: var(--ink); box-shadow: inset 0 1px 2px rgba(0,0,0,.03); }
.tk-box.mail-main .mailbox { min-height: 0; white-space: pre-wrap; }
details.tk-fold .tk-fold-body .mailbox, details.tk-fold.is-bot .tk-fold-body .mailbox { min-height: 0; color: var(--text); font-weight: 300; font-size: .95rem; }
details.tk-fold.is-bot .tk-fold-body .mailbox.empty { color: var(--muted); }
details.tk-fold.is-bot .tk-fold-body .mailbox .ph { color: var(--ink); }
.tk-box .in.ro.waiting { color: var(--muted); min-height: 120px; }
details.tk-fold.is-bot .btnrow .btn { background: #fff; }

/* v17: ingen indre rammer; kundens mail let grå, svar hvidt; Bot-visning slår grå markering til (Mathias 20:08) */
.tk-box.mail-main { background: #f5f6f8; }
.tk-box.mail-main .mailbox, details.tk-fold .tk-fold-body .mailbox, .tk-box .in.ro.waiting {
  border: 0; box-shadow: none; padding: 0; background: transparent; border-radius: 0; }
.tk-box.draft-fld textarea.in.draft { border: 0; box-shadow: none; padding: 0; background: transparent; border-radius: 0; }
.tk-box.draft-fld textarea.in.draft:focus { outline: none; }
.tk-box.draft-fld:focus-within { border-color: #b9bec6; }
.tk-box.draft-fld:not(.show-bot) .draft-hl mark.rv { background: transparent; box-shadow: none; }
.tk-box .ch .bot-tgl { display: inline-flex; align-items: center; gap: 6px; margin-left: 10px; font-size: .74rem; text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--muted); cursor: pointer; user-select: none; vertical-align: middle; }
.bot-tgl input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.bot-tgl .bot-sw { position: relative; width: 26px; height: 15px; border-radius: 8px; background: #d5d8dd; transition: background .15s; }
.bot-tgl .bot-sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 11px; height: 11px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: left .15s; }
.bot-tgl input:checked + .bot-sw { background: var(--ink); }
.bot-tgl input:checked + .bot-sw::after { left: 13px; }
.bot-tgl input:focus-visible + .bot-sw { outline: 2px solid var(--ink); outline-offset: 2px; }
.bot-tgl:has(input:checked) { color: var(--ink); }

/* v18: hvide kort med blød skygge, der skiller sig ud fra sidens baggrund; mail-tekst på meget svag grå tone; Svar er ét kort (Mathias 20:11) */
.tk-col > .tk-box, .tk-box.mail-main, .tk-box.draft-fld, details.tk-fold, details.tk-fold.is-bot {
  background: #fff; border: 1px solid #e3e6ea; border-radius: 10px; padding: 22px 26px;
  box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 6px 18px rgba(16,24,40,.06); }
details.tk-col > details.tk-fold, .tk-col > details.tk-fold.tk-box { padding: 0; }
details.tk-fold > summary { padding: 16px 26px; }
details.tk-fold .tk-fold-body { padding: 0 26px 22px; }
.tk-box.mail-main .mailbox { background: #f8f9fb; border-radius: 8px; padding: 14px 16px; margin-top: 4px; }
.tk-box.draft-fld > .ch { display: flex; align-items: center; flex-wrap: wrap; gap: 0; margin-bottom: 12px; }
.tk-box.draft-fld .draft-wrap, .tk-box.draft-fld textarea.in.draft { background: transparent; }
.tk-box.draft-fld textarea.in.draft { resize: vertical; }
.tk-box.draft-fld:focus-within { border-color: #cfd4da; box-shadow: 0 1px 2px rgba(16,24,40,.05), 0 8px 22px rgba(16,24,40,.08); }

/* v19: mailhoved som i en mailboks – Fra/Til/Emne/Dato over mailen, Til/Emne over svaret (Mathias 20:15) */
.tk-box dl.mhead { margin: 0 0 12px; padding: 0 0 10px; border-bottom: 1px solid #eef0f3; font-size: .84rem; line-height: 1.5; }
.tk-box dl.mhead > div { display: flex; gap: 10px; }
.tk-box dl.mhead dt { flex: 0 0 44px; color: var(--muted); font-weight: 300; }
.tk-box dl.mhead dd { margin: 0; color: var(--ink); font-weight: 400; min-width: 0; overflow-wrap: anywhere; }
.tk-box.mail-main dl.mhead { margin-top: 2px; }
.tk-box.mail-main .mailbox { margin-top: 0; }

/* v20: mailhoved dæmpet – lille, gråt, label og værdi på samme linje (Mathias 20:19) */
.tk-box .mhead { margin: 0 0 12px; padding: 0; border: 0; font-size: .74rem; line-height: 1.55; color: #8a8f97; font-weight: 300; }
.tk-box .mhead .mh-l { overflow-wrap: anywhere; }
.tk-box .mhead .mh-k { color: #a2a7ae; }
.tk-box .mhead .mh-v { color: #6b7079; }
.tk-box .mhead .mh-sep { color: #c3c7cc; }
.tk-box.mail-main .mhead { margin-top: 0; }
/* v20b: svarteksten på samme svage grå flade som mailteksten (Mathias 20:19) */
.tk-box.draft-fld .draft-wrap { background: #f8f9fb; border-radius: 8px; }
.tk-box.draft-fld textarea.in.draft { padding: 14px 16px; background: transparent; }
.tk-box .in.ro.waiting { background: #f8f9fb; border-radius: 8px; padding: 14px 16px; }

/* v20c: Bot-visning over begge kort styrer gråt i kundens mail og i svaret; kraftigere, ens skygge på alle fire kort (Mathias 20:20–20:21) */
.tk-col > .tk-box, .tk-box.mail-main, .tk-box.draft-fld, details.tk-fold, details.tk-fold.is-bot {
  box-shadow: 0 1px 3px rgba(16,24,40,.08), 0 10px 28px rgba(16,24,40,.12); }
.tk-box.draft-fld:focus-within { box-shadow: 0 1px 3px rgba(16,24,40,.08), 0 10px 28px rgba(16,24,40,.12); border-color: #cfd4da; }
.bot-bar { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin: 0 0 -6px; min-height: 20px; }
.bot-bar .bot-tgl { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--muted); cursor: pointer; user-select: none; }
.bot-bar .tk-hint { font-size: .74rem; color: var(--muted); font-weight: 300; }
.bot-bar .tk-hint[hidden] { display: none; }
.mail-main .mailbox .hid { background: transparent; box-shadow: none; transition: background .15s; }
.tk-col.show-bot .mail-main .mailbox .hid { background: rgba(27,33,26,.08); box-shadow: inset 0 -1px 0 rgba(27,33,26,.30); border-radius: 2px; }

/* v21 (Mathias 20:28) */
/* 1) svarfeltet vokser med teksten – ingen indre scroll */
.tk-box.draft-fld textarea.in.draft { overflow: hidden; resize: none; min-height: 320px; }
/* 2) to forskellige, rolige toner: henvendelse kølig blågrå, svar varm */
.tk-box.mail-main .mailbox { background: #eef2f7; }
.tk-box.draft-fld .draft-wrap, .tk-box .in.ro.waiting { background: #faf6ef; }
/* 3) skjult for botten: rolig skifer-lilla (samme familie som Følsom) med svag understregning – i mail, svar og fold */
.tk-col.show-bot .mail-main .mailbox .hid,
.tk-box.draft-fld.show-bot .draft-hl mark.rv,
.ph, .card.mail-bot .mailbox .ph, details.tk-fold .mailbox .ph, details.tk-fold.is-bot .tk-fold-body .mailbox .ph {
  background: rgba(104,88,150,.14); box-shadow: inset 0 -1.5px 0 rgba(104,88,150,.55); border-radius: 2px; }
.bot-tgl input:checked + .bot-sw { background: #5b4f80; }
/* 5) Kopiér svar og Markér som løst som små tekstlinks ligesom ← Alle tickets; Send svar er eneste fyldte knap */
.tk-box .btnrow .act-link { appearance: none; background: none; border: 0; box-shadow: none; padding: 0 4px; margin-left: 4px; font: inherit; font-size: .85rem; font-weight: 400; color: var(--muted); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.tk-box .btnrow .act-link:hover:not(:disabled) { color: var(--ink); }
.tk-box .btnrow .act-link:disabled { color: #b4b8bf; cursor: default; text-decoration: none; }
.tk-box .btnrow .act-link .ic { font-size: .9rem; line-height: 1; text-decoration: none; display: inline-block; }
.tk-box .btnrow .act-link.act-ok:not(:disabled) { color: var(--good); }
.tk-box .btnrow { align-items: center; gap: 14px; }
/* 7) undernavigationen får en svag skygge */
.backbar { border-top: 1px solid #eceef1; border-bottom: 1px solid #e6e8ec; box-shadow: 0 4px 12px rgba(16,24,40,.07); position: relative; }

/* v22 (Mathias 20:34) */
/* 1) Kundehenvendelse og Svar er rigtige korttitler, ikke små versaler */
.tk-box.mail-main > .ch, .tk-box.draft-fld > .ch { font-size: 1.15rem; font-weight: 600; text-transform: none; letter-spacing: -.005em; color: var(--ink); display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; line-height: 1.3; }
.tk-box.draft-fld > .ch .src-tag { font-size: .7rem; font-weight: 500; letter-spacing: 0; text-transform: none; }
/* 2) Rediger-chip efter Udkast-chippen */
.tk-box .ch .edit-chip { appearance: none; display: inline-flex; align-items: center; gap: 5px; font: inherit; font-size: .72rem; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--ink); background: #fff; border: 1px solid #d5d9e0; border-radius: 999px; padding: 2px 10px 2px 8px; cursor: pointer; line-height: 1.5; }
.tk-box .ch .edit-chip:hover { background: #f3f4f6; border-color: #c3c8d0; }
.tk-box .ch .edit-chip:focus-visible { outline: 2px solid #5b4f80; outline-offset: 2px; }
.tk-box .ch .edit-chip[hidden] { display: none; }

/* v23 (Mathias 20:38): hjælpetekst i folden "Sendt til botten", samme stil som ved Bot-visning */
details.tk-fold > summary .fold-hint { font-size: .74rem; color: var(--muted); font-weight: 300; text-transform: none; letter-spacing: 0; margin-left: 10px; }
details.tk-fold > summary .fold-hint[hidden] { display: none; }
/* v23 (Mathias 20:39 via steering): Rediger-chip erstattet af lille, dæmpet hint uden knap og uden klik */
.tk-box .ch .edit-hint { font-size: .74rem; font-weight: 300; color: var(--muted); text-transform: none; letter-spacing: 0; cursor: default; }
.tk-box .ch .edit-hint[hidden] { display: none; }

/* v24 (Mathias 20:43): lilla betyder altid "det botten ser i stedet". Bot-visning til = pladsholdere i stedet for rigtige oplysninger; fra = rigtig tekst uden markering */
.tk-box.mail-main .mailbox .mb-bot { display: none; }
.tk-col.show-bot .mail-main .mailbox .mb-real { display: none; }
.tk-col.show-bot .mail-main .mailbox .mb-bot { display: block; }
.tk-box.draft-fld .draft-bot { display: none; }
.tk-box.draft-fld.show-bot .draft-wrap { display: none; }
.tk-box.draft-fld.show-bot .draft-bot { display: block; white-space: pre-wrap; background: #faf6ef; border-radius: 8px; padding: 14px 16px; min-height: 320px; font-size: .9rem; line-height: 1.55; cursor: default; }
.tk-box.draft-fld.show-bot .edit-hint { display: none; }

/* v26 (Mathias 20:53): folden "Sendt til botten" er fjernet; Følsom-overrule ligger nu roligt i Svar-kortet */
.tk-box.draft-fld .ov-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 12px 0 0; }
.tk-box.draft-fld .ov-link { appearance: none; background: none; border: 0; padding: 0; font: inherit; font-size: .82rem; color: #4e4560; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.tk-box.draft-fld .ov-link:hover:not(:disabled) { color: var(--ink); }
.tk-box.draft-fld .ov-link:disabled { text-decoration: none; cursor: default; color: var(--muted); }
.tk-box.draft-fld .ov-hint { font-size: .74rem; font-weight: 300; color: var(--muted); }
.tk-box.draft-fld .ov-hint[hidden] { display: none; }
/* v28 (Mathias 20:58): Tråd er en rigtig mailtråd – én kompakt linje pr. mail (dato, Fra, første linje), klik for hele teksten; bot-hændelser kun som små, dæmpede linjer */
.tml { display: flex; flex-direction: column; gap: 6px; padding-top: 4px; }
details.tm { border-radius: 8px; background: #f7f8fa; }
details.tm.tm-ind { background: #eef2f7; }
details.tm.tm-ud { background: #faf6ef; }
details.tm > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 9.5em 12em 1fr; gap: 12px; padding: 8px 12px; font-size: .85rem; align-items: baseline; }
details.tm > summary::-webkit-details-marker { display: none; }
details.tm .tm-d { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
details.tm .tm-f { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
details.tm .tm-x { color: #5a5f68; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 300; }
details.tm[open] .tm-x { visibility: hidden; }
details.tm .tm-body { padding: 2px 12px 12px; white-space: pre-wrap; font-size: .9rem; font-weight: 300; line-height: 1.5; }
.tev { font-size: .72rem; color: #9aa0a8; padding: 0 12px; }
.thread-fold .b { display: none; }
.show-bot .thread-fold .tm-body .b { display: block; }
.show-bot .thread-fold .tm-f .b, .show-bot .thread-fold .tm-x .b { display: inline; }
.show-bot .thread-fold .r { display: none; }
.mcount { font-size: .72rem; color: var(--muted); margin-left: 4px; white-space: nowrap; }
@media (max-width: 720px) { details.tm > summary { grid-template-columns: 1fr; gap: 2px; } }
/* v29 (Mathias 21:01): Bot-visning dækker også mailhoveder – kundens mail som [EMAIL], emnet renset som teksten */
.hv-b { display: none; }
.show-bot .hv-b { display: inline; }
.show-bot .hv-r { display: none; }
/* v30 (Mathias 21:06): gule tjek-felter blødere og roligere; hjælpetekst om gult i Svar-hovedet */
mark.chk, .draft-bot mark.chk, .mailbox mark.chk { background: #fdf6d8; box-shadow: inset 0 0 0 1px #ecd98f; border-radius: 3px; color: inherit; }
.draft-hl mark.chk { color: transparent; }
textarea.in.draft.has-chk { border-color: var(--line, #e3e6ea); }
.show-bot #hint-chk:not([hidden]) { display: inline; }
/* v32 (Mathias 21:09): mærke på hver mail i tråden – Modtaget / Sendt af <navn>; botudkast vises ikke i tråden */
details.tm > summary { grid-template-columns: 9.5em 8.5em 11em 1fr; }
details.tm .tm-lab { font-size: .72rem; white-space: nowrap; border-radius: 999px; padding: 1px 8px; justify-self: start; }
details.tm .lab-ind { background: #dfe6ef; color: #3f4a5a; }
details.tm .lab-ud { background: #efe5d3; color: #5a4a30; }
@media (max-width: 720px) { details.tm > summary { grid-template-columns: 1fr; } }
/* v33 (Mathias 21:10): lille tekstlink "Fold alle ud" / "Fold alle sammen" ved tråden */
.thr-all { background: none; border: 0; padding: 0; margin-left: 10px; font: inherit; font-size: .74rem; font-weight: 300; color: #4e4560; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.thr-all:hover { color: var(--ink); }
/* v34 (Mathias 21:13): farve = afsender, ens overalt. Kunden = svag blå (Kundehenvendelse og kundens mails i Tråd). Os = varm, neutral sand (Svar og vores sendte mails i Tråd) – ikke gul, så den ikke ligner tjek-felterne */
.tk-box.mail-main .mailbox, details.tm.tm-ind { background: #eef2f7; }
.tk-box.draft-fld .draft-wrap, .tk-box .in.ro.waiting, .tk-box.draft-fld.show-bot .draft-bot, details.tm.tm-ud { background: #f3efe9; }
details.tm .lab-ind { background: #dde4ee; color: #3f4a5a; }
details.tm .lab-ud { background: #e6dfd4; color: #574c3f; }
/* v35 (Mathias 21:15): kundens mails i Tråd får et roligt mærke – Besvaret / Ikke besvaret (ikke grøn eller gul) */
details.tm > summary { grid-template-columns: 9.5em 8.5em 7.5em 11em 1fr; }
details.tm .tm-st { font-size: .7rem; white-space: nowrap; justify-self: start; border-radius: 999px; padding: 0 7px; }
details.tm .tm-st.st-ja { color: #7d838c; border: 1px solid #d6d9de; }
details.tm .tm-st.st-nej { color: #2f3a4c; border: 1px solid #8f9bb0; background: #fff; font-weight: 500; }
@media (max-width: 720px) { details.tm > summary { grid-template-columns: 1fr; } }
/* v36 (Mathias 21:22): sticky undernav (← Alle tickets) adskilt fra hvid topnav – svag kølig grå, ikke beige */
.backbar { background: #f7f8fa; border-top: 1px solid #e2e5ea; border-bottom: 1px solid #dde1e7; box-shadow: 0 3px 8px -2px rgba(22,32,48,.12); }
/* v37 (Mathias 21:24): Genåbn neutral; tak-ticket – roligt notat i stedet for udkast */
.tk-box .btnrow .act-link.act-reopen { color: var(--ink); }
.tk-box .in.ro.tak-note { display: block; min-height: 64px; padding: 12px; color: #4a5260; background: #f7f8fa; font-style: normal; }
/* v38 (Mathias 21:33–21:34): lavere tomt svarfelt (~4–5 linjer), vokser stadig med teksten; Væk botten-link */
.tk-box.draft-fld textarea.in.draft, textarea.in.draft, .draft-ro { min-height: 120px; }
.tk-box.draft-fld.show-bot .draft-bot { min-height: 120px; }
.tk-box .in.ro.waiting { min-height: 96px; }
.tk-box .btnrow.wake-row { margin-top: 6px; margin-bottom: 4px; }
.tk-box .btnrow.wake-row .act-link:disabled { color: var(--muted); font-style: italic; }
/* v39 (Mathias 21:39): Tråd-overskrift som Kundehenvendelse og Svar */
details.thread-fold > summary .ch { font-size: 1.15rem; font-weight: 600; text-transform: none; letter-spacing: -.005em; color: var(--ink); }
details.thread-fold > summary .tk-sum { margin-left: 2px; }
/* v40 (Mathias 21:41): kundefarve tydeligere blå, blød og varm (#e8f0fa) i hovedvisning og tråd */
.tk-box.mail-main .mailbox, details.tm.tm-ind { background: #e8f0fa; }
details.tm .lab-ind { background: #d4e2f4; color: #2c4466; }
details.tm .tm-st.st-ja { color: #6c7a8d; border-color: #c6d2e2; }
details.tm .tm-st.st-nej { color: #22385a; border-color: #7d92b4; background: #fff; }
/* v41 (Mathias 06:09): statusfilter som Dashboard – én fane "Alle" + runde jump-pills (.jump-pill, valgt = .on) */
.jump-row { display:flex; flex-wrap:wrap; gap:8px; margin: 4px 0 26px; }
.jump-pill { font: inherit; font-size:.78rem; border:1px solid var(--ink); background:#fff; color:var(--ink); border-radius:999px; padding:6px 13px; cursor:pointer; text-decoration:none; display:inline-flex; align-items:center; }
.jump-pill span { color: var(--muted); margin-left:4px; font-size:.72rem; }
.jump-pill:hover, .jump-pill.on { background: var(--ink); color:#fff; }
.jump-pill:hover span, .jump-pill.on span { color: rgba(255,255,255,.7); }
.jump-pill.tab-fol svg.lock { margin-right:5px; }
.navwrap-inner .st-filter { margin: 14px 0 0; }
/* v42 (Mathias 06:09–06:21): faner Aktive/Løst, chips som ankre, Afventer kunde dæmpet, "i bund" */
.grp-block.grp-muted { opacity: .62; }
.grp-block.grp-muted:hover { opacity: .9; }
.zero-inbox { margin: 6px 0 28px; padding: 18px 20px; background:#fff; border:1px solid #e2e5ea; border-radius:12px; color: var(--muted); font-size:.95rem; }
.zero-inbox .zi-ok { color: var(--good, #13612e); font-weight:600; margin-right:6px; }
.demo-note { font-size:.78rem; color: var(--muted); margin: 0 0 10px; }
/* v43: liste i "Sådan virker listen" */
.intro-list { margin: 6px 0 0; padding-left: 18px; }
.intro-body ul.intro-list { font-size: .82rem; color: var(--muted); }
.intro-list li { margin: 2px 0; }
/* v44: hele rækken åbner ticketten (Mathias 06:28). Nr. og emne er stadig rigtige links til tastatur. */
tr.clickrow { cursor: pointer; }
tr.clickrow:hover td { background: #f3f5f8; }
tr.clickrow:focus-within td { background: #eef2f7; }
/* v45: søgning som i Dashboard – sidst i chip-rækken, live-filter (Mathias 06:36) */
input.tab-search { font: inherit; font-size:.82rem; color:var(--ink); border:1px solid #d3d6d2; background:#fff; border-radius:999px; padding:6px 14px; min-width: 220px; outline:none; }
input.tab-search:focus { border-color: var(--ink); }
@media (max-width: 700px) { input.tab-search { flex-basis:100%; min-width:0; } }
/* v46: søgning yderst til højre på fane-rækken (Mathias 06:40) */
.tab-row { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.tab-row input.tab-search { margin-left:auto; }
/* v47: søgefelt lidt tydeligere – lup, kant, fokusring (Mathias 06:42) */
.tab-row input.tab-search { border-color:#c9cdd3; padding-left:32px;
  background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%237a808a' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-4-4'/%3E%3C/svg%3E") no-repeat 12px 50%; }
.tab-row input.tab-search:hover { border-color:#aeb3bb; }
.tab-row input.tab-search:focus { border-color:#5b6270; box-shadow:0 0 0 3px rgba(91,98,112,.14); }
/* v48: Forsinket uden ikon, blødere farve (Mathias 06:59) */
.vpill.s-stale { background:#faf3e3; color:#8a6a3b; border:1px solid #efe2c4; }
/* v49: Afventer kunde i rolig skifergrå, tydeligt forskellig fra Forsinket (Mathias 07:00) */
.s-afventer, .vpill.s-afventer { color:#4a5568; background:#eef1f5; }
.grp-block.g-s-afventer { --gc:#4a5568; --gt:#eef1f5; }
/* v50: Afventer kunde-mærket tydeligt, men roligt; gruppen er stadig dæmpet, undtagen mærket (Mathias 07:01) */
.vpill.s-afventer { background:#e3e9f2; color:#3d4f66; border:1px solid #c8d2e0; }
.grp-block.grp-muted, .grp-block.grp-muted:hover { opacity:1; }
.grp-block.grp-muted .grp-h, .grp-block.grp-muted td:not(:nth-child(2)) { opacity:.62; }
.grp-block.grp-muted tr:hover td:not(:nth-child(2)) { opacity:.9; }
/* v51: Afventer kunde-mærket lidt stærkere (Mathias 07:03) */
.vpill.s-afventer { background:#d6e0ee; color:#2f4560; border:1px solid #a9b9d0; }
/* v52: Afventer kunde-boksen skiller sig tydeligere fra sidens baggrund (Mathias 07:05) */
.grp-block.g-s-afventer { --gc:#8a97ab; --gt:#e6ebf2; border:1px solid #cfd7e3; border-left:5px solid var(--gc); }
.grp-block.grp-muted .grp-h { opacity:.85; }
/* v53: Afventer kunde-mærket tilbage til den blødere version (Mathias 07:05) */
.vpill.s-afventer { background:#e3e9f2; color:#3d4f66; border:1px solid #c8d2e0; }
/* v54: Afventer kunde – overskrift og rækker som de andre grupper; kun boksen er dæmpet (Mathias 07:06) */
.grp-block.grp-muted .grp-h, .grp-block.grp-muted td:not(:nth-child(2)), .grp-block.grp-muted tr:hover td:not(:nth-child(2)) { opacity:1; }
.grp-block.g-s-afventer .grp-h, .grp-block.g-s-afventer .grp-name { color:#4a5568; font-weight:600; }
