/* Freundes-Ablage – hell, ruhig, wie das Portal (docs/PORTAL-UI.md). Keine Inline-Skripte (CSP). */
@font-face { font-family: "Manrope"; font-weight: 400; font-display: swap; src: url("fonts/manrope-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-weight: 600; font-display: swap; src: url("fonts/manrope-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-weight: 700; font-display: swap; src: url("fonts/manrope-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-weight: 800; font-display: swap; src: url("fonts/manrope-latin-800-normal.woff2") format("woff2"); }

:root {
  --kalk: #f1f3f1; --papier: #fff; --linie: #dde1de; --linie-weich: #eceeec;
  --schiefer: #22282b; --grau: #6b7376; --fell: #8f3a14; --fell-hell: #f3e6dd;
  --moos: #4a6638; --moos-hell: #e5ecdf; --rot: #a8322c; --rot-hell: #f6e2e0;
  --radius: 16px; --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(34,40,43,.04), 0 4px 16px -8px rgba(34,40,43,.10);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--kalk); color: var(--schiefer); font: 15px/1.5 "Manrope", system-ui, sans-serif; min-height: 100vh; }
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--fell); }

.wrap { max-width: 1180px; margin: 0 auto; padding: 20px 16px 80px; }
.top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.top h1 { font-size: 22px; font-weight: 800; margin: 0; letter-spacing: -.01em; flex: 1; min-width: 160px; }
.mark { width: 10px; height: 10px; border-radius: 3px; background: var(--fell); display: inline-block; margin-right: 10px; vertical-align: 2px; }
.chip { background: var(--papier); border: 1px solid var(--linie); border-radius: 999px; padding: 4px 12px; font-size: 13px; color: var(--grau); }
.chip b { color: var(--schiefer); font-weight: 600; }

