/* The app's own components on top of Bootstrap (spec/design.md). Colours only
   via var(--theme-*) / var(--bs-*) from theme.css. Prefer a Bootstrap class;
   add here only what Bootstrap has no component for. */

body { -webkit-font-smoothing: antialiased; }
:focus-visible { outline: 3px solid var(--theme-accent); outline-offset: 2px; }
code { color: var(--theme-heading); }
.mono, .num { font-family: var(--bs-font-monospace); }
.num { font-variant-numeric: tabular-nums; }

/* Type */
.eyebrow { font-family: var(--bs-font-monospace); font-weight: 500; font-size: .75rem; letter-spacing: .07em; color: var(--theme-label); text-transform: uppercase; }
.page-header h1, .display-heading { font-family: var(--theme-display); font-weight: 600; font-size: 1.9rem; line-height: 1.2; color: var(--theme-heading); }
.h1-count { font-family: var(--bs-font-monospace); font-size: .8rem; font-weight: 500; color: var(--theme-muted); vertical-align: middle; }
.big-number { font-family: var(--bs-font-monospace); font-size: 1.75rem; line-height: 1.1; color: var(--theme-heading); white-space: nowrap; }
@media (max-width: 575.98px) { .big-number { font-size: 1.25rem; } }

/* Touch-friendly controls: 44px targets */
.btn:not(.btn-sm):not(.btn-close) { --bs-btn-padding-y: .55rem; --bs-btn-padding-x: 1rem; }
.form-control:not(.form-control-sm), .form-select:not(.form-select-sm) { min-height: 44px; }
.form-label { font-size: .8125rem; color: var(--theme-muted); margin-bottom: .25rem; }

/* Layout */
.app-main { padding-top: 1.5rem; padding-bottom: 4rem; }
@media (max-width: 991.98px) { .app-main { padding-bottom: 7rem; } }

/* Top bar */
.topbar { background: var(--theme-surface); }
.topbar .navbar { min-height: 60px; }
.brand { font-family: var(--theme-display); font-weight: 600; font-size: 1.3rem; color: var(--theme-heading); }
.brand:hover { color: var(--theme-heading); }
.topbar .nav-link { padding: .45rem .75rem; font-size: .9rem; border-radius: var(--bs-border-radius); }
.topbar .nav-link.active { font-weight: 600; }
.topbar-search { width: 200px; }
.topbar-search-wrap { position: relative; }
.live-results { left: auto; right: 0; width: 360px; }
.live-results .group { display: block; cursor: default; padding: 6px 10px 2px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--theme-muted); }
.live-results .group:hover { background: none; }
.live-results .all { color: var(--theme-heading); font-size: 13px; }
.avatar { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--bs-primary-bg-subtle); color: var(--bs-primary-text-emphasis); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: .8rem; }
.photo { border-radius: 50%; object-fit: cover; }

