/* NAVO – Dokumente: Ablagebaum · Liste/Kacheln · Filterfeld · Detail. Eigene NAVO-Gestaltung. */
:root {
  --art-ein: #c2410c;
  --art-aus: #0f766e;
  --art-lief: #4f46e5;
  --art-vertrag: #9333ea;
  --art-bau: #0369a1;
  --art-post: #64748b;
  --art-pers: #be123c;
  --art-privat: #a16207;
  --art-sonst: #78716c;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --art-ein: #fb923c;
    --art-aus: #2dd4bf;
    --art-lief: #a5b4fc;
    --art-vertrag: #d8b4fe;
    --art-bau: #7dd3fc;
    --art-post: #cbd5e1;
    --art-pers: #fda4af;
    --art-privat: #facc15;
    --art-sonst: #d6d3d1;
  }
}
:root[data-theme='dark'] {
  --art-ein: #fb923c;
  --art-aus: #2dd4bf;
  --art-lief: #a5b4fc;
  --art-vertrag: #d8b4fe;
  --art-bau: #7dd3fc;
  --art-post: #cbd5e1;
  --art-pers: #fda4af;
  --art-privat: #facc15;
  --art-sonst: #d6d3d1;
}

.dk {
  --dk-tree: 248px;
  --dk-filter: 264px;
  position: relative;
}
.dk-loading {
  padding: 40px;
  text-align: center;
}

/* Kopf */
.dk-head {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  margin: 2px 0 14px;
  flex-wrap: wrap;
}
.dk-titlebox {
  flex: 1;
  min-width: 0;
}
.dk-crumbs {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  color: var(--muted);
  min-height: 18px;
  flex-wrap: wrap;
}
.dk-crumbs a {
  color: var(--muted);
}
.dk-crumbs a:hover {
  color: var(--accent);
  text-decoration: none;
}
.dk-crumbs > span:last-child {
  color: var(--text);
  font-weight: 500;
}
.dk-sep svg {
  width: 12px;
  height: 12px;
  vertical-align: -1px;
  color: var(--faint);
}
.dk-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}
.dk-title h1 {
  font-size: 22px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.dk-count {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.dk-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.dk-actions .btn svg {
  width: 16px;
  height: 16px;
}
.dk-stackbtn.has {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line-2));
  color: var(--accent);
  background: var(--accent-soft);
}
.dk-pill {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 11.5px;
  font-weight: 650;
  margin-left: 4px;
}
.dk-split {
  display: inline-flex;
}
.dk-split .btn:first-child {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}
.dk-split .dk-split-more {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 0 8px;
  border-left: 1px solid color-mix(in srgb, var(--on-accent) 35%, transparent);
}
.dk-morebtn {
  font-size: 18px;
  padding: 0 10px;
}
.dk-treebtn {
  display: none;
}

/* Raster */
.dk-grid {
  display: grid;
  grid-template-columns: var(--dk-tree) minmax(0, 1fr) 0 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
  min-height: 480px;
}
.dk.filter-open .dk-grid {
  grid-template-columns: var(--dk-tree) minmax(0, 1fr) var(--dk-filter) 0;
}
.dk.has-doc .dk-grid {
  grid-template-columns: var(--dk-tree) minmax(340px, 0.9fr) 0 minmax(460px, 1.25fr);
}
.dk-grid > * {
  min-height: 0;
  min-width: 0;
  grid-row: 1;
}
.dk-grid > .dk-tree {
  grid-column: 1;
}
.dk-grid > .dk-main {
  grid-column: 2;
}
.dk-grid > .dk-filter {
  grid-column: 3;
}
.dk-grid > .dk-detail {
  grid-column: 4;
}
.dk-filter,
.dk-detail {
  overflow: hidden;
}
.dk:not(.filter-open) .dk-filter,
.dk.has-doc .dk-filter {
  visibility: hidden;
}
.dk:not(.has-doc) .dk-detail {
  visibility: hidden;
}

