/* Öffentliche Mappe (public/mappe.js) und Umbenennen (public/umbenennen.js) – Farben nur über die Variablen des Themas */

/* ---------- Umbenennen ---------- */
.rn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
  vertical-align: middle;
}
.rn .rn-t {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rn-click .rn-t {
  cursor: text;
  border-radius: var(--radius-xs);
}
.rn-click .rn-t:hover {
  background: var(--accent-soft);
}
.rn-pen {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s;
}
.rn-pen .ic {
  width: 14px;
  height: 14px;
}
.rn:hover .rn-pen,
.rn-pen:focus-visible,
.drow.active .rn-pen,
.dv-title .rn-pen,
.mp-it .rn-pen {
  opacity: 1;
}
.rn-pen:hover {
  color: var(--accent);
  background: var(--accent-soft);
}
@media (hover: none) {
  .rn-pen {
    opacity: 1;
  }
}
.rn-edit {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
  max-width: 100%;
}
.rn-in {
  font: inherit;
  min-width: 8ch;
  max-width: 100%;
  padding: 2px 6px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-xs);
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.rn-ext {
  color: var(--muted);
  font-size: 0.92em;
}

/* ---------- Kennzeichen in Listen ---------- */
.mp-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0 7px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 18px;
  color: var(--ok);
  background: var(--ok-soft);
  vertical-align: middle;
  white-space: nowrap;
}
.mp-badge.link {
  color: var(--info);
  background: var(--info-soft);
}
.mp-badge .ic {
  width: 12px;
  height: 12px;
}
.mp-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}
.mp-state.on {
  color: var(--ok);
  font-weight: 600;
}
.mp-state .ic {
  width: 15px;
  height: 15px;
}

/* ---------- Karte in der Projektmappe ---------- */
.mp-card {
  margin-bottom: 14px;
  border: 1px solid color-mix(in srgb, var(--ok) 35%, var(--line));
  background: linear-gradient(180deg, color-mix(in srgb, var(--ok-soft) 55%, var(--panel)) 0, var(--panel) 72px);
}
.mp-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.mp-ico {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  color: var(--ok);
  background: var(--ok-soft);
}
.mp-ico .ic {
  width: 22px;
  height: 22px;
}
.mp-title {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1 1 260px;
}
.mp-title b {
  font-size: 16px;
}
.mp-acts {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.mp-body {
  margin-top: 12px;
  border-radius: var(--radius-sm);
  transition:
    background 0.12s,
    outline-color 0.12s;
  outline: 2px dashed transparent;
  outline-offset: 2px;
}
.mp-body.over {
  outline-color: var(--ok);
  background: var(--ok-soft);
}
.mp-grp + .mp-grp {
  margin-top: 10px;
}
.mp-gh {
  font-size: 12px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0 0 6px;
}
.mp-list {
  display: grid;
  gap: 6px;
}
.mp-list.photos {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.mp-it {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
}
.mp-thumb {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 6px;
  overflow: hidden;
  color: var(--muted);
  background: var(--panel-2);
}
.mp-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.mp-nm {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.mp-nm > .small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mp-it.photo {
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  overflow: hidden;
  position: relative;
}
.mp-it.photo .mp-thumb {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  border-radius: 0;
}
.mp-it.photo .mp-nm {
  padding: 4px 8px 6px;
}
.mp-it.photo .mp-rm {
  position: absolute;
  top: 4px;
  right: 4px;
  background: color-mix(in srgb, var(--panel) 85%, transparent);
}
.mp-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 22px 12px;
  text-align: center;
  color: var(--muted);
  border: 2px dashed var(--line-2);
  border-radius: var(--radius-sm);
}
.mp-empty b {
  color: var(--text);
}
.mp-empty .ic {
  width: 26px;
  height: 26px;
  color: var(--ok);
}
.mp-empty.sm {
  padding: 12px;
}
.mp-foot {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 10px;
}
.mp-foot .ic {
  flex: none;
  width: 14px;
  height: 14px;
  margin-top: 2px;
}

/* ---------- Auswahl ---------- */
.mp-note {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--ok-soft);
  font-size: 13px;
}
.mp-note .ic {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
}
.mp-pickbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 8px;
}
.mp-pickbar input[type='search'] {
  flex: 1 1 200px;
}
.dk-seg.mp-seg {
  flex-wrap: wrap;
  max-width: 100%;
}
.dk-seg.mp-seg button {
  width: auto;
  padding: 0 12px;
  white-space: nowrap;
  font-size: 13px;
}
.mp-pick {
  max-height: min(56vh, 520px);
  overflow: auto;
  display: grid;
  gap: 4px;
}
.mp-prow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  min-width: 0;
}
.mp-prow:hover {
  background: var(--panel-2);
}
.mp-prow.off {
  cursor: default;
  opacity: 0.6;
}
.mp-pth {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--panel-2);
  color: var(--muted);
}
.mp-pth img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.mp-pnm {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.mp-pnm b {
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Vorschau „Das sieht der Kunde“ ---------- */
.mp-pvbar .f {
  max-width: 420px;
}
.mp-pv {
  margin-top: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--bg);
}
.mp-pvhead {
  display: flex;
  flex-direction: column;
  margin-bottom: 8px;
}
.mp-pvhead b {
  font-size: 17px;
}
.mp-pvsec {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
}
.mp-pvsec h4 {
  margin: 0 0 6px;
}
.mp-pvrow {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  border-top: 1px solid var(--line);
  min-width: 0;
}
.mp-pvrow:first-of-type {
  border-top: 0;
}
.mp-pvrow > span:first-of-type {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mp-pvrow .ic {
  flex: none;
  width: 15px;
  height: 15px;
  color: var(--muted);
}
.mp-pvgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 6px;
}
.mp-pvgrid img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}
.mp-pvhid {
  margin-top: 10px;
  font-size: 13px;
}
.mp-pvhid summary {
  cursor: pointer;
  color: var(--muted);
}

/* ---------- Hinweis im Teilen-Dialog ---------- */
.mp-hint {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid color-mix(in srgb, var(--ok) 35%, var(--line));
  background: var(--ok-soft);
  font-size: 13.5px;
}
.mp-hint > .ic {
  flex: none;
  width: 20px;
  height: 20px;
  color: var(--ok);
  margin-top: 1px;
}
.mp-hint > div {
  flex: 1 1 260px;
  min-width: 0;
}

@media (max-width: 640px) {
  .mp-head {
    gap: 8px;
  }
  .mp-acts {
    width: 100%;
  }
  .mp-acts .btn {
    flex: 1 1 auto;
    justify-content: center;
  }
  .mp-list.photos {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Umbenennen im Kopf der Dokumentansicht: Eingabe bekommt die ganze Zeile (vor allem auf dem Handy) */
.dv-head:has(.rn-editing) {
  flex-wrap: wrap;
}
.dv-title:has(.rn-editing) {
  flex-basis: 100%;
  order: -1;
}
.rn.rn-editing {
  display: flex;
  width: 100%;
}
.rn-editing .rn-edit {
  flex: 1;
}
.rn-editing .rn-in {
  flex: 1;
  width: auto;
  min-width: 0;
}
