/* Arbejdsblik med rigtige data. Bygger på stil.css og k74-tema.css og bruger kun deres værdier. */
[hidden] { display: none !important; }
body.starter > * { visibility: hidden; }
body.ude { display: block; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.fejl:not(:empty) { color: var(--bad); background: var(--bad-soft); border-radius: var(--r1); padding: 8px 12px; margin: 10px 0 0; }
.warn { color: var(--warn); background: var(--warn-soft); border-radius: var(--r1); padding: 8px 12px; margin: 10px 0; }
.lead { margin: 0 0 14px; max-width: 70ch; }

/* Login */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px calc(24px + env(safe-area-inset-bottom, 0px)); background: var(--bg); }
.loginbox { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r3); padding: 28px 24px; box-shadow: var(--shadow-xs); display: grid; gap: 16px; }
.loginbox .brand { padding: 0; color: var(--ink); }
.loginbox h1 { font-size: 26px; margin: 4px 0 0; letter-spacing: -.01em; }
.loginbox form { display: grid; gap: 12px; }
.loginbox input { width: 100%; font-size: 17px; }
#loginkode { font-size: 26px; letter-spacing: .35em; font-variant-numeric: tabular-nums; text-align: center; }
.loginbox button.primary { width: 100%; min-height: 48px; }
.loginlinks { display: flex; gap: 8px; flex-wrap: wrap; }
.loginlinks button { flex: 1 1 auto; box-shadow: none; background: transparent; }

/* Sidebar og top */
nav button .count { margin-left: auto; font-size: 12px; font-weight: 700; background: color-mix(in srgb, var(--side-ink) 16%, transparent); border-radius: 999px; padding: 1px 8px; font-variant-numeric: tabular-nums; }
nav button span:not(.count) { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
header .who .primary { min-height: 40px; }

/* Opgaverækker */
.task .due { display: grid; justify-items: end; font-size: .875rem; text-align: right; }
.task.late { box-shadow: inset 4px 0 0 var(--bad); }
.late-text { color: var(--bad); font-weight: 600; font-size: .8rem; }
b.late-text { font-size: inherit; }
.nodue { color: var(--muted); }
.lock { font-size: 11px; font-weight: 700; color: var(--info); background: var(--info-soft); border-radius: 999px; padding: 1px 7px; vertical-align: 2px; }
.badge.idea { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 20%, transparent); }
.badge.sort { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.badge.late { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 25%, transparent); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }

/* Forsiden */
.nudge { display: flex; gap: 16px; align-items: center; justify-content: space-between; background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 28%, transparent); border-radius: var(--r3); padding: 14px 18px; margin: 0 0 22px; }
.nudge strong { display: block; }
.nudge button { white-space: nowrap; }

/* Sortér */
.sortgroup { margin-bottom: 28px; }
.sortrow { display: flex; align-items: center; border-bottom: 1px solid var(--hair); }
.sortrow:last-child { border-bottom: 0; }
.sortrow .task { border-bottom: 0; grid-template-columns: minmax(0, 1fr); flex: 1 1 auto; min-width: 0; }
.sortknap { display: flex; gap: 6px; padding: 8px 12px 8px 0; flex: none; }
.sortknap button { min-height: 40px; }
.groupactions { display: flex; justify-content: flex-end; margin-top: 8px; }
.groupactions button.confirm { background: var(--bad-soft); color: var(--bad); border-color: var(--bad); }

/* Kalender og uge */
.calendar > .idag { background: var(--acc-soft); }
.calendar > .fri:not(.idag) { background: var(--sunken); }
.calendar button.cal-late { box-shadow: inset 3px 0 0 var(--bad); }
.calendar button.cal-done { text-decoration: line-through; opacity: .75; }
.weekgroup.idag h3 { color: var(--acc); }
.monthcard.nu { outline: 2px solid var(--acc); outline-offset: -2px; }

/* Opgaven */
.brief { white-space: pre-line; }
.felter { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 12px; margin: 14px 0 4px; }
.felter .field p { margin: 6px 0 0; font-weight: 400; }
.field input, .field select, .field textarea { width: 100%; }
textarea { font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r1); padding: .55rem .7rem; resize: vertical; }
.subs { margin: 16px 0 6px; }
.subs h3 { font-size: 1rem; margin-bottom: 4px; }
.sub-count { font-weight: 400; color: var(--muted); font-size: .875rem; }
.subs ul { list-style: none; margin: 0; padding: 0; }
.subs li label { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; min-height: 44px; border-bottom: 1px solid var(--hair); cursor: pointer; }
.subs input[type=checkbox] { width: 20px; height: 20px; min-height: 0; margin-top: 2px; flex: none; accent-color: var(--acc); }
.subs input:checked + span { color: var(--muted); text-decoration: line-through; }
.subadd { display: flex; gap: 8px; margin-top: 8px; }
.subadd input { flex: 1 1 auto; min-width: 0; }
.mailadd { display: flex; gap: 8px; flex: 0 1 22rem; min-width: 0; }
.mailadd input { flex: 1 1 auto; min-width: 0; }
details.edit, details.history { margin-top: 14px; }
details summary { cursor: pointer; min-height: 32px; display: flex; align-items: center; font-weight: 600; }
details.edit form { display: grid; gap: 10px; margin-top: 8px; justify-items: start; }
details.edit .field { width: 100%; }
#historylist { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 6px; font-size: .9rem; }
#historylist time { display: inline; }

/* Ny opgave */
#ny form { display: grid; gap: 12px; }
#ny .close { margin-bottom: -8px; }
.valg { border: 1px solid var(--hair); border-radius: var(--r1); padding: 8px 12px 10px; margin: 0; display: flex; flex-wrap: wrap; gap: 4px 18px; }
.valg legend { font-size: .875rem; font-weight: 600; padding: 0 4px; }
.valg label, .tjek { display: flex; gap: 8px; align-items: center; min-height: 40px; cursor: pointer; }
.valg input, .tjek input { width: 18px; height: 18px; min-height: 0; accent-color: var(--acc); }
.slukket { opacity: .5; }

/* Adgang og kalender */
.people { list-style: none; margin: 12px 0 0; padding: 0; }
.people li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--hair); }
.people li > span { min-width: 0; overflow-wrap: anywhere; }
.people strong { display: block; }
.role.ingen { background: var(--sunken); color: var(--muted); border: 1px solid var(--hair); }
.kallink { margin-top: 12px; display: grid; gap: 10px; }
.kallink input { font-size: 14px; }
a.knap { display: inline-flex; align-items: center; min-height: 42px; padding: .52rem .85rem; border: 1px solid var(--line); border-radius: var(--r1); color: var(--ink); text-decoration: none; background: var(--surface); }
a.knap:hover { background: var(--sunken); }

@media (max-width: 650px) {
  header { flex-wrap: wrap; }
  header > span { display: none; }
  header .who { width: 100%; justify-content: space-between; }
  .task .due { grid-column: 2; }
  .nudge { flex-direction: column; align-items: stretch; }
  .sortrow { flex-direction: column; align-items: stretch; }
  .sortknap { padding: 0 10px 10px; }
  .sortknap button { flex: 1 1 0; }
  .groupactions button { width: 100%; }
  .people li { flex-direction: column; align-items: flex-start; }
  .mailadd { width: 100%; flex-basis: auto; }
}
.skip { min-height: 44px; display: inline-flex; align-items: center; }
#ny-fristnote:empty { display: none; }
