/* NAVO – Ordner-Ansicht: Explorer/Finder-Gefühl in NAVO-Optik */
:root {
  --ox-folder: #4a8ef0;
  --ox-folder-2: #6aa6f7;
  --ox-sel: color-mix(in srgb, var(--accent) 14%, transparent);
  --ox-sel-line: color-mix(in srgb, var(--accent) 55%, transparent);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --ox-folder: #5b9bf6;
    --ox-folder-2: #3f7fdc;
    --ox-sel: color-mix(in srgb, var(--accent) 24%, transparent);
  }
}
:root[data-theme='dark'] {
  --ox-folder: #5b9bf6;
  --ox-folder-2: #3f7fdc;
  --ox-sel: color-mix(in srgb, var(--accent) 24%, transparent);
}

/* Umschalter Ordner-Ansicht | Liste */
.ox-modeseg button {
  width: auto;
  padding: 0 12px;
  gap: 6px;
  display: inline-flex;
  align-items: center;
  font-size: 13.5px;
  font-weight: 550;
  color: var(--muted);
}
.ox-modeseg button.on {
  color: var(--accent);
}
.ox-modeseg button span {
  white-space: nowrap;
}
@media (max-width: 1160px) {
  .ox-modeseg button span {
    display: none;
  }
  .ox-modeseg button {
    width: 34px;
    padding: 0;
    justify-content: center;
  }
}

/* Raster: Baum · Inhalt · Vorschau */
.ox {
  position: relative;
}
.ox-grid {
  position: relative;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr) 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
  min-height: 460px;
}
.ox.pv-open .ox-grid {
  grid-template-columns: 236px minmax(0, 1fr) 300px;
}
.ox-grid > * {
  min-width: 0;
  min-height: 0;
}
.ox-tree {
  border-right: 1px solid var(--line);
}
.ox-pv {
  border-left: 1px solid var(--line);
  overflow-y: auto;
  background: var(--panel-2);
}
.ox:not(.pv-open) .ox-pv {
  visibility: hidden;
}
.ox-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
}

/* Adressleiste */
.ox-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}
.ox-nav {
  display: flex;
  gap: 2px;
  flex: none;
}
.ox-nav .btn {
  width: 32px;
  height: 32px;
  padding: 0;
  display: grid;
  place-items: center;
}
.ox-nav .btn svg {
  width: 17px;
  height: 17px;
}
.ox-nav .btn:disabled {
  opacity: 0.35;
}
.ox-path {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  height: 34px;
  padding: 0 4px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--panel);
}
.ox-path::-webkit-scrollbar {
  display: none;
}
.ox-crumb {
  all: unset;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  border-radius: 6px;
  font-size: 13.5px;
  white-space: nowrap;
  color: var(--text);
  flex: none;
  max-width: 220px;
}
.ox-crumb span {
  overflow: hidden;
  text-overflow: ellipsis;
}
.ox-crumb svg {
  width: 15px;
  height: 15px;
  color: var(--muted);
}
.ox-crumb:hover {
  background: color-mix(in srgb, var(--text) 6%, transparent);
}
.ox-crumb.cur {
  font-weight: 600;
}
.ox-crumb:focus-visible {
  outline: 2px solid var(--accent);
}
.ox-crumb.drop-over {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 2px var(--accent);
}
.ox-sep {
  display: inline-grid;
  place-items: center;
  color: var(--faint);
  flex: none;
}
.ox-sep svg {
  width: 12px;
  height: 12px;
}
.ox-find {
  position: relative;
  width: 220px;
  flex: none;
}
.ox-find svg {
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--muted);
  pointer-events: none;
}
.ox-find input {
  width: 100%;
  height: 34px;
  padding: 0 10px 0 30px;
  border-radius: var(--radius-sm);
}
.ox-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
  min-height: 44px;
}
.ox-tools .btn svg {
  width: 15px;
  height: 15px;
}
.ox-tools .btn.on {
  color: var(--accent);
  background: var(--accent-soft);
}
.ox-clip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
  padding: 2px 4px 2px 10px;
  border: 1px dashed var(--line-2);
  border-radius: 999px;
}
.ox-clip svg {
  width: 14px;
  height: 14px;
}