.btn { border: 1px solid var(--linie); background: var(--papier); border-radius: var(--radius-sm); padding: 8px 14px; cursor: pointer; font-weight: 600; font-size: 14px; transition: background .12s, border-color .12s; white-space: nowrap; }
.btn:hover { border-color: #c8cdc9; background: #fafbfa; }
.btn.primary { background: var(--schiefer); border-color: var(--schiefer); color: #fff; }
.btn.primary:hover { background: #343c40; }
.btn.danger { color: var(--rot); }
.btn.danger:hover { background: var(--rot-hell); border-color: #e7c3bf; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--grau); }
.btn:disabled { opacity: .5; cursor: default; }

.card { background: var(--papier); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.login { max-width: 400px; margin: 10vh auto 0; }
.login h1 { font-size: 24px; font-weight: 800; margin: 0 0 4px; }
.login p { color: var(--grau); margin: 0 0 18px; }
label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 6px; }
input[type=text], input[type=password], input[type=search], select {
  width: 100%; border: 1px solid var(--linie); border-radius: var(--radius-sm); padding: 10px 12px; background: #fff; outline: none; }
input:focus, select:focus { border-color: var(--schiefer); }
.login .btn { width: 100%; margin-top: 16px; padding: 11px; }
.msg { margin-top: 12px; padding: 10px 12px; border-radius: var(--radius-sm); font-size: 14px; }
.msg.err { background: var(--rot-hell); color: var(--rot); }
.msg.ok { background: var(--moos-hell); color: var(--moos); }
.known { background: var(--fell-hell); border-radius: var(--radius-sm); padding: 10px 12px; margin-top: 4px; display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.link { background: none; border: 0; color: var(--fell); cursor: pointer; padding: 0; font-weight: 600; text-decoration: underline; }

.bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.bar .grow { flex: 1; min-width: 180px; }
.folders { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.folders button { border: 1px solid var(--linie); background: var(--papier); border-radius: 999px; padding: 5px 12px; cursor: pointer; font-size: 13px; }
.folders button.on { background: var(--schiefer); color: #fff; border-color: var(--schiefer); }
.newfolder { display: inline-flex; gap: 6px; }
.newfolder input { width: 180px; padding: 5px 10px; border-radius: 999px; font-size: 13px; }

.usage { font-size: 13px; color: var(--grau); display: flex; align-items: center; gap: 8px; }
.meter { width: 120px; height: 6px; background: var(--linie-weich); border-radius: 3px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--moos); width: 0; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.tile { background: var(--papier); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; position: relative; display: flex; flex-direction: column; }
.tile .pic { aspect-ratio: 16/10; background: var(--linie-weich); display: grid; place-items: center; cursor: pointer; position: relative; border: 0; padding: 0; width: 100%; }
.tile .pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile .pic .kind { font-size: 13px; color: var(--grau); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.tile .play { position: absolute; right: 8px; bottom: 8px; background: rgba(34,40,43,.75); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.tile .meta { padding: 10px 12px 12px; font-size: 13px; }
.tile .name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .sub { color: var(--grau); }
.tile .sel { position: absolute; left: 8px; top: 8px; width: 22px; height: 22px; accent-color: var(--schiefer); cursor: pointer; }
.empty { text-align: center; color: var(--grau); padding: 60px 20px; }

.queue { position: fixed; right: 16px; bottom: 16px; width: min(380px, calc(100vw - 32px)); max-height: 50vh; overflow: auto; z-index: 20; }
.queue .card { padding: 14px; }
.qitem { font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--linie-weich); }
.qitem:last-child { border-bottom: 0; }
.qitem .row { display: flex; justify-content: space-between; gap: 8px; }
.qitem .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qitem .meter { width: 100%; margin-top: 4px; }
.qitem.err .meter i { background: var(--rot); }
.qitem.err .st { color: var(--rot); }

.selbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 16px; background: var(--schiefer); color: #fff; border-radius: 999px; padding: 8px 8px 8px 18px; display: flex; gap: 10px; align-items: center; z-index: 19; box-shadow: var(--shadow); }
.selbar .btn { border-color: transparent; }

.drop { position: fixed; inset: 0; background: rgba(241,243,241,.92); border: 3px dashed var(--schiefer); display: grid; place-items: center; font-size: 22px; font-weight: 800; z-index: 30; }

.viewer { position: fixed; inset: 0; background: rgba(20,24,26,.9); z-index: 40; display: flex; flex-direction: column; }
.viewer .vtop { display: flex; gap: 8px; align-items: center; padding: 12px 16px; color: #fff; }
.viewer .vtop .t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.viewer .vbody { flex: 1; display: grid; place-items: center; padding: 0 16px 16px; min-height: 0; }
.viewer video, .viewer img { max-width: 100%; max-height: calc(100vh - 90px); border-radius: var(--radius-sm); background: #000; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--grau); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--linie); }
td { padding: 8px 10px; border-bottom: 1px solid var(--linie-weich); vertical-align: middle; }
.tablewrap { overflow-x: auto; }
.section { margin-top: 18px; }
.section h2 { font-size: 17px; font-weight: 800; margin: 0 0 12px; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.kv div { background: var(--kalk); border-radius: var(--radius-sm); padding: 10px 12px; }
.kv b { display: block; font-size: 18px; }
.kv span { font-size: 12px; color: var(--grau); }
.row2 { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.row2 > * { flex: 1; min-width: 180px; }
.row2 .btn { flex: 0 0 auto; }
.check { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; font-weight: 400; margin: 0; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.muted { color: var(--grau); }
.tag { font-size: 12px; border-radius: 999px; padding: 1px 8px; background: var(--linie-weich); }
.tag.red { background: var(--rot-hell); color: var(--rot); }
.tag.green { background: var(--moos-hell); color: var(--moos); }

@media (max-width: 600px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .tile .meta { padding: 8px 10px 10px; }
  .top h1 { font-size: 19px; }
}
