/* ==========================================================================
   Reiter (Fotos & Videos · Musik · Dokumente), Listen, Musik-Player – im Y2K-Look
   ========================================================================== */

/* ---------- Warnung: schwaches Passwort ---------- */
.sec-banner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 12px 0 0; padding: 8px 10px;
  background: #fff6d6; color: #4a3b00; border: 1px solid #b89a35; box-shadow: var(--shadow); font-size: 12px;
}
.sec-banner span { flex: 1; min-width: 220px; }
@media (prefers-color-scheme: dark) { .sec-banner { background: #3a3218; color: #f1e2a8; border-color: #7d6a2b; } }

/* ---------- Reiter wie Karteikarten ---------- */
.tabs {
  display: flex; gap: 0; margin: 14px 0 0; padding: 0 0 0 4px; overflow-x: auto; scrollbar-width: none;
  border-bottom: 1px solid var(--bev-lo); box-shadow: 0 1px 0 var(--bev-hi);
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 14px 5px; margin: 0 -1px -1px 0; flex: none;
  font: 12px/1.2 var(--ui); color: var(--muted); cursor: pointer;
  background: linear-gradient(var(--surface-2), var(--bg));
  border: 1px solid; border-color: var(--bev-hi) var(--bev-lo) var(--bev-lo) var(--bev-hi); border-bottom: 0;
  position: relative; top: 2px;
}
.tab svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tab small { font: 10px var(--mono); color: var(--muted); }
.tab small::before { content: "("; } .tab small::after { content: ")"; }
.tab:hover { color: var(--text); }
.tab.active {
  top: 0; padding-bottom: 8px; z-index: 1; color: var(--text); font-weight: bold;
  background: var(--surface); border-color: var(--bev-hi) var(--bev-dk) transparent var(--bev-hi);
}
@media (max-width: 760px) {
  .tabs { padding-left: 0; }
  .tab { flex: 1 1 0; min-width: 0; justify-content: center; gap: 5px; padding: 7px 4px 6px; }
  .tab span { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tab small { display: none; }
}

/* ---------- Listen (Musik & Dokumente) ---------- */
#timeline.files { padding-top: 4px; }
.flist, .album-sec { margin-bottom: 18px; }
.tracks, .docs { background: var(--tile); border: 1px solid var(--line); box-shadow: 1px 1px 0 rgba(0, 0, 0, .12); }
.frow, .frow-head {
  display: grid; align-items: center; gap: 10px; padding: 6px 10px 6px 8px; min-height: 40px;
  grid-template-columns: 16px 28px minmax(0, 1fr) auto 56px 28px;
}
.frow { border-top: 1px dotted var(--line); cursor: default; user-select: none; -webkit-user-select: none; position: relative; }
.frow:first-child { border-top: 0; }
.frow:hover { background: color-mix(in srgb, var(--sel) 9%, transparent); }
.frow.selected { background: color-mix(in srgb, var(--sel) 20%, transparent); }
.frow .check {
  width: 14px; height: 14px; border: 1px solid; border-color: var(--bev-lo) var(--bev-hi) var(--bev-hi) var(--bev-lo);
  background: var(--field); box-shadow: inset 1px 1px 0 var(--bev-dk); position: relative; opacity: .35; cursor: pointer;
}
.frow:hover .check, body.selecting .frow .check, .frow.selected .check { opacity: 1; }
.frow.selected .check::after {
  content: ""; position: absolute; left: 4px; top: 0; width: 4px; height: 8px;
  border: solid var(--text); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.frow b { font-weight: normal; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.frow small { display: block; font: 11px var(--mono); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.frow .row-fav svg { width: 13px; height: 13px; fill: #c0444c; stroke: none; display: block; }
.tno, .tdur, .ds, .dd { font: 11px var(--mono); color: var(--muted); text-align: right; white-space: nowrap; }
.tno { text-align: center; }
.row-info {
  width: 26px; height: 26px; display: grid; place-items: center; border: 1px solid transparent; background: none; padding: 0; color: var(--muted); cursor: pointer;
}
.row-info svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.row-info:hover { border-color: var(--bev-hi) var(--bev-lo) var(--bev-lo) var(--bev-hi); color: var(--text); background: var(--surface); }

/* laufender Titel */
.frow.track.playing b { color: var(--accent); font-weight: bold; }
.frow.track.playing .tno { font-size: 0; }
.frow.track.playing .tno::before { content: "▶"; font-size: 10px; color: var(--accent); }

/* Album-Kopf */
.album-head { display: flex; gap: 14px; align-items: flex-end; padding: 14px 2px 8px; border-bottom: 1px dotted var(--line); margin-bottom: 6px; }
.album-cover {
  width: 84px; height: 84px; flex: none; background: var(--tile); border: 1px solid var(--line); padding: 3px;
  display: grid; place-items: center; box-shadow: var(--shadow); color: var(--muted);
}
.album-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.album-cover svg, .pl-cover svg { width: 40%; height: 40%; fill: none; stroke: currentColor; stroke-width: 1.6; }
.album-meta { min-width: 0; display: grid; gap: 3px; justify-items: start; }
.album-meta h2 { font: bold 15px var(--ui); margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.album-meta span { font: 11px var(--mono); color: var(--muted); }
.album-meta .btn { margin-top: 4px; display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; font-size: 11px; }
.album-meta .btn svg { width: 11px; height: 11px; }

/* Dokumente */
.frow.doc { grid-template-columns: 16px 34px minmax(0, 1fr) auto 72px 84px; cursor: pointer; }
.frow-head { min-height: 0; padding-top: 2px; padding-bottom: 4px; grid-template-columns: 16px 34px minmax(0, 1fr) auto 72px 84px; font: 10px var(--mono); color: var(--muted); text-transform: uppercase; }
.dicon { width: 34px; height: 34px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.dicon img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.dicon em { font: bold 9px var(--mono); font-style: normal; color: var(--muted); }
.frow.track { cursor: pointer; }

@media (max-width: 760px) {
  .frow { grid-template-columns: 14px 22px minmax(0, 1fr) auto 44px 26px; gap: 8px; padding: 6px 6px; }
  .frow.doc, .frow-head { grid-template-columns: 14px 34px minmax(0, 1fr) auto 62px; }
  .frow .dd, .frow-head .dd { display: none; }
  .album-cover { width: 64px; height: 64px; }
}

/* ---------- Großansicht für Musik/Dokumente ---------- */
.file-stage { display: grid; justify-items: center; gap: 10px; padding: 24px; color: #ddd; text-align: center; max-width: 90vw; }
.file-stage strong { font: bold 15px var(--ui); color: #fff; word-break: break-word; }
.file-stage span { font: 11px var(--mono); color: #aaa; }
.fs-cover {
  width: min(320px, 70vw); aspect-ratio: 1; display: grid; place-items: center; background: #1d1e21; border: 1px solid #3a3b40; padding: 4px; color: #777;
}
.fs-cover.doc { aspect-ratio: auto; min-height: 160px; }
.fs-cover img { width: 100%; height: 100%; object-fit: contain; display: block; }
.fs-cover svg { width: 30%; height: 30%; fill: none; stroke: currentColor; stroke-width: 1.4; }
.fs-cover em { font: bold 28px var(--mono); font-style: normal; }
.file-stage .btn { display: inline-flex; align-items: center; gap: 6px; }
.file-stage .btn svg { width: 12px; height: 12px; }
.lb-stage .doc-frame { width: min(1100px, 100vw); height: calc(100dvh - 64px); margin-top: 56px; border: 0; background: #fff; }

/* ---------- Musik-Player (über der Statusleiste) ---------- */
.player {
  position: fixed; left: 0; right: 0; bottom: 24px; z-index: 19; height: 56px;
  display: flex; align-items: center; gap: 10px; padding: 4px 8px;
  background: linear-gradient(var(--title-a), var(--title-b));
  border-top: 1px solid var(--bev-hi); box-shadow: 0 -1px 0 var(--bev-lo), 0 -2px 6px rgba(0, 0, 0, .12);
}
.pl-cover {
  width: 44px; height: 44px; flex: none; padding: 2px; display: grid; place-items: center; cursor: pointer; color: var(--muted);
  background: var(--tile); border: 1px solid; border-color: var(--bev-lo) var(--bev-hi) var(--bev-hi) var(--bev-lo);
}
.pl-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pl-meta { min-width: 0; width: 220px; display: grid; }
.pl-meta strong { font: bold 12px var(--ui); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-meta span { font: 11px var(--mono); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-ctrl { display: flex; gap: 2px; }
.pl-ctrl .icon-btn svg { width: 16px; height: 16px; stroke: none; }
.pl-play {
  border: 1px solid; border-color: var(--bev-hi) var(--bev-lo) var(--bev-lo) var(--bev-hi) !important; border-radius: 0 !important;
  background: linear-gradient(var(--surface), var(--surface-2)) !important; box-shadow: 1px 1px 0 var(--bev-dk);
}
.player.on .pl-play { border-color: var(--bev-lo) var(--bev-hi) var(--bev-hi) var(--bev-lo) !important; box-shadow: inset 1px 1px 0 var(--bev-dk); }
.pl-seek { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; font: 11px var(--mono); color: var(--muted); }
.pl-seek input { flex: 1; min-width: 0; accent-color: var(--accent); }
body.has-player main { padding-bottom: 180px; }
body.has-player .uploads { bottom: 88px; }
@media (max-width: 760px) {
  .player { flex-wrap: wrap; height: auto; gap: 4px 8px; padding: 6px 8px; }
  .pl-meta { flex: 1; width: auto; }
  .pl-seek { order: 5; flex-basis: 100%; }
  body.has-player .uploads { bottom: 118px; }
}
@media (min-width: 1100px) { .player { left: var(--side, 0); } }

/* ---------- Passwort-Dialog ---------- */
.pw-form { display: grid; gap: 10px; padding: 12px 14px 14px; }
.pw-form label { display: grid; gap: 4px; font-size: 12px; }
.pw-form small { color: var(--muted); }
.pw-form .hint { font-size: 11px; color: var(--muted); margin: 0; }
.pw-form .err { color: #a3262a; margin: 0; min-height: 1em; font-size: 12px; }

/* Meldungen über dem Player */
body.has-player .toast { bottom: 92px; }
@media (max-width: 760px) { body.has-player .toast { bottom: 124px; } }

/* ---------- QR-Code zum Teilen-Link ---------- */
.share-qr { display: flex; gap: 12px; align-items: center; padding-top: 4px; border-top: 1px dotted var(--line); }
.qr-img { padding: 0; border: 1px solid var(--line); background: #fff; cursor: zoom-in; flex: none; line-height: 0; }
.qr-img img { width: 148px; height: 148px; display: block; image-rendering: pixelated; }
.qr-side { display: grid; gap: 8px; min-width: 0; }
.qr-side p { margin: 0; font-size: 12px; color: var(--muted); }
.qr-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.qr-btns .btn { padding: 4px 9px; font-size: 11px; text-decoration: none; }
[data-share="qr"].on { border-color: var(--bev-lo) var(--bev-hi) var(--bev-hi) var(--bev-lo); box-shadow: inset 1px 1px 0 var(--bev-dk); }
.qr-big {
  position: fixed; inset: 0; z-index: 200; background: #fff; color: #111; cursor: zoom-out;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 20px;
}
.qr-big img { width: min(80vw, 70vh); height: auto; image-rendering: pixelated; }
.qr-big span { font: 12px var(--mono); word-break: break-all; text-align: center; max-width: 90vw; }
.qr-big small { font: 11px var(--ui); color: #777; }
@media (max-width: 480px) { .share-qr { flex-direction: column; align-items: flex-start; } }
.share-list li, .share-list li > *, .share-qr, .qr-side { min-width: 0; }
@media (max-width: 560px) {
  .share-url { flex-wrap: wrap; }
  .share-url input { flex: 1 1 100%; }
  .share-url .btn { flex: 1; }
}

/* ---------- Dialoge nie breiter als der Bildschirm (Handy) ---------- */
/* Grid-Spalte darf schrumpfen, sonst wächst sie mit dem längsten Inhalt (z.B. Link im Eingabefeld) mit */
.dlg-backdrop { grid-template-columns: minmax(0, 1fr); justify-items: center; }
.dlg { min-width: 0; max-width: 100%; overflow-x: hidden; box-sizing: border-box; }
.dlg input, .dlg select, .dlg textarea { min-width: 0; max-width: 100%; box-sizing: border-box; }
.share-new label { min-width: 0; }
.share-list .meta { flex-wrap: wrap; min-width: 0; }
.share-list .meta strong { min-width: 0; max-width: 100%; }
.share-url input { flex: 1 1 0; width: 0; }
@media (max-width: 560px) {
  .dlg-backdrop { padding: 8px; }
  .dlg { padding: 14px 12px 14px; max-height: 92vh; max-height: 92dvh; }
  .dlg header { margin: -14px -12px 12px; }
  .share-new label { flex: 1 1 100%; }
  .share-new [data-share="create"] { flex: 1 1 100%; }
  .qr-img img { width: 132px; height: 132px; }
  .share-url input { flex: 1 1 100%; width: auto; }
}