/* Inhalt */
.ox-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  position: relative;
  outline: none;
  user-select: none;
  padding-bottom: 56px;
}
.ox-body:focus-visible {
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 40%, transparent);
}
.ox.file-over .ox-body {
  background: color-mix(in srgb, var(--accent) 5%, transparent);
  box-shadow: inset 0 0 0 2px var(--accent);
}
.ox-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px 170px 112px;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  min-height: 36px;
}
.ox-head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  min-height: 32px;
}
.ox-head button {
  all: unset;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  padding: 7px 0;
  white-space: nowrap;
}
.ox-head button:hover {
  color: var(--text);
}
.ox-head button:focus-visible {
  outline: 2px solid var(--accent);
  border-radius: 4px;
}
.ox-head .num {
  text-align: right;
}
.ox-rows .ox-row {
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
  content-visibility: auto;
  contain-intrinsic-size: auto 37px;
}
.ox-it {
  cursor: default;
  position: relative;
}
.ox-rows .ox-it:hover {
  background: color-mix(in srgb, var(--text) 4%, transparent);
}
.ox-it.sel,
.ox-rows .ox-it.sel:hover {
  background: var(--ox-sel);
}
.ox-it.focus {
  box-shadow: inset 0 0 0 1px var(--ox-sel-line);
}
.ox-body:not(:focus-within) .ox-it.sel {
  background: color-mix(in srgb, var(--text) 8%, transparent);
}
.ox-it.cut {
  opacity: 0.5;
}
.ox-it.arch {
  color: var(--muted);
}
.ox-it.drop-over {
  background: var(--accent-soft) !important;
  box-shadow: inset 0 0 0 2px var(--accent);
}
.ox.dragging .ox-it[data-drop] {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent);
}
.ox-c-name {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.ox-nm {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13.5px;
  min-width: 0;
}
.is-folder .ox-nm {
  font-weight: 550;
}
.ox-c-mod,
.ox-c-art,
.ox-c-size {
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}
.ox-c-size {
  text-align: right;
}
.is-file .ox-c-size {
  color: var(--text);
}
.ox-c-art {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ox-artdot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--art, var(--art-sonst));
  flex: none;
  display: inline-block;
}
.ox-ico {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  flex: none;
}
.ox-ico svg {
  width: 18px;
  height: 18px;
}
.ox-dico {
  color: var(--art, var(--muted));
}
.ox-fico svg {
  color: var(--fc, var(--ox-folder));
  fill: color-mix(in srgb, var(--fc, var(--ox-folder)) 25%, transparent);
}
.ox-fico.virtuell svg,
.ox-fico.projekt svg,
.ox-fico.kst svg {
  fill: none;
}
.ox-c-name .dk-flag {
  flex: none;
}
.ox-fav svg {
  width: 13px;
  height: 13px;
  color: #d99a00;
  fill: #f5c542;
  display: block;
}
.ox-lock svg {
  width: 13px;
  height: 13px;
  color: var(--muted);
  display: block;
}

/* Große Symbole */
.ox-icons {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(124px, 1fr));
  gap: 8px;
  padding: 12px;
}
.ox-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 6px 8px;
  border-radius: 10px;
  text-align: center;
  border: 1px solid transparent;
}
.ox-tile:hover {
  background: color-mix(in srgb, var(--text) 4%, transparent);
}
.ox-tile.sel {
  border-color: var(--ox-sel-line);
}
.ox-big {
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  position: relative;
}
.ox-bigd {
  width: 78px;
  height: 96px;
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: 5px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  border-top: 3px solid var(--art, var(--art-sonst));
  color: var(--art, var(--muted));
}
.ox-bigd svg {
  width: 30px;
  height: 30px;
}
.ox-bigd.has-img {
  padding: 0;
  background: #fff;
}
.ox-bigd img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
}
.ox-ext {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.ox-bigd.has-img .ox-ext {
  display: none;
}
.ox-folder-shape {
  position: relative;
  width: 84px;
  height: 62px;
  margin-top: 10px;
  border-radius: 4px 8px 8px 8px;
  background: linear-gradient(180deg, var(--fc, var(--ox-folder-2)), var(--fc, var(--ox-folder)));
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
}
.ox-folder-shape::before {
  content: '';
  position: absolute;
  left: 0;
  top: -9px;
  width: 34px;
  height: 12px;
  border-radius: 4px 6px 0 0;
  background: var(--fc, var(--ox-folder));
  filter: brightness(0.92);
}
.ox-folder-shape::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 8px;
  bottom: 0;
  border-radius: 3px 8px 8px 8px;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, #fff 22%, var(--fc, var(--ox-folder-2))),
    var(--fc, var(--ox-folder-2))
  );
}
.ox-bigf.virtuell .ox-folder-shape,
.ox-bigf.projekt .ox-folder-shape,
.ox-bigf.kst .ox-folder-shape {
  --fc: #8b97ab;
}
.ox-badge {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  color: #fff;
}
.ox-badge svg {
  width: 22px;
  height: 22px;
}
.ox-bigf em {
  position: absolute;
  right: 2px;
  top: 6px;
  z-index: 1;
  font-style: normal;
  font-size: 10.5px;
  font-weight: 650;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--panel);
  color: var(--muted);
  border: 1px solid var(--line-2);
}
.ox-tn {
  font-size: 12.5px;
  line-height: 1.3;
  max-width: 100%;
  word-break: break-word;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ox-tile.sel .ox-tn,
.ox-tile.focus .ox-tn,
.ox-tile:hover .ox-tn {
  -webkit-line-clamp: unset;
  display: block;
}
.ox-tflags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
}
.ox-tflags:empty {
  display: none;
}