/* Ablagebaum */
.dk-tree {
  border-right: 1px solid var(--line);
  background: var(--panel-2);
  overflow-y: auto;
  padding: 10px 8px 16px;
}
.dk-tsec {
  display: grid;
  gap: 1px;
  margin-bottom: 6px;
}
.dk-th {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 12px 8px 4px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.dk-thb {
  all: unset;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  cursor: pointer;
}
.dk-thb:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
.dk-tadd {
  all: unset;
  cursor: pointer;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  color: var(--muted);
}
.dk-tadd:hover {
  background: var(--line);
  color: var(--text);
}
.dk-tadd svg {
  width: 15px;
  height: 15px;
}
.dk-ti {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 6px 6px calc(2px + var(--d, 0) * 14px);
  border-radius: 8px;
  cursor: pointer;
  color: var(--text);
  font-size: 13.5px;
  user-select: none;
}
.dk-ti:hover {
  background: color-mix(in srgb, var(--text) 5%, transparent);
  text-decoration: none;
}
.dk-ti.on {
  background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--line-2);
  font-weight: 600;
}
.dk-ti.on::before {
  content: '';
  position: absolute;
  left: 0;
  top: 7px;
  bottom: 7px;
  width: 3px;
  border-radius: 3px;
  background: var(--accent);
}
.dk-ti.arch {
  color: var(--muted);
}
.dk-ti.drop-over {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 2px var(--accent);
}
.dk.dragging .dk-ti[data-drop] {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
}
.dk-tico svg {
  width: 16px;
  height: 16px;
  color: var(--muted);
  display: block;
}
.dk-ti.on .dk-tico svg,
.dk-ti.inbox .dk-tico svg {
  color: var(--accent);
}
.dk-tl {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dk-tn {
  font-size: 11.5px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.dk-hot {
  font-size: 11px;
  font-weight: 650;
  color: var(--on-accent);
  background: var(--accent);
  border-radius: 999px;
  padding: 1px 7px;
}
.dk-tog,
.dk-tog-sp {
  width: 16px;
  height: 16px;
  flex: none;
}
.dk-tog {
  all: unset;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  color: var(--faint);
  cursor: pointer;
  transition: transform 0.15s;
}
.dk-tog svg {
  width: 12px;
  height: 12px;
}
.dk-tog.open {
  transform: rotate(90deg);
}
.dk-tmenu {
  all: unset;
  cursor: pointer;
  width: 22px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  color: var(--muted);
  opacity: 0;
  font-size: 15px;
  line-height: 1;
}
.dk-ti:hover .dk-tmenu,
.dk-tmenu:focus-visible {
  opacity: 1;
}
.dk-tmenu:hover {
  background: var(--line);
}
.dk-ti:hover .dk-tn {
  display: none;
}
.dk-ti:not(:has(.dk-tmenu)):hover .dk-tn {
  display: inline;
}
.dk-tempty {
  font-size: 12px;
  color: var(--muted);
  padding: 4px 8px 6px;
}
.dk-tfind {
  margin: 2px 4px 6px;
  width: calc(100% - 8px);
  min-height: 30px;
  padding: 4px 9px;
  font-size: 13px;
}
.dk-tpriv {
  margin-top: 10px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

/* Mitte */
.dk-main {
  display: flex;
  flex-direction: column;
  position: relative;
}
.dk-tools {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 12px 14px 8px;
}
.dk-search {
  position: relative;
  flex: 1;
  min-width: 160px;
  display: flex;
  align-items: center;
}
.dk-search > svg {
  position: absolute;
  left: 10px;
  width: 16px;
  height: 16px;
  color: var(--faint);
  pointer-events: none;
}
.dk-search input[type='search'] {
  width: 100%;
  padding-left: 32px;
  padding-right: 86px;
  min-height: 36px;
}
.dk-every {
  position: absolute;
  right: 6px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--panel-2);
  cursor: pointer;
  white-space: nowrap;
}
.dk-every input {
  margin: 0;
}
.dk-tools select {
  width: auto;
  min-height: 36px;
  max-width: 170px;
}
.dk-seg {
  display: inline-flex;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.dk-seg button {
  all: unset;
  cursor: pointer;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--muted);
}
.dk-seg button + button {
  border-left: 1px solid var(--line-2);
}
.dk-seg button.on {
  background: var(--accent-soft);
  color: var(--accent);
}
.dk-seg svg {
  width: 16px;
  height: 16px;
}
.dk-filterbtn svg {
  width: 15px;
  height: 15px;
}
.dk-fcount {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 11px;
  font-weight: 650;
  padding: 0 5px;
  margin-left: 2px;
}
.dk.filter-open .dk-filterbtn {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: transparent;
}

/* Schnellfilter: Reiter mit Zählern */
.dk-quick {
  display: flex;
  gap: 2px;
  padding: 0 10px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.dk-quick::-webkit-scrollbar {
  display: none;
}
.dk-quick {
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
}
.dk-quick:not(.overflow) {
  -webkit-mask-image: none;
  mask-image: none;
}
.dk-q {
  all: unset;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 9px 7px 10px;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.dk-q span {
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  padding: 1px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text) 7%, transparent);
  color: var(--muted);
}
.dk-q:hover {
  color: var(--text);
}
.dk-q.on {
  color: var(--text);
  font-weight: 600;
  border-bottom-color: var(--accent);
}
.dk-q.on span {
  background: var(--accent);
  color: var(--on-accent);
}
.dk-q.zero span {
  opacity: 0.6;
}
.dk-q:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: 6px;
}
.dk-since {
  align-self: center;
  margin-left: 6px;
}
.dk-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 8px 14px 0;
}
.dk-chip {
  all: unset;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  padding: 3px 6px 3px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}
