/* Layout: TCHH-stil – grå topbar med spatieret logo, centrerede lyse Lato-overskrifter, kantede mørke knapper, mørk footer. Lyst tema er standard som tchh.dk; mørkt tema kun når brugeren vælger det (data-theme="dark") */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --head: #f6f6f6;
  --ink: #555555;
  --strong: #333333;
  --muted: #8a8a8a;
  --line: #cccccc;
  --nav: #454547;
  --dark: #2d2d30;
  --btn: #333333;
  --btn-alt: #777777;
  --on-dark: #ffffff;
  --field: #ffffff;
  --rule: #e3e3e3; --title: #777777; --placeholder: #b5b5b5;
  --btn-hover: #555555; --btn-alt-hover: #666666;
  --tip-bg: #2d2d30; --tip-ink: #ffffff;
  --tag: #a0523d; --vaeg: #4f7a5a; --gulv: #4a6c8c; --bjaelke: #b08a3e; --soejle: #7a5a86;
  --bar-ink: #d8d8d8; /* tekst i topbaren, ens i lyst og mørkt tema */
  --body: "Lato", "Helvetica Neue", Arial, sans-serif;
  --brand: "Montserrat", "Helvetica Neue", Arial, sans-serif;
}
:root[data-theme="dark"] {
  --bg: #18181a; --surface: #222225; --head: #2a2a2d; --ink: #bdbdc1; --strong: #f2f2f2; --muted: #8d8d92;
  --line: #3d3d41; --rule: #313134; --nav: #2d2d30; --dark: #111113; --btn: #3a3a3e; --btn-alt: #55555a;
  --on-dark: #ffffff; --field: #222225; --tip-bg: #3a3a3e; --title: #a8a8ad; --placeholder: #6a6a70;
  --btn-hover: #4a4a4f; --btn-alt-hover: #66666b;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.6; padding-block: 0; }
.pad { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

/* Topbar som i resten af serien: mørk bjælke med appens navn, "Alle apps" og tema-knap. Bliver ved øverst, når man ruller */
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--dark); color: var(--bar-ink); }
.topbar .in { max-width: 1140px; margin: 0 auto; min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 16px; font: 400 11px var(--brand); letter-spacing: 3px; text-transform: uppercase; }
.brand { font-size: 15px; letter-spacing: 4px; color: var(--bar-ink); min-width: 0; }
.brand span { font-size: 10px; letter-spacing: 3px; opacity: .6; margin-left: 10px; }
@media (max-width: 520px) { .brand span { display: none; } }

.wrap { max-width: 1140px; margin: 48px auto 0; padding-bottom: 48px; display: grid; gap: 44px; }
.wrap > header { text-align: center; display: grid; justify-items: center; gap: 6px; }
h1 { font-size: clamp(36px, 7vw, 56px); font-weight: 300; color: var(--title); margin: 0; line-height: 1.1; text-wrap: balance; }
.lede { color: var(--muted); margin: 6px 0 0; max-width: 62ch; }
h2 { font-size: 30px; font-weight: 300; color: var(--title); margin: 0; text-align: center; letter-spacing: .5px; }
h2 small { display: block; font-size: 13px; letter-spacing: 4px; text-transform: uppercase; color: var(--muted); font-weight: 400; margin-top: 2px; }

.alert { background: var(--head); color: var(--ink); border: 1px solid var(--line); padding: 14px 18px; font-size: 15px; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 28px; text-align: center; }
.alert b { color: var(--strong); font-weight: 700; }