/* Umbenennen an Ort und Stelle */
.ox-rename {
  font: inherit;
  font-size: 13.5px;
  width: 100%;
  min-width: 120px;
  resize: none;
  padding: 2px 6px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 0 0 3px var(--accent-soft);
  overflow: hidden;
  line-height: 1.35;
  user-select: text;
}
.ox-tile .ox-rename {
  text-align: center;
  font-size: 12.5px;
}

/* Auswahlrahmen */
.ox-band {
  position: absolute;
  display: none;
  border: 1px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  pointer-events: none;
  z-index: 3;
  border-radius: 2px;
}

.ox-empty {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 70px 20px;
  color: var(--muted);
  text-align: center;
}
.ox-empty svg {
  width: 40px;
  height: 40px;
  color: var(--faint);
}
.ox-empty b {
  color: var(--text);
  font-size: 15px;
}
.ox-more {
  display: flex;
  justify-content: center;
  padding: 14px;
}
.ox-status {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 5px 12px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  min-height: 28px;
  white-space: nowrap;
  overflow: hidden;
  font-variant-numeric: tabular-nums;
}
.ox-status span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Kontextmenü */
.ox-menu {
  min-width: 236px;
  padding: 5px;
  z-index: 1000;
}
.ox-menu button {
  display: flex !important;
  align-items: center;
  gap: 10px;
  width: 100%;
}
.ox-menu button svg,
.ox-menu .ic-sp {
  width: 16px;
  height: 16px;
  flex: none;
  color: var(--muted);
  display: inline-block;
}
.ox-menu button.danger svg {
  color: inherit;
}
.ox-menu button span {
  flex: 1;
  text-align: left;
}
.ox-menu kbd {
  font: inherit;
  font-size: 11px;
  color: var(--faint);
  margin-left: 16px;
}
.ox-menu .muted {
  display: flex;
  gap: 10px;
  align-items: center;
}
.ox-menu button:focus-visible {
  outline: none;
  background: var(--accent-soft);
}

/* Vorschau (Finder-Vorschau) */
.ox-pvbox {
  padding: 16px;
  display: grid;
  gap: 10px;
  justify-items: center;
}
.ox-pvbig {
  width: 120px;
  height: 100px;
  display: grid;
  place-items: center;
}
.ox-pvbig.ox-stack svg {
  width: 46px;
  height: 46px;
  color: var(--muted);
}
.ox-pvimg {
  width: 100%;
  max-width: 268px;
  aspect-ratio: 1 / 1.3;
  display: grid;
  place-items: center;
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: 6px;
  overflow: hidden;
  color: var(--art, var(--muted));
  border-top: 3px solid var(--art, var(--art-sonst));
}
.ox-pvimg svg {
  width: 44px;
  height: 44px;
}
.ox-pvimg img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
  display: block;
}
.ox-pvname {
  font-size: 14px;
  text-align: center;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.ox-pvart {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--muted);
  margin-top: -4px;
}
.ox-pvdl {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 5px 12px;
  width: 100%;
  margin: 4px 0 0;
  font-size: 12.5px;
}
.ox-pvdl dt {
  color: var(--muted);
}
.ox-pvdl dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.ox-pvact {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}
.ox-pvact .btn svg {
  width: 15px;
  height: 15px;
}
.ox-pvwarn {
  font-size: 12.5px;
  background: var(--warn-soft);
  color: var(--warn);
  padding: 8px 10px;
  border-radius: 8px;
  width: 100%;
}
.ox-pvwarn svg {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
}
.ox-tip {
  text-align: center;
}