/* Running timer: its own bar under the menu */
.timer-strip { position: sticky; top: 0; z-index: 1025; background: var(--bs-primary-bg-subtle); border-bottom: 1px solid var(--theme-line); padding: .5rem 0; }
.timer-strip .live { flex: none; margin-left: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--theme-c-blue); box-shadow: 0 0 0 4px rgba(var(--bs-primary-rgb), .2); animation: live 2s ease-in-out infinite; }
.timer-strip .clock { font-family: var(--bs-font-monospace); font-size: 1.05rem; font-weight: 600; color: var(--theme-heading); }
.timer-strip .what { flex: 1; min-width: 0; font-size: .875rem; color: var(--bs-primary-text-emphasis); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timer-strip .what:hover { text-decoration: underline; }
@keyframes live { 50% { box-shadow: 0 0 0 7px rgba(var(--bs-primary-rgb), .05); } }
@media (prefers-reduced-motion: reduce) { .timer-strip .live { animation: none; } }

/* "Se som kunde" */
.topbar { position: relative; z-index: 1035; }
.preview-bar { position: sticky; top: 0; z-index: 1030; padding: .5rem 0; background: var(--theme-purple-bg); color: var(--theme-purple-fg); font-size: .875rem; }
.preview-bar .container-xl { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; }

/* Bottom bar on phones and tablets, and the owner's "Mere" sheet */
.tabbar { z-index: 1030; background: var(--theme-surface); border-top: 1px solid var(--theme-line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around; }
.tabbar a, .tabbar button { min-width: 64px; min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; background: none; border-radius: var(--bs-border-radius-lg); font: inherit; font-size: .7rem; color: var(--theme-muted); text-decoration: none; }
.tabbar [aria-current="page"] { color: var(--theme-heading); font-weight: 600; background: var(--theme-tint); }
.more-sheet.offcanvas-bottom { height: auto; max-height: 85dvh; max-width: 560px; margin: 0 auto; border-radius: 1rem 1rem 0 0; }
.more-sheet .list-group-item { padding: .85rem .25rem; font-size: 1rem; border-radius: var(--bs-border-radius); }
.more-sheet .list-group-item.active { background: var(--theme-tint); color: var(--theme-heading); border-color: transparent; font-weight: 600; }

/* Settings rows with a switch */
.toggle-row { min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .5rem 0; border-top: 1px solid var(--theme-line-soft); }
.toggle-row:first-child { border-top: 0; }
.toggle-row .grow { display: flex; flex-direction: column; color: var(--theme-heading); }
.toggle-row .grow small { color: var(--theme-muted); font-size: .8rem; }
.form-switch .form-check-input { width: 2.6em; height: 1.4em; margin: 0; cursor: pointer; }

/* Cards */
.card-header-tid { padding: 1rem 1.25rem 0; }
.card-header-tid + .card-body { padding-top: .75rem; }
.card-header-tid + div > .list-group { margin-top: .5rem; }

/* Small marks */
.dot { flex: none; width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.dot.round { border-radius: 50%; }
.badge .dot { width: 7px; height: 7px; margin-right: .3rem; }
.c-blue { background: var(--theme-c-blue); } .c-teal { background: var(--theme-c-teal); } .c-amber { background: var(--theme-c-amber); }
.c-purple { background: var(--theme-c-purple); } .c-neutral { background: var(--theme-c-neutral); } .c-red { background: var(--theme-danger); }
.badge { font-weight: 600; }
.late { color: var(--theme-danger); font-weight: 600; }
.soon { color: var(--bs-warning-text-emphasis); font-weight: 600; }

/* Sign-in pages */
.auth { min-height: 100vh; display: flex; flex-direction: column; }
.auth main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 1.5rem 1rem 4rem; }
.auth .box { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 1.4rem; }
.auth h1 { font-family: var(--theme-display); font-weight: 600; font-size: 1.75rem; line-height: 1.2; margin: 0; }
.auth .divider { display: flex; align-items: center; gap: .75rem; font-size: .8rem; color: var(--theme-muted); }
.auth .divider::before, .auth .divider::after { content: ""; flex: 1; border-top: 1px solid var(--theme-line); }
.logo { display: block; line-height: 0; align-self: center; margin: 0 auto; }
.logo img { display: block; height: auto; }
.pre-line { white-space: pre-line; }

/* Meters (Bootstrap progress) and segmented bars (progress-stacked); widths come in as --w */
.progress { --bs-progress-height: 8px; --bs-progress-bg: var(--theme-track); --bs-progress-bar-bg: var(--theme-c-blue); --bs-progress-border-radius: 999px; }
.progress-thin { --bs-progress-height: 5px; }
.progress > .progress-bar { width: var(--w, 0%); }
.progress-stacked.seg { --bs-progress-height: 14px; gap: 2px; background: none; }
.progress-stacked > .progress { width: var(--w, 0%); }
.progress-stacked > .progress > .progress-bar { width: 100%; }

/* Client overview */
.client-card { color: var(--theme-ink); transition: border-color .15s; }
.client-card:hover { border-color: var(--theme-accent); color: var(--theme-ink); }
.text-emphasis { color: var(--theme-heading); }
.fold > .fold-head { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .6rem; padding: var(--bs-card-spacer-y) var(--bs-card-spacer-x); }
.fold > .fold-head::-webkit-details-marker { display: none; }
.fold > .fold-head .card-h { margin: 0; }
.fold-sub { display: block; margin-top: 2px; font: 400 .85rem/1.35 var(--bs-body-font-family); letter-spacing: 0; text-transform: none; color: var(--theme-muted); }
.settings-col { max-width: 820px; display: flex; flex-direction: column; gap: 1rem; }
.setup-lead { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.setup-lead .figure { font-size: 2rem; font-weight: 600; color: var(--theme-heading); line-height: 1; }
.js .no-js-only { display: none; }
.fold-chevron { display: inline-flex; color: var(--theme-muted); transition: transform .15s; }
.fold[open] > .fold-head .fold-chevron { transform: rotate(90deg); }
.fold > .fold-head:focus-visible { outline: 2px solid var(--bs-primary); outline-offset: -2px; border-radius: var(--bs-card-border-radius); }
.device-list { list-style: none; padding: 0; margin: 0; }
.device-list li { display: flex; align-items: center; gap: .6rem; padding: .5rem 0; border-top: 1px solid var(--bs-border-color); }
.device-list li:first-child { border-top: 0; }
.avatar.active { box-shadow: 0 0 0 2px var(--bs-primary); }
.avatar-lg { width: 56px; height: 56px; font-size: 1.1rem; }
.profile-head { flex-direction: row; align-items: center; gap: 1rem; }
.avatar-sq { border-radius: var(--bs-border-radius-sm); width: 28px; height: 28px; font-family: var(--bs-font-monospace); font-size: .65rem; background: var(--theme-tint); color: var(--theme-heading); }
.nav-pills-sm .nav-link { padding: .4rem .85rem; font-size: .85rem; border: 1px solid var(--theme-field); border-radius: 999px; color: var(--theme-heading); }
.nav-pills-sm .nav-link.active { background: var(--theme-heading); border-color: var(--theme-heading); color: var(--theme-surface); }

.btn-link { text-decoration: none; }
.btn { font-weight: 500; }
.btn-primary, .btn-dark { font-weight: 600; }

/* Spacing comes from gap and utilities, not from element margins. */
h1, h2, h3, h4, p { margin-bottom: 0; }
h1, h2, h3, h4 { color: var(--theme-heading); }
textarea.form-control { min-height: 96px; }
.btn-icon { width: 40px; padding-left: 0 !important; padding-right: 0 !important; display: inline-flex; align-items: center; justify-content: center; }
.card-body.empty { color: var(--theme-muted); }
.card-h { font-family: var(--bs-font-monospace); font-weight: 500; font-size: .75rem; letter-spacing: .07em; color: var(--theme-label); text-transform: uppercase; margin: 0; }
.card-pad { padding: 1rem 1.25rem .5rem; }
a.list-row { color: var(--theme-ink); text-decoration: none; }
a.list-row:hover { background: var(--theme-surface-2); }
legend { float: none; font-size: inherit; margin: 0; }
.page-header h1 { margin: 0; }
@media (max-width: 575.98px) { .page-header h1, .greeting { font-size: 1.6rem; } }

/* ------------------------------------------------------------------
   Components with no Bootstrap equivalent: layout helpers, rows in
   cards, board, charts, timeline, thread, document viewer.
   ------------------------------------------------------------------ */
.split { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.split > .main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.split > .side { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.page-crumbs ol { display: flex; flex-wrap: wrap; align-items: center; min-height: 1.75rem; margin: 0 0 .25rem; padding: 0; list-style: none; font-size: .85rem; color: var(--theme-muted); }
.page-crumbs li + li::before { content: "\203A"; margin: 0 .5rem; }
.page-crumbs a { color: inherit; text-decoration: none; }
.page-crumbs a:hover { color: var(--theme-heading); text-decoration: underline; }
.spread:has(> .more-link) { align-items: center; }
.more-link { white-space: nowrap; align-self: center; }
.more-link .arr { display: inline-block; transition: transform .15s; }
.more-link:hover .arr { transform: translateX(2px); }
.spread { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: baseline; justify-content: space-between; }
.card-flush { padding: 0; gap: 0; }
.card-flush > .card-h { padding: 16px 20px 8px; }
.list-row { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; padding: 12px 20px; border-top: 1px solid var(--theme-line-soft); color: var(--theme-ink); text-decoration: none; }
.card-flush > .list-row:first-of-type, .card-flush > .card-h + .list-row { border-top: 0; }
.list-row .grow { flex: 999 1 240px; min-width: 0; display: flex; flex-direction: column; }
.list-row .title { color: var(--theme-heading); font-weight: 500; }
.list-row .meta { font-size: 13px; color: var(--theme-muted); }
.empty { padding: 20px; color: var(--theme-muted); }
.day-head { display: flex; justify-content: space-between; padding: 0 4px; font-family: var(--bs-font-monospace); font-size: 12.5px; letter-spacing: 0.05em; color: var(--theme-label); }
.day-head b { color: var(--theme-heading); font-weight: 500; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--theme-muted); min-width: 0; }
.field > span { font-size: 13px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
fieldset { margin: 0; border: 0; padding: 0; }
legend { padding: 0 0 6px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.mono-chip { flex: none; width: 24px; height: 24px; border-radius: 6px; background: var(--theme-tint); color: var(--theme-heading); display: inline-flex; align-items: center; justify-content: center; font-family: var(--bs-font-monospace); font-size: 10.5px; }
.hbar { display: grid; grid-template-columns: 150px minmax(0, 1fr) 96px; gap: 12px; align-items: center; font-size: 14px; }
.hbar .track { height: 12px; display: flex; gap: 2px; }
.hbar .track > span { width: var(--w, 0%); border-radius: 0 4px 4px 0; }
.hbar .track > span + span { border-radius: 0 4px 4px 0; }
.hbar .val { text-align: right; font-family: var(--bs-font-monospace); font-size: 13px; color: var(--theme-heading); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--theme-body); }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.chart { display: block; width: 100%; font-family: var(--bs-font-monospace); }
.chart .grid line { stroke: var(--theme-line-soft); }
.chart .axis line { stroke: var(--theme-line); }
.chart text { fill: var(--theme-muted); font-size: 11px; }
.chart .axis-title { fill: var(--theme-body); }
.chart .strong { fill: var(--theme-heading); }
.tabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--theme-line); }
@media (max-width: 760px) {
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a { white-space: nowrap; }
}
.tabs a { padding: 10px 14px; margin-bottom: -1px; text-decoration: none; font-size: 14.5px; color: var(--theme-body); border-bottom: 2px solid transparent; }
.tabs a[aria-current="page"] { color: var(--theme-heading); font-weight: 600; border-bottom-color: var(--theme-heading); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 38px; padding: 0 12px; display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; border: 1px solid var(--theme-field); background: var(--theme-surface); color: var(--theme-heading); font: inherit; font-size: 13.5px; text-decoration: none; cursor: pointer; }
.chip[aria-pressed="true"], .chip[aria-current="page"] { background: var(--theme-heading); border-color: var(--theme-heading); color: var(--theme-surface); }
.table-scroll { overflow-x: auto; position: relative; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; font-weight: 500; font-size: 12.5px; color: var(--theme-muted); padding: 10px 12px; }
table.data td { padding: 10px 12px; border-top: 1px solid var(--theme-line-soft); vertical-align: top; }
table.data td.num, table.data th.num { text-align: right; font-family: var(--bs-font-monospace); white-space: nowrap; }
.timer-bar { background: var(--theme-surface); border: 1px solid var(--theme-line); border-radius: 14px; padding: 14px 14px 14px 20px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.timer-panel { background: var(--theme-tint); border: 1px solid var(--theme-line); border-left: 4px solid var(--theme-accent); border-radius: 16px; padding: 20px 22px; display: flex; flex-direction: column; gap: 16px; }
.timer-panel.needs-info { border-left-color: var(--theme-c-amber); }
.timer-head { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; }
.timer-head .clock { font-family: var(--bs-font-monospace); font-size: 34px; line-height: 1; color: var(--theme-heading); min-width: 140px; text-align: right; }
.timer-head .live { flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--theme-c-blue); box-shadow: 0 0 0 4px rgba(var(--bs-primary-rgb), .2); animation: live 2s ease-in-out infinite; }
.timer-what { font-size: 1.15rem; color: var(--theme-heading); }
.timer-body { border-top: 1px solid var(--theme-line); padding-top: 14px; }
.timer-body > summary { color: var(--theme-muted); cursor: pointer; }
.entries-section { margin-top: 8px; }
.filter-bar { padding-bottom: 4px; }
@media (prefers-reduced-motion: reduce) { .timer-head .live { animation: none; } }
.time-range { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 10px; padding: 12px; border: 1px solid var(--theme-line); border-radius: 12px; background: var(--theme-surface); }
.time-range .tr-times { display: flex; align-items: flex-end; gap: 8px; flex: 0 1 auto; min-width: 0; }
.time-range .tr-date { width: 9.5rem; }
.time-range .tr-time, .time-range .tr-dur { width: 6.5rem; min-width: 0; }
@media (max-width: 575.98px) {
  .time-range .tr-date { width: 100%; }
  .time-range .tr-times { flex: 1 1 100%; }
  .time-range .tr-time, .time-range .tr-dur { flex: 1 1 0; width: auto; }
  .time-range .tr-times { gap: 6px; }
  .time-range .tr-time input, .time-range .tr-dur input { padding-inline: 4px; }
  .time-range .tr-sep { padding-bottom: 9px; font-size: 13px; }
}
.time-range .tr-time input, .time-range .tr-dur input { font-family: var(--bs-font-monospace); text-align: center; }
.time-range .tr-dur input { font-weight: 600; }
.time-range .tr-sep { padding-bottom: 9px; color: var(--theme-muted); }
.time-range .tr-note { padding-bottom: 10px; min-width: 3.5rem; }
.time-range .tr-last { padding-bottom: 9px; }
.picker-search { position: relative; }
.picker-search .field { margin-bottom: 4px; }
.picker-results { position: absolute; z-index: 20; left: 0; right: 0; top: 100%; margin: 4px 0 0; padding: 4px; list-style: none; max-height: 320px; overflow-y: auto; background: var(--theme-surface); border: 1px solid var(--theme-line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .12); }
.picker-results li { display: flex; flex-direction: column; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.picker-results li[aria-selected="true"], .picker-results li:hover { background: var(--theme-tint); }
.picker-results .title { color: var(--theme-heading); }
.picker-results .meta { font-size: 12.5px; color: var(--theme-muted); }
.picker-results .none { color: var(--theme-muted); cursor: default; }
.work-picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.timer-bar .clock { font-family: var(--bs-font-monospace); font-size: 26px; color: var(--theme-heading); min-width: 110px; text-align: right; }
.board { display: grid; grid-template-columns: repeat(5, minmax(172px, 1fr)) minmax(150px, .8fr); gap: 12px; align-items: start; min-width: 1070px; }
.board-col { background: var(--theme-sunken); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; min-height: 360px; }
.board-col h2 { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; padding: 2px 4px; }
.board-col h2 .n { font-family: var(--bs-font-monospace); font-size: 12px; font-weight: 500; color: var(--theme-muted); }
.tcard { background: var(--theme-surface); border: 1px solid var(--theme-line-soft); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.tcard .t { color: var(--theme-heading); font-weight: 600; font-size: 14.5px; line-height: 1.35; text-decoration: none; }
.tcard .foot { display: flex; flex-wrap: wrap; gap: 4px 12px; font-family: var(--bs-font-monospace); font-size: 11.5px; color: var(--theme-body); }
.msg { display: flex; gap: 12px; }
.msg .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.msg .bubble { padding: 10px 12px; border-radius: 10px; background: var(--theme-surface-2); border: 1px solid var(--theme-line-soft); overflow-wrap: anywhere; }
.msg .bubble.internal { border-style: dashed; border-color: var(--theme-c-amber); }
.prose h2, .prose h3, .prose h4 { margin: 14px 0 6px; font-size: 17px; }
.prose p, .prose ul, .prose ol { margin: 0 0 10px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose table { border-collapse: collapse; font-size: 14px; }
.prose th, .prose td { border: 1px solid var(--theme-line); padding: 6px 10px; text-align: left; }
.viewer { height: min(75vh, 900px); width: 100%; border: 1px solid var(--theme-line); border-radius: 12px; background: var(--theme-paper); }
@media (max-width: 1023px) {
  .board { grid-template-columns: repeat(6, 240px); min-width: 0; }
}
@media (max-width: 760px) {
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .hbar { grid-template-columns: 110px minmax(0, 1fr) 72px; font-size: 13px; }
}
.plain { text-decoration: none; }
.option { display: flex; flex-direction: column; gap: 2px; padding: 14px; border: 1px solid var(--theme-field); border-radius: 10px; cursor: pointer; }
.option:has(input:checked) { border: 2px solid var(--theme-accent); }
.h-small { font-size: 16px; font-weight: 600; }
.stack.tight { gap: 4px; }
.full-row { flex-basis: 100%; }
.fill-blue { fill: var(--theme-c-blue); }
.fill-teal { fill: var(--theme-c-teal); }
.fill-amber { fill: var(--theme-c-amber); }
.fill-purple { fill: var(--theme-c-purple); }
.fill-neutral { fill: var(--theme-c-neutral); }
.stroke-blue { stroke: var(--theme-c-blue); }
.stroke-heading { stroke: var(--theme-heading); }
.stroke-danger { stroke: var(--theme-danger); }
.chart .danger-text { fill: var(--theme-danger); }
.chart .grid line.base { stroke: var(--theme-line); }
.grow-wide { flex: 999 1 260px; min-width: 0; }
.end-col { align-items: flex-end; min-width: 120px; }
.icon-pill { flex: none; width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--bs-border-radius); }
.title-sm { color: var(--theme-heading); font-weight: 500; font-size: 14.5px; }
.list-card { padding: 14px 16px; }
.doc-chip { width: 36px; height: 36px; border-radius: 8px; color: var(--theme-accent); font-size: 9.5px; }
.toc { margin: 0; padding-left: 22px; columns: 2 260px; column-gap: 32px; font-size: 14px; }
.toc li { padding: 3px 0; break-inside: avoid; }
@media (max-width: 760px) {
  .viewer { height: 70vh; }
}
.filters { display: flex; flex-direction: row; flex-wrap: wrap; align-items: flex-end; gap: 12px; padding: 14px 16px; }
.filters select { min-width: 150px; }
.col-small { min-height: 0; }
.board-wrap { position: relative; padding-bottom: 8px; overflow-x: auto; max-width: 100%; scroll-snap-type: x proximity; overscroll-behavior-x: contain; }
.board-wrap .board-col { scroll-snap-align: start; }
.tcard-head { display: flex; align-items: flex-start; gap: 8px; justify-content: space-between; }
.tcard-head .t { flex: 1; min-width: 0; overflow-wrap: break-word; hyphens: auto; }
.filters[hidden] { display: none; }
.chip.active-filter { background: var(--theme-tint); color: var(--theme-heading); border-color: transparent; }
.tcard.small { gap: 2px; font-size: 13px; overflow-wrap: break-word; hyphens: auto; min-width: 0; }
@media (max-width: 760px) {
  .board { grid-template-columns: repeat(6, 82vw); min-width: 0; }
  .board .board-col { min-height: 0; }
}
.attention-box { border: 2px solid var(--theme-c-amber); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; font-size: 14px; color: var(--theme-muted); }
.steps li { display: flex; flex-direction: column; gap: 6px; }
.steps .bar { height: 6px; border-radius: 999px; background: var(--theme-track); }
.steps .done { color: var(--theme-heading); }
.steps .done .bar { background: var(--theme-c-teal); }
.steps .now { color: var(--theme-heading); font-weight: 600; }
.steps .now .bar { background: var(--theme-c-blue); }
@media (max-width: 760px) {
  .steps { font-size: 11px; gap: 4px; }
}
.composer { display: flex; flex-direction: column; gap: 10px; border: 1px solid var(--theme-field); border-radius: 12px; padding: 10px 12px; }
.composer textarea { box-shadow: none !important; border: 0; min-height: 70px; padding: 4px 0; }
.history { display: flex; gap: 12px; color: var(--theme-body); }
.history .mono { flex: none; width: 120px; font-size: 12px; }
.kv { display: grid; grid-template-columns: minmax(96px, max-content) minmax(0, 1fr); gap: 6px 12px; font-size: 14px; }
.kv > span:nth-child(odd) { color: var(--theme-muted); }
.urgent-note { padding: 10px 12px; border-radius: 10px; background: var(--bs-danger-bg-subtle); color: var(--bs-danger-text-emphasis); font-size: 14px; }
.entry-line { padding-top: 8px; border-top: 1px solid var(--theme-line-soft); color: var(--theme-body); }
.narrow-form { max-width: 760px; }
.urgent-note p + p, .urgent-note p + label { margin-top: 6px; }
.timeline { min-width: 760px; display: grid; grid-template-columns: 260px repeat(7, minmax(0, 1fr)); }
.tl-head, .tl-week { padding: 8px 0; font-family: var(--bs-font-monospace); font-size: 11.5px; color: var(--theme-muted); }
.tl-week { text-align: center; }
.tl-week.now { color: var(--theme-heading); background: var(--theme-tint); border-radius: 6px 6px 0 0; }
.tl-task { grid-column: 1; padding: 10px 12px 10px 0; border-top: 1px solid var(--theme-line-soft); display: flex; flex-direction: column; }
.tl-row { grid-column: 2 / 9; border-top: 1px solid var(--theme-line-soft); display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); align-items: center; background: linear-gradient(90deg, var(--theme-tint) 0, var(--theme-tint) 14.2857%, transparent 14.2857%); }
.tl-bar { grid-row: 1; grid-column: var(--c); height: 14px; margin: 0 4px; border-radius: 4px; }
.tl-dl { grid-row: 1; grid-column: var(--c); justify-self: end; width: 11px; height: 11px; margin: 0 6px; transform: rotate(45deg); background: var(--theme-heading); box-shadow: 0 0 0 2px var(--theme-surface); }
.tl-dl.late-bg { background: var(--theme-danger); }
.greeting { font-family: var(--theme-display); font-weight: 600; font-size: 30px; line-height: 1.2; }
.note-line { padding-top: 10px; border-top: 1px solid var(--theme-line-soft); color: var(--theme-body); }
.now-row { padding: 8px 0; border-top: 1px solid var(--theme-line-soft); align-items: flex-start; color: var(--theme-ink); }
.now-row .dot { margin-top: 7px; }
.date-col { width: 90px; color: var(--theme-body); }
.contact-name { font-family: var(--theme-display); font-weight: 600; font-size: 18px; color: var(--theme-heading); }
.danger-link { color: var(--theme-danger); font-weight: 600; }
.check-row { cursor: pointer; }
.project-row { background: var(--theme-surface-2); padding-block: 6px; flex-wrap: nowrap; }
.project-row .grow { flex: 1 1 auto; min-width: 0; }
.setup-step .step-mark { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; flex: none; border-radius: 50%; border: 1.5px solid var(--theme-line); color: var(--theme-on-accent); }
.setup-step.done .step-mark { background: var(--theme-accent); border-color: var(--theme-accent); }
.setup-step.done .title { color: var(--theme-muted); }
.invoice-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 14px 20px; border-top: 1px solid var(--theme-line-soft); background: var(--theme-surface-2); border-radius: 0 0 var(--bs-border-radius-lg) var(--bs-border-radius-lg); }
.invoice-form .field { flex: 1 1 150px; }
.pre { white-space: pre-line; }
.qr { width: 200px; max-width: 100%; height: auto; border-radius: var(--bs-border-radius); }
.qr .qr-light { fill: var(--theme-qr-light); }
.qr .qr-dark { fill: var(--theme-qr-dark); }
.recovery { font-size: 16px; letter-spacing: .05em; word-spacing: 6px; }
.break { word-break: break-all; }
.tk-name { width: 120px; flex: none; }
.offline-banner { position: fixed; left: 16px; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 50; background: var(--theme-ink); color: var(--theme-bg); padding: 10px 14px; border-radius: 10px; font-size: .875rem; box-shadow: 0 4px 16px rgb(0 0 0 / .2); }
@media (min-width: 900px) {
  .offline-banner { left: auto; bottom: 24px; max-width: 420px; }
}
.inline.nowrap { flex-wrap: nowrap; }
.input-domain { width: 200px; max-width: 50vw; }
@media (max-width: 760px) {
  .chart text { font-size: 16px; }
  .chart .axis-title { font-size: 15px; }
}
.welcome { flex-direction: row; align-items: flex-start; gap: 16px; }
.welcome h1 { font-size: 26px; }
@media (max-width: 760px) {
  .welcome { flex-direction: column; }
}
.check { display: flex; gap: 10px; align-items: flex-start; color: var(--theme-ink); font-size: 15px; cursor: pointer; }
.check input { width: 20px; height: 20px; flex: none; margin: 2px 0 0; accent-color: var(--theme-accent); }
dl.kv { margin: 0; }
dl.kv dd { margin: 0; }
.kv > dt { color: var(--theme-muted); }
dl.kv { grid-template-columns: 120px minmax(0, 1fr); }
[data-show-if][hidden] { display: none; }
.form-actions.spread { align-items: flex-end; }
th a.sort { color: inherit; text-decoration: none; }
th a.sort:hover { text-decoration: underline; }
.mobile-only { display: none; }
@media (max-width: 760px) {
  .mobile-only { display: inline-flex; }
  iframe.viewer { display: none; }
}
.switch-inline { display: inline-flex; align-items: center; padding-left: 0; margin: 0; min-height: 0; }
.switch-inline .form-check-input { float: none; margin-left: 0; }
.steps li { overflow-wrap: break-word; hyphens: auto; }
.table.data { margin-bottom: 0; }
.end-col .badge, .stack > .badge { align-self: flex-end; }
.stack:not(.end-col) > .badge { align-self: flex-start; }

/* Contact block for customers (as on toftec.dk) */
.contact-block { display: flex; flex-direction: column; gap: 1rem; padding-top: 1.25rem; border-top: 1px solid var(--theme-line); }
.contact-methods { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .75rem 1.5rem; }
.contact-method { display: flex; align-items: center; gap: .75rem; }
.contact-method .ic { flex: none; width: 40px; height: 40px; border-radius: var(--bs-border-radius); background: var(--theme-tint); color: var(--theme-heading); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .95rem; }
.contact-method a, .contact-method .name { font-weight: 600; font-size: .95rem; color: var(--theme-heading); text-decoration: none; }
.contact-method a:hover { text-decoration: underline; }
.contact-method .sub { display: block; font-size: .75rem; color: var(--theme-label); margin-top: 1px; }

/* Editor (assets/js/editor.js, Quill snow theme): themed to match form fields */
.editor { display: flex; flex-direction: column; border: 1px solid var(--theme-field); border-radius: var(--bs-border-radius); background: var(--theme-surface); }
.editor:focus-within { border-color: var(--theme-accent); box-shadow: 0 0 0 .25rem var(--bs-focus-ring-color); }
.editor.is-invalid { border-color: var(--theme-danger); }
.editor .ql-toolbar.ql-snow, .editor .ql-container.ql-snow { border: 0; font-family: inherit; }
.editor .ql-toolbar.ql-snow { border-bottom: 1px solid var(--theme-line-soft); padding: 4px 6px; }
.editor .ql-toolbar.ql-snow button { width: 36px; height: 36px; padding: 7px 8px; border-radius: 6px; }
.editor .ql-snow .ql-stroke, .editor .ql-snow .ql-stroke-miter { stroke: var(--theme-body); }
.editor .ql-snow .ql-fill { fill: var(--theme-body); }
.editor .ql-toolbar.ql-snow button:hover, .editor .ql-toolbar.ql-snow button:focus-visible, .editor .ql-toolbar.ql-snow button.ql-active { background: var(--theme-tint); }
.editor .ql-toolbar.ql-snow button:hover .ql-stroke, .editor .ql-toolbar.ql-snow button:focus-visible .ql-stroke, .editor .ql-toolbar.ql-snow button.ql-active .ql-stroke { stroke: var(--theme-accent); }
.editor .ql-toolbar.ql-snow button:hover .ql-fill, .editor .ql-toolbar.ql-snow button:focus-visible .ql-fill, .editor .ql-toolbar.ql-snow button.ql-active .ql-fill { fill: var(--theme-accent); }
.editor .ql-editor { font-size: 1rem; line-height: 1.5; color: var(--theme-heading); min-height: calc(var(--rows, 4) * 1.5em + 24px); }
.editor .ql-editor.ql-blank::before { color: var(--theme-muted); font-style: normal; }
.editor .ql-editor h1, .editor .ql-editor h2, .editor .ql-editor h3 { font-size: 17px; margin: 6px 0 2px; }
.editor .ql-snow a { color: var(--theme-accent); }
.editor .ql-snow .ql-tooltip { background: var(--theme-surface); border-color: var(--theme-line); box-shadow: none; color: var(--theme-body); border-radius: 8px; z-index: 5; }
.editor .ql-snow .ql-tooltip input[type=text] { background: var(--theme-surface); color: var(--theme-heading); border-color: var(--theme-line); }
.editor .ql-snow .ql-tooltip::before { content: "Åbn link:"; }
.editor .ql-snow .ql-tooltip[data-mode=link]::before { content: "Link:"; }
.editor .ql-snow .ql-tooltip a.ql-action::after { content: "Ret"; border-color: var(--theme-line); }
.editor .ql-snow .ql-tooltip.ql-editing a.ql-action::after { content: "Gem"; }
.editor .ql-snow .ql-tooltip a.ql-remove::before { content: "Fjern"; }
.msg .bubble > :last-child { margin-bottom: 0; }

/* Files on tasks (ui_file_input, ui_task_files, assets/js/files.js) */
.file-drop { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 8px 10px; border: 1px dashed var(--theme-field); border-radius: var(--bs-border-radius); }
.file-drop .file-pick { display: none; }
.file-drop .js-only { display: none; }
.file-drop.enhanced .file-pick { display: inline-flex; align-items: center; gap: 6px; }
.file-drop.enhanced .js-only { display: inline; }
.file-drop.enhanced input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.file-drop.enhanced:focus-within .file-pick { box-shadow: 0 0 0 .25rem var(--bs-focus-ring-color); }
.file-drop.dragging { border-color: var(--theme-accent); background: var(--theme-tint); }
.file-drop .file-list { flex-basis: 100%; display: flex; flex-direction: column; gap: 4px; }
.file-drop .file-list:empty { display: none; }
.file-chip { display: flex; align-items: center; gap: 8px; min-width: 0; }
.file-chip .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.file-chip .btn { padding: 0 4px; }
.task-files { display: flex; flex-direction: column; gap: 8px; }
.file-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.file-row a { overflow-wrap: anywhere; }
.version-form { padding: 10px; border-radius: 8px; background: var(--theme-surface-2); }

/* Tiles for documents and files (ui_tiles): thumbnail or file type, name below */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 12px; }
.tiles.tiles-lg { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.tile { position: relative; min-width: 0; --tile-tone: var(--theme-c-neutral); }
.tile.tone-red { --tile-tone: var(--theme-danger); }
.tile.tone-blue { --tile-tone: var(--theme-c-blue); }
.tile.tone-teal { --tile-tone: var(--theme-c-teal); }
.tile.tone-amber { --tile-tone: var(--theme-c-amber); }
.tile.tone-purple { --tile-tone: var(--theme-c-purple); }
.tile-link { display: flex; flex-direction: column; gap: 4px; color: inherit; text-decoration: none; min-width: 0; }
.tile-box { display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; border: 1px solid var(--theme-line-soft); border-radius: 10px; background: var(--theme-surface-2); overflow: hidden; transition: border-color .15s, transform .15s; }
.tile-link:hover .tile-box, .tile-link:focus-visible .tile-box { border-color: var(--theme-accent); transform: translateY(-2px); }
.tile-link:focus-visible { outline: none; }
.tile-link:focus-visible .tile-box { box-shadow: 0 0 0 .25rem var(--bs-focus-ring-color); }
.tile-box img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile-page { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--theme-heading); }
.tile-page svg { color: var(--tile-tone); }
.tile-ext { font-family: var(--bs-font-monospace); font-size: 11px; font-weight: 600; letter-spacing: .04em; padding: 1px 6px; border-radius: 4px; border-bottom: 3px solid var(--tile-tone); background: var(--theme-surface); }
.tile-name { font-size: 14px; font-weight: 500; color: var(--theme-heading); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-link:hover .tile-name { text-decoration: underline; }
.tile-meta { font-size: 12px; color: var(--theme-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-badge { position: absolute; top: 6px; left: 6px; }
@media (prefers-reduced-motion: reduce) { .tile-box { transition: none; } .tile-link:hover .tile-box { transform: none; } }
#lightbox [data-lightbox-image] { max-height: 75vh; object-fit: contain; }
.tile-actions { display: flex; flex-wrap: wrap; gap: 0 4px; margin-top: 2px; }
.tile-actions .btn { padding: 2px 4px; font-size: 13px; }
.tile-history { font-size: 12px; margin-top: 2px; }
.tile-history summary { color: var(--theme-muted); cursor: pointer; }
.tile-history li { overflow-wrap: anywhere; margin-top: 4px; }
.tile-expiry { display: flex; align-items: center; gap: 4px; margin-top: 2px; }

/* App modal (App.confirm): the card surface, not Bootstrap's page background. */
#app-modal .modal-content { background: var(--theme-surface); border-color: var(--theme-line); }
#app-modal [data-modal-body]:empty { display: none; }