label { display: grid; gap: 5px; font-size: 15px; color: var(--ink); position: relative; }
.export { display: grid; justify-items: center; gap: 8px; margin-top: -24px; }
.export .btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.ids { margin: 0 16px 14px; }
.ids summary { cursor: pointer; font-size: 14px; color: var(--strong); }
.ids summary span { color: var(--muted); }
.ids textarea { display: block; width: 100%; margin-top: 8px; font-family: var(--body); font-size: 15px; color: var(--strong); border: 1px solid var(--line); border-radius: 0; padding: 8px 12px; resize: vertical; background: var(--field); }
.ids textarea:focus { outline: none; border-color: var(--title); box-shadow: inset 0 0 0 1px var(--title); }
.ids .hint { font-size: 13px; color: var(--muted); margin: 6px 0 0; }
input:disabled { background: var(--head); color: var(--muted); }
.brandset { width: 100%; max-width: 760px; border: 1px solid var(--line); padding: 12px 16px; margin-top: 6px; }
.brandset summary { cursor: pointer; color: var(--strong); font-size: 15px; }
.brandset[open] { display: grid; gap: 14px; }
.brandset[open] summary { margin-bottom: 4px; }
.brandgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; align-items: start; }
.brandgrid > label { align-content: start; }
.brandgrid .wide { grid-column: 1 / -1; }
@media (max-width: 640px) { .brandgrid { grid-template-columns: 1fr; } }
.logofield { display: grid; gap: 5px; font-size: 15px; min-width: 0; }
.logorow { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.logoprev { width: 140px; height: 54px; border: 1px dashed var(--line); display: grid; place-items: center; background: #fff; overflow: hidden; }
.logoprev img { max-width: 130px; max-height: 46px; }
.logoprev span { font-size: 13px; color: var(--muted); }
.logobtns { display: flex; gap: 6px; flex-wrap: wrap; }
.btn-small { font-size: 14px; padding: 6px 14px; display: inline-block; }
.btn.btn-light { background: var(--surface); color: var(--strong); border: 1px solid var(--line); }
.btn.btn-light:hover { background: var(--head); }
#breset { justify-self: start; }
.hint { font-size: 13px; color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
label.btn:focus-within { outline: 2px solid var(--title); outline-offset: 2px; }
.projbar { border: 1px solid var(--line); padding: 14px 16px; display: grid; gap: 12px; }
.projrow { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: end; justify-content: space-between; }
.projsel { flex: 1 1 320px; min-width: 0; }
.projsel select { font-family: var(--body); font-size: 15px; color: var(--strong); background: var(--field); border: 1px solid var(--line); border-radius: 0; height: 40px; padding: 0 10px; width: 100%; min-width: 0; }
.projsel select:focus { outline: none; border-color: var(--title); box-shadow: inset 0 0 0 1px var(--title); }
.projbtns { display: flex; flex-wrap: wrap; gap: 6px; }
.projbtns .btn { height: 40px; display: inline-flex; align-items: center; }
.btn.btn-dk { background: var(--btn); }
.btn.btn-dk:hover { background: var(--btn-hover); }
.btn.danger { background: #a0523d; color: #fff; border-color: #a0523d; }
.projbar .toast { text-align: left; }
.btn-dark { background: var(--btn); border: 1px solid var(--line); padding: 12px 30px; letter-spacing: 1px; }
.btn-dark:hover { background: var(--btn-hover); }
.btn:disabled { opacity: .6; cursor: wait; }
input[type=text]::placeholder { color: var(--placeholder); }
input[type=number], input[type=text] {
  font-family: var(--body); font-size: 16px; color: var(--strong); background: var(--field);
  border: 1px solid var(--line); border-radius: 0; padding: 8px 12px; width: 100%; min-width: 0; height: 42px;
  font-variant-numeric: tabular-nums;
}
input[type=number]:focus, input[type=text]:focus { outline: none; border-color: var(--title); box-shadow: inset 0 0 0 1px var(--title); }
button:focus-visible { outline: 2px solid var(--title); outline-offset: 2px; }

.box { background: var(--surface); min-width: 0; display: grid; gap: 18px; }
.box-h { display: grid; justify-items: center; gap: 12px; }
.box-b { display: grid; gap: 14px; }

.project { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; max-width: 820px; margin: 0 auto; width: 100%; }
@media (max-width: 640px) { .project { grid-template-columns: 1fr; } }

.lt { display: flex; align-items: center; gap: 7px; }
.tip {
  flex: none; width: 18px; height: 18px; padding: 0; border-radius: 50%;
  border: 1px solid var(--title); background: var(--surface); color: var(--title);
  font: 700 11px/1 var(--body); display: inline-grid; place-items: center; cursor: help;
}
.tip:hover, .tip[aria-expanded="true"] { background: var(--btn); border-color: var(--btn); color: var(--on-dark); }
.tipbox {
  position: absolute; z-index: 20; top: calc(100% + 6px); left: 0;
  width: min(260px, 78vw); padding: 10px 12px;
  background: var(--tip-bg); color: var(--tip-ink); font-size: 14px; line-height: 1.5; text-align: left;
}
.tipbox b { font-weight: 700; }
.fields label:nth-child(even) .tipbox, .project label:last-child .tipbox { left: auto; right: 0; }
@media (hover: hover) { label:has(.tip:hover) .tipbox { display: block !important; } }

.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.cards.two { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 760px; margin: 0 auto; width: 100%; }
@media (max-width: 860px) { .cards, .cards.two { grid-template-columns: 1fr; } }
.group { display: grid; gap: 20px; }
.card { background: var(--surface); border: 1px solid var(--line); display: grid; align-content: start; }
.card h3 { margin: 0; padding: 12px 16px; font-size: 15px; font-weight: 400; letter-spacing: 3px; text-transform: uppercase; background: var(--dark); color: var(--on-dark); display: flex; align-items: center; gap: 10px; }
.card h3::before { content: ""; width: 10px; height: 10px; background: var(--c); flex: none; }
.card h3 small { margin-left: auto; font-size: 11px; letter-spacing: 1px; color: #bdbdbd; text-transform: none; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; padding: 16px; }
.fields label { font-size: 14px; }
.res { margin: 0 16px 16px; padding-top: 12px; border-top: 1px solid var(--line); display: grid; gap: 3px; }
.row { display: flex; justify-content: space-between; gap: 10px; font-size: 15px; }
.row span:first-child { color: var(--muted); }
.row span:last-child { font-variant-numeric: tabular-nums; color: var(--strong); }
.row.big span:first-child { color: var(--strong); font-weight: 700; }
.row.big span:last-child { font-size: 19px; font-weight: 700; }

.summary { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 0; background: var(--dark); color: var(--on-dark); }
@media (max-width: 760px) { .summary { grid-template-columns: repeat(2, minmax(0,1fr)); } }
.summary > div { padding: 26px 18px; display: flex; flex-direction: column-reverse; align-items: center; text-align: center; gap: 4px; min-width: 0; border-right: 1px solid #47474b; }
.summary > div:last-child { border-right: 0; }
.summary .k { font-size: 12px; letter-spacing: 3px; text-transform: uppercase; color: #bdbdbd; }
.summary .v { font-size: 34px; font-weight: 300; line-height: 1.15; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.summary .v small { font-size: 15px; margin-left: 5px; color: #bdbdbd; }

.legend { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; font-size: 14px; color: var(--ink); }
.legend i { display: inline-block; width: 12px; height: 12px; background: var(--c); vertical-align: -1px; margin-right: 6px; }
.chartbox { overflow-x: auto; }
svg text { font-family: var(--body); font-size: 12px; fill: var(--muted); }

.navtabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.navtabs button[data-k] { font-family: var(--body); font-size: 16px; background: var(--btn); color: var(--on-dark); border: 1px solid var(--line); border-radius: 0; padding: 10px 20px; cursor: pointer; }
.navtabs button[data-k]:hover { background: var(--btn-hover); }
.navtabs button[aria-pressed="true"] { background: var(--btn-alt); }
.btn { font-family: var(--body); font-size: 16px; border: 0; border-radius: 0; background: var(--btn-alt); color: var(--on-dark); padding: 10px 26px; cursor: pointer; }
.btn:hover { background: var(--btn-alt-hover); }
.tablebox { overflow-x: auto; max-height: 400px; overflow-y: auto; border: 1px solid var(--line); }
table { border-collapse: collapse; width: 100%; font-size: 15px; font-variant-numeric: tabular-nums; }
th, td { padding: 8px 14px; text-align: right; border-top: 1px solid var(--rule); white-space: nowrap; }
th { position: sticky; top: 0; background: var(--dark); color: var(--on-dark); font-weight: 400; font-size: 13px; letter-spacing: 1px; border-top: 0; }
table tr:nth-child(even) td { background: var(--head); }
td:first-child, th:first-child { text-align: left; }
tr.floor td { color: var(--muted); }
.note { font-size: 14px; color: var(--muted); margin: 0; text-align: center; max-width: 70ch; justify-self: center; }
.toast { font-size: 14px; color: var(--ink); text-align: center; display: block; }
.toast:empty { display: none; }

/* Footer som i resten af serien: tynd linje med to tekster */
footer { padding-top: 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
footer a { color: inherit; }