/* Volle Dokumentansicht als Ebene */
.ox-doc {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(980px, 72%);
  z-index: 20;
  background: var(--panel);
  border-left: 1px solid var(--line);
  box-shadow: -12px 0 32px rgba(0, 0, 0, 0.14);
  display: flex;
  flex-direction: column;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.ox .ox-doc {
  top: 0;
}
.ox-docbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
}
.ox-docbar .btn svg {
  width: 16px;
  height: 16px;
}
.ox-docpos {
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.ox-doc .dk-view {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.ox-doc.m {
  position: fixed;
  inset: 0;
  width: auto;
  border-radius: 0;
  z-index: 900;
  padding-top: env(safe-area-inset-top);
}

/* Datum prüfen */
.ox-dcbanner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: -4px 0 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 13px;
}
.ox-dcbanner span {
  flex: 1;
  color: var(--text);
}
.ox-dcbanner svg {
  width: 16px;
  height: 16px;
  flex: none;
}
.ox-dc {
  display: grid;
  gap: 4px;
  max-height: 56vh;
  overflow: auto;
}
.ox-dcrow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px 150px auto auto;
  gap: 10px;
  align-items: center;
  padding: 8px 4px;
  border-bottom: 1px solid var(--line);
}
.ox-dcrow.done {
  grid-template-columns: 1fr;
}
.ox-dcname {
  display: grid;
  min-width: 0;
}
.ox-dcname b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 550;
}
.ox-dcold {
  color: var(--bad);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.ox-share {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

@media (max-width: 1380px) {
  .ox.pv-open .ox-grid {
    grid-template-columns: 220px minmax(0, 1fr) 260px;
  }
  .ox-row {
    grid-template-columns: minmax(0, 1fr) 128px 140px 100px;
  }
  .ox-find {
    width: 180px;
  }
}
@media (max-width: 1180px) {
  .ox-row {
    grid-template-columns: minmax(0, 1fr) 0 130px 96px;
  }
  .ox-c-mod {
    visibility: hidden;
  }
  .ox.pv-open .ox-grid {
    grid-template-columns: 200px minmax(0, 1fr) 240px;
  }
}
@media (max-width: 960px) {
  .ox-grid,
  .ox.pv-open .ox-grid {
    grid-template-columns: 0 minmax(0, 1fr) 0;
  }
  .ox-tree,
  .ox-pv {
    visibility: hidden;
  }
}

/* Handy / App: einfache Liste */
.ox-m .ox-body {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  padding: 0;
  user-select: none;
  -webkit-touch-callout: none;
}
.ox-m .ox-row {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: 'name size' 'name art';
  min-height: 58px;
  padding: 8px 12px;
  gap: 0 10px;
}
.ox-m .ox-c-name {
  grid-area: name;
}
.ox-m .ox-c-mod {
  display: none;
}
.ox-m .ox-c-art {
  grid-area: art;
  justify-content: flex-end;
  font-size: 11.5px;
}
.ox-m .ox-c-size {
  grid-area: size;
}
.ox-m .ox-nm {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-size: 14.5px;
}
.ox-m .ox-ico {
  width: 34px;
  height: 34px;
}
.ox-m .ox-ico svg {
  width: 24px;
  height: 24px;
}
.ox-m .ox-c-name .dk-flag {
  display: none;
}
.ox-m .ox-status {
  border: 0;
  justify-content: center;
}
.ox-m .ox-clip {
  margin: 0 0 8px;
}
.ox-m .is-folder::after {
  content: '›';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--faint);
  font-size: 20px;
}
.ox-m .is-folder .ox-c-size {
  margin-right: 14px;
}
.ox-sheet {
  display: grid;
}
.ox-sheet button {
  all: unset;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 6px;
  font-size: 15.5px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.ox-sheet button svg {
  width: 20px;
  height: 20px;
  color: var(--muted);
}
.ox-sheet button kbd {
  display: none;
}
.ox-sheet button.danger {
  color: var(--bad);
}
.ox-sheet button .muted {
  display: flex;
  gap: 12px;
  align-items: center;
}
.dk-mox {
  width: 100%;
  justify-content: center;
  margin: 0 0 10px;
}
.dk-mox svg {
  width: 16px;
  height: 16px;
}
.ox-m .is-folder {
  grid-template-areas: 'name size';
  grid-template-rows: auto;
}
.ox-m .is-folder .ox-c-art {
  display: none;
}
.ox-m .ox-dcbanner,
.dk-m .ox-dcbanner {
  margin: 0 0 10px;
  font-size: 12.5px;
}
.ox-m .ox-dcbanner .dc-more,
.dk-m .ox-dcbanner .dc-more {
  display: none;
}