.dk-chip svg {
  width: 12px;
  height: 12px;
}

/* Auswahl-Leiste */
.dk-sel {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--accent-soft);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  font-size: 13px;
}
.dk-sel .spacer {
  flex: 1;
}
.dk-sel .btn svg {
  width: 14px;
  height: 14px;
}
.dk-sel[hidden] {
  display: none;
}

/* Liste */
.dk-body {
  flex: 1;
  overflow-y: auto;
  outline: none;
  padding-bottom: 12px;
}
.dk-lhead,
.dk-row {
  display: grid;
  grid-template-columns: 34px 38px minmax(0, 1fr) auto 88px 104px 34px;
  gap: 0 10px;
  align-items: center;
  padding: 0 12px 0 10px;
}
.dk-lhead {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--muted);
  height: 34px;
}
.dk-lhead button {
  all: unset;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.dk-lhead button:hover {
  color: var(--text);
}
.dk-lhead > :nth-child(4) {
  min-width: 60px;
}
.dk-row {
  min-height: 60px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  position: relative;
  padding-top: 8px;
  padding-bottom: 8px;
}
.dk-row:hover {
  background: var(--panel-2);
}
.dk-row.active {
  background: var(--accent-soft);
}
.dk-row.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
}
.dk-row.sel {
  background: color-mix(in srgb, var(--accent-soft) 70%, var(--panel));
}
.dk-chk {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  cursor: pointer;
}
.dk-chk input {
  margin: 0;
  width: 16px;
  height: 16px;
  cursor: pointer;
}
.dk-ico {
  width: 34px;
  height: 38px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--art) 13%, transparent);
  color: var(--art);
  box-shadow: inset 3px 0 0 var(--art);
}
.dk-ico svg {
  width: 17px;
  height: 17px;
}
.dk-n1 {
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dk-n2 {
  font-size: 12.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 1px;
}
.dk-n2 svg {
  width: 12px;
  height: 12px;
  vertical-align: -1px;
}
.dk-art {
  color: var(--art);
  font-weight: 550;
}
.dk-dot {
  margin: 0 5px;
  color: var(--faint);
}
.dk-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.dk-tags span {
  font-size: 11px;
  padding: 0 6px;
  border-radius: 5px;
  background: color-mix(in srgb, var(--text) 6%, transparent);
  color: var(--muted);
}
.dk-row .dsnip {
  font-size: 12px;
  margin-top: 3px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dk-flags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 230px;
}
.dk-flag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 550;
  padding: 1px 7px;
  border-radius: 999px;
  white-space: nowrap;
  border: 1px solid transparent;
}
.dk-flag svg {
  width: 11px;
  height: 11px;
}
.dk-flag.neu {
  background: var(--info-soft);
  color: var(--info);
}
.dk-flag.zahlen {
  background: var(--warn-soft);
  color: var(--warn);
}
.dk-flag.bad {
  background: var(--bad-soft);
  color: var(--bad);
}
.dk-flag.ok {
  background: var(--ok-soft);
  color: var(--ok);
}
.dk-flag.frei {
  border-color: color-mix(in srgb, var(--ok) 45%, transparent);
  color: var(--ok);
}
.dk-flag.ki {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--accent);
}
.dk-flag.stb {
  border-color: var(--line-2);
  color: var(--muted);
}
.dk-flag.warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.dk-date {
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.dk-amt {
  font-weight: 600;
  font-size: 13.5px;
}
.dk-star {
  all: unset;
  cursor: pointer;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: var(--faint);
  opacity: 0;
}
.dk-star svg {
  width: 17px;
  height: 17px;
}
.dk-row:hover .dk-star,
.dk-tile:hover .dk-star,
.dk-star.on,
.dk-star:focus-visible {
  opacity: 1;
}
.dk-star:hover {
  color: #d97706;
  background: color-mix(in srgb, #d97706 10%, transparent);
}
.dk-star.on {
  color: #d97706;
}
.dk-star.on svg path {
  fill: currentColor;
}
.btn.dk-star {
  opacity: 1;
  width: auto;
  height: 28px;
  padding: 0 8px;
  display: inline-flex;
}
.dk-moreline {
  text-align: center;
  padding: 14px;
}

/* Unterordner */
.dk-subs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 14px 4px;
}
.dk-sub {
  all: unset;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  font-size: 13px;
  max-width: 260px;
}
.dk-sub svg {
  width: 16px;
  height: 16px;
  color: var(--muted);
}
.dk-sub span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dk-sub em {
  font-style: normal;
  font-size: 11.5px;
  color: var(--faint);
}
.dk-sub:hover,
.dk-sub.drop-over {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* Kacheln */
.dk-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
  gap: 14px;
  padding: 14px;
}
.dk-tile {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  cursor: pointer;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition:
    box-shadow 0.12s,
    border-color 0.12s;
}
.dk-tile:hover {
  box-shadow: 0 4px 18px rgba(16, 16, 24, 0.08);
  border-color: var(--line-2);
}
.dk-tile.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.dk-tile.sel {
  border-color: var(--accent);
}
.dk-thumb {
  aspect-ratio: 4 / 3.2;
  background: var(--panel-2);
  display: grid;
  place-items: center;
  overflow: hidden;
  border-bottom: 3px solid var(--art);
  color: var(--art);
}
.dk-thumb > svg {
  width: 34px;
  height: 34px;
  opacity: 0.7;
}
.dk-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
  background: #fff;
}
.dk-tile .dk-chk {
  position: absolute;
  top: 6px;
  left: 6px;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  border-radius: 7px;
  opacity: 0;
}
.dk-tile:hover .dk-chk,
.dk-tile.sel .dk-chk {
  opacity: 1;
}
.dk-tile .dk-star {
  position: absolute;
  top: 6px;
  right: 6px;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
}
.dk-tinfo {
  padding: 8px 10px 10px;
  display: grid;
  gap: 2px;
}
.dk-tinfo .dk-art {
  font-size: 11px;
  text-transform: none;
}
.dk-tinfo .dk-n1 {
  font-size: 13px;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.3;
  min-height: 2.6em;
}
.dk-tinfo .dk-n2 {
  display: flex;
  justify-content: space-between;
  gap: 6px;
}
.dk-tinfo .dk-n2 b {
  color: var(--text);
}
.dk-tinfo .dk-flags {
  justify-content: flex-start;
  margin-top: 4px;
}

/* Leer / Ablagefläche */
.dk-empty,
.dk-drop {
  display: grid;
  justify-items: center;
  gap: 6px;
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
}
.dk-empty > svg,
.dk-drop > svg {
  width: 38px;
  height: 38px;
  color: var(--faint);
}
.dk-empty b,
.dk-drop b {
  color: var(--text);
  font-size: 15px;
}
.dk-drop {
  margin: 18px;
  border: 2px dashed var(--line-2);
  border-radius: 14px;
  background: var(--panel-2);
  padding: 56px 24px;
}
.dk-empty-act {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 8px;
}
.dk.file-over .dk-main::after {
  content: 'Loslassen zum Hochladen';
  position: absolute;
  inset: 8px;
  border: 2px dashed var(--accent);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent-soft) 88%, transparent);
  display: grid;
  place-items: center;
  font-weight: 600;
  color: var(--accent);
  z-index: 5;
  pointer-events: none;
}

/* Filterfeld */
.dk-filter {
  border-left: 1px solid var(--line);
  background: var(--panel-2);
  overflow-y: auto;
  padding: 12px 14px 20px;
}
.dk-fhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.dk-fsec {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 6px;
}
.dk-fh {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.dk-fh .muted {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}
.dk-filter select,
.dk-filter input {
  min-height: 32px;
  padding: 4px 9px;
  font-size: 13px;
  width: 100%;
}
.dk-frow {
  display: flex;
  align-items: center;
  gap: 6px;
}
.dk-frow input {
  min-width: 0;
}
.dk-farts {
  display: grid;
  gap: 1px;
  max-height: 300px;
  overflow-y: auto;
}
.dk-fart {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 4px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}
.dk-fart:hover {
  background: color-mix(in srgb, var(--text) 5%, transparent);
}
.dk-fart input {
  margin: 0;
  width: 15px;
  height: 15px;
  min-height: 0;
  flex: none;
}
.dk-fart i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--art);
  flex: none;
}
.dk-fart span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dk-fart em,
.dk-pillbtn em {
  font-style: normal;
  font-size: 11px;
  color: var(--faint);
}
.dk-fpills {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.dk-pillbtn {
  all: unset;
  cursor: pointer;
  font-size: 12.5px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--panel);
}
.dk-pillbtn:hover {
  border-color: var(--accent);
}
.dk-pillbtn.on {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.dk-pillbtn.on em {
  color: inherit;
  opacity: 0.8;
}
.dk-ffoot {
  padding-top: 12px;
}

/* Detail */
.dk-detail {
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  background: var(--panel);
}
.dk-dnav {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}
.dk-dnav .spacer {
  flex: 1;
}
.dk-dpos {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.dk-dnav .btn svg {
  width: 16px;
  height: 16px;
}
.dk-view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.dk-view .dv-close {
  display: none !important;
}
.dk-view .dv-body {
  min-height: 0;
}

/* Vollbild-Vorschau */
.dk-viewer {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(12, 14, 20, 0.97);
  display: flex;
  flex-direction: column;
  color: #f3f4f6;
}
.dk-vhead {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.dk-vhead b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.dk-vhead .muted {
  color: #a1a1aa;
  font-size: 12.5px;
  white-space: nowrap;
}
.dk-vhead .spacer {
  flex: 1;
}
.dk-vhead .btn {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
  color: #f3f4f6;
}
.dk-vhead .btn:disabled {
  opacity: 0.4;
}
.dk-vbody {
  flex: 1;
  overflow: auto;
  display: flex;
  justify-content: center;
  padding: 18px;
}
.dk-vbody img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  background: #fff;
}
.dk-vpdf {
  width: min(980px, 100%);
  display: grid;
  gap: 14px;
  justify-items: center;
  align-content: start;
}
.dk-vpdf .pdf-page {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  background: #fff;
  max-width: 100%;
  height: auto !important;
}
.dk-vpdf .pdf-info {
  color: #a1a1aa;
}
.dk-vbody .dk-empty b {
  color: #fff;
}
.dk-vbody > .dk-empty {
  align-self: center;
}
.dk-vtext {
  width: min(900px, 100%);
  background: var(--panel);
  color: var(--text);
  border-radius: 8px;
  padding: 18px 22px;
  white-space: pre-wrap;
  font:
    13px/1.5 ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
  align-self: flex-start;
}

/* QR, Art-Auswahl */
.dk-qr {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.dk-qr img {
  width: 220px;
  height: 220px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
}
.dk-qr > div {
  flex: 1;
  min-width: 220px;
}
.dk-qrstat {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}
.dk-qrstat svg {
  width: 16px;
  height: 16px;
}
.dk-artpick {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 18px;
}
.dk-artgrp {
  display: grid;
  gap: 3px;
  align-content: start;
}
.dk-artbtn {
  all: unset;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 7px;
  font-size: 13.5px;
}
.dk-artbtn:hover,
.dk-artbtn:focus-visible {
  background: color-mix(in srgb, var(--art) 12%, transparent);
}
.dk-artbtn i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--art);
}

/* Briefkorb abarbeiten: schlanker Kopf */
.dk-stackhead {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
  flex-wrap: wrap;
}
.dk-stackhead b {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
}
.dk-stackhead b svg {
  width: 18px;
  height: 18px;
  color: var(--accent);
}
.dk-stackhead .spacer {
  flex: 1;
}

/* Mittlere Breiten: Filter schmaler */
@media (max-width: 1360px) {
  .dk {
    --dk-tree: 228px;
    --dk-filter: 244px;
  }
  .dk.has-doc .dk-grid {
    grid-template-columns: var(--dk-tree) minmax(320px, 0.85fr) 0 minmax(440px, 1.2fr);
  }
}
@media (max-width: 1280px) {
  .dk.has-doc .dk-flags {
    display: none;
  }
  .dk.has-doc .dk-lhead,
  .dk.has-doc .dk-row {
    grid-template-columns: 34px 38px minmax(0, 1fr) 0 84px 96px 30px;
  }
}
@media (max-width: 1380px) {
  .dk.filter-open .dk-flags {
    max-width: 150px;
  }
}

/* Tablet (ohne App-Ansicht): Baum als einblendbare Spalte, Detail über der Liste */
@media (max-width: 1099px) {
  .dk-treebtn {
    display: inline-flex;
  }
  .dk .dk-grid,
  .dk.filter-open .dk-grid,
  .dk.has-doc .dk-grid {
    grid-template-columns: minmax(0, 1fr);
    position: relative;
  }
  .dk-tree {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 280px;
    z-index: 6;
    box-shadow: 8px 0 30px rgba(0, 0, 0, 0.15);
    transform: translateX(-102%);
    transition: transform 0.18s;
  }
  .dk.tree-show .dk-tree {
    transform: none;
  }
  .dk-filter {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 300px;
    z-index: 6;
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.15);
  }
  .dk-detail {
    position: absolute;
    inset: 0;
    z-index: 7;
  }
  .dk-grid > .dk-main {
    grid-column: 1;
    grid-row: 1;
  }
  .dk-flags {
    max-width: 140px;
  }
}
@media (max-width: 900px) {
  .dk-lhead,
  .dk-row {
    grid-template-columns: 30px 34px minmax(0, 1fr) 0 80px 92px 30px;
  }
  .dk-flags {
    display: none;
  }
  .dk-tools select {
    max-width: 150px;
  }
}

/* ======================= Handy / App-Ansicht ======================= */
.dk-m {
  padding-bottom: 20px;
}
.dk-msearch {
  margin: 0 0 14px;
}
.dk-msearch input {
  min-height: 44px;
  border-radius: 12px;
  font-size: 16px;
  padding-right: 12px;
}
.dk-mgroup {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 14px;
}
.dk-mrow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  color: var(--text);
  border-bottom: 1px solid var(--line);
  min-height: 52px;
}
.dk-mrow:last-child {
  border-bottom: 0;
}
.dk-mrow:hover {
  text-decoration: none;
  background: var(--panel-2);
}
.dk-mrow.sub {
  padding-left: 38px;
}
.dk-mrow > svg {
  width: 16px;
  height: 16px;
  color: var(--faint);
  flex: none;
}
.dk-mico {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--accent);
  flex: none;
}
.dk-mico svg {
  width: 18px;
  height: 18px;
}
.dk-mlabel {
  flex: 1;
  min-width: 0;
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dk-mlabel small {
  display: block;
  font-weight: 400;
  color: var(--muted);
  font-size: 12.5px;
}
.dk-mn {
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.dk-mrow.hot .dk-mn {
  color: var(--on-accent);
  background: var(--accent);
  border-radius: 999px;
  padding: 1px 9px;
  font-weight: 650;
  font-size: 12px;
}
.dk-mh {
  font-size: 13px;
  font-weight: 650;
  color: var(--muted);
  margin: 18px 4px 8px;
  list-style: none;
  cursor: pointer;
  display: flex;
  gap: 6px;
}
.dk-mdet > summary::-webkit-details-marker {
  display: none;
}
.dk-mdet > summary::after {
  content: '›';
  margin-left: auto;
  transition: transform 0.15s;
}
.dk-mdet[open] > summary::after {
  transform: rotate(90deg);
}
.dk-mempty {
  padding: 14px;
}
.dk-mstack {
  width: 100%;
  justify-content: center;
  min-height: 46px;
  margin-bottom: 6px;
  border-radius: 12px;
  color: var(--accent);
  background: var(--accent-soft);
  border-color: transparent;
  font-weight: 600;
}
.dk-mhead {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
}
.dk-mback {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 14px;
  flex: none;
}
.dk-mback svg {
  width: 16px;
  height: 16px;
}
.dk-mtitle {
  flex: 1;
  min-width: 0;
  display: grid;
}
.dk-mtitle b {
  font-size: 17px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dk-m .dk-tools {
  padding: 0 0 8px;
}
.dk-m .dk-search input[type='search'] {
  padding-right: 12px;
  min-height: 42px;
  font-size: 16px;
  border-radius: 12px;
}
.dk-m .dk-quick {
  padding: 0;
  margin: 0 -2px 6px;
  border: 0;
  gap: 6px;
}
.dk-m .dk-q {
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 6px 12px;
  background: var(--panel);
  margin: 0;
}
.dk-m .dk-q.on {
  background: var(--text);
  color: var(--panel);
  border-color: var(--text);
}
.dk-m .dk-q.on span {
  background: color-mix(in srgb, var(--panel) 25%, transparent);
  color: inherit;
}
.dk-m .dk-chips {
  padding: 0 0 6px;
}
.dk-m .dk-body {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.dk-m .dk-row {
  grid-template-columns: 36px minmax(0, 1fr) auto;
  grid-template-areas: 'ico name amt' 'ico name date';
  padding: 10px 12px;
  gap: 0 10px;
  min-height: 64px;
}
.dk-m .dk-chk,
.dk-m .dk-star,
.dk-m .dk-flags {
  display: none;
}
.dk-m .dk-ico {
  grid-area: ico;
}
.dk-m .dk-name {
  grid-area: name;
}
.dk-m .dk-amt {
  grid-area: amt;
  align-self: end;
}
.dk-m .dk-date {
  grid-area: date;
  align-self: start;
  text-align: right;
  font-size: 12px;
}
.dk-m .dk-row .dk-tags {
  display: none;
}
.dk-m .dk-subs {
  padding: 10px 10px 0;
}
.dk-m .dk-drop {
  margin: 12px;
  padding: 32px 16px;
}
.dk-m .dk-detail {
  position: fixed;
  inset: 0;
  z-index: 60;
  transform: translateX(100%);
  transition: transform 0.2s;
  visibility: visible;
  display: flex;
}
.dk-m.has-doc .dk-detail {
  transform: none;
}
.dk-m .dk-dnav {
  padding: calc(8px + env(safe-area-inset-top)) 10px 8px;
}
.dk-m .dk-view {
  overflow-y: auto;
}
.dk-sel[hidden] {
  display: none;
}

/* Bottom-Sheet */
.dk-sheet {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: flex-end;
  animation: dkFade 0.15s;
}
.dk-sheet-panel {
  width: 100%;
  max-height: 86vh;
  background: var(--panel);
  border-radius: 18px 18px 0 0;
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom);
  animation: dkUp 0.2s;
}
.dk-sheet-grip {
  width: 40px;
  height: 4px;
  border-radius: 4px;
  background: var(--line-2);
  margin: 8px auto 2px;
}
.dk-sheet-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 16px;
}
.dk-sheet-body {
  overflow-y: auto;
  padding: 0 16px 8px;
}
.dk-sheet-panel footer {
  padding: 10px 16px 14px;
  border-top: 1px solid var(--line);
}
.dk-sheet-panel footer .btn {
  width: 100%;
  justify-content: center;
  min-height: 44px;
}
.dk-filter.in-sheet {
  position: static;
  width: auto;
  box-shadow: none;
  border: 0;
  background: transparent;
  padding: 0;
  overflow: visible;
  visibility: visible;
  transform: none;
}
.dk-filter.in-sheet .dk-fhead {
  display: none;
}
@keyframes dkUp {
  from {
    transform: translateY(30%);
    opacity: 0.4;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
@keyframes dkFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  .dk-sheet,
  .dk-sheet-panel,
  .dk-m .dk-detail,
  .dk-tree,
  .dk-tog {
    animation: none;
    transition: none;
  }
}

/* Schmale Liste (Detail offen, Filter offen, kleineres Fenster): zweizeilige Zeilen */
.dk.narrow .dk-lhead {
  display: none;
}
.dk.narrow .dk-row {
  grid-template-columns: 30px 36px minmax(0, 1fr) auto;
  grid-template-areas: 'chk ico name amt' 'chk ico name date';
  gap: 0 10px;
}
.dk.narrow .dk-row .dk-chk {
  grid-area: chk;
}
.dk.narrow .dk-row .dk-ico {
  grid-area: ico;
}
.dk.narrow .dk-row .dk-name {
  grid-area: name;
}
.dk.narrow .dk-row .dk-amt {
  grid-area: amt;
  align-self: end;
}
.dk.narrow .dk-row .dk-date {
  grid-area: date;
  align-self: start;
  text-align: right;
  font-size: 12px;
}
.dk.narrow .dk-row .dk-flags,
.dk.narrow .dk-row .dk-star {
  display: none;
}
.dk.narrow .dk-row .dk-tags {
  display: none;
}
.dk.narrow .dk-seg {
  display: none;
}
.dk.xnarrow .dk-tools select {
  display: none;
}
.dk.xnarrow .dk-filterbtn {
  padding: 0 10px;
}
.dk.has-doc .dk-tiles {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  padding: 10px;
}
.dk-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 16px;
}
.dk-hint svg {
  width: 15px;
  height: 15px;
}
.dk-sdot {
  display: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: 1px;
}
.dk-sdot.neu {
  background: var(--info);
}
.dk-sdot.zahlen {
  background: var(--warn);
}
.dk-sdot.bad {
  background: var(--bad);
}
.dk.narrow .dk-sdot,
.dk-m .dk-sdot {
  display: inline-block;
}

/* Dokument offen bei kleineren Desktop-Breiten: Ablagebaum als einblendbare Spalte, damit die Liste lesbar bleibt */
@media (min-width: 1100px) and (max-width: 1439px) {
  .dk.has-doc .dk-grid {
    grid-template-columns: 0 minmax(330px, 0.9fr) 0 minmax(460px, 1.2fr);
    position: relative;
  }
  .dk.has-doc .dk-tree {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 270px;
    z-index: 6;
    box-shadow: 8px 0 30px rgba(0, 0, 0, 0.15);
    transform: translateX(-102%);
    transition: transform 0.18s;
    border-right: 1px solid var(--line);
  }
  .dk.has-doc.tree-show .dk-tree {
    transform: none;
  }
  .dk.has-doc .dk-treebtn {
    display: inline-flex;
  }
}
.dk-view .dv-tabs {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.dk-view .dv-tabs::-webkit-scrollbar {
  display: none;
}
.dk-view .dv-tabs button {
  white-space: nowrap;
  flex: none;
}
.dk-sel {
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.dk-sel::-webkit-scrollbar {
  display: none;
}
.dk-sel > b {
  white-space: nowrap;
}
.dk-sel .btn {
  flex: none;
}
.dk.narrow .dk-sel .dk-sl {
  display: none;
}
.dk.narrow .dk-sel .btn {
  padding: 0 8px;
}
.dk.has-doc.narrow .dk-tools select {
  display: none;
}
