/* Download-Datenbank – nutzt die Farben des aktiven Styles */
.dl-cats { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.dl-catbtn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; color: var(--muted); font-weight: 700; font-size: .9rem; text-decoration: none; transition: color .2s, box-shadow .2s, border-color .2s; }
.dl-catbtn span { font-size: .72rem; padding: 1px 7px; border-radius: 999px; background: rgba(255,255,255,.08); }
.dl-catbtn:hover { color: var(--text); }
.dl-catbtn.active { color: #fff; border-color: color-mix(in srgb, var(--accent) 70%, transparent); box-shadow: 0 0 16px var(--accent-glow); }
.dl-catbtn.active span { background: var(--accent); color: #fff; }

.dl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.dl-card { display: flex; flex-direction: column; overflow: hidden; color: var(--text); text-decoration: none; transition: transform .2s, box-shadow .2s, border-color .2s; min-width: 0; }
.dl-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 55%, transparent); box-shadow: 0 10px 30px rgba(0,0,0,.45), 0 0 18px var(--accent-glow); color: var(--text); }
.dl-thumb { position: relative; aspect-ratio: 16 / 9; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 35%, #1a1a1f), #141418) center / cover no-repeat; display: grid; place-items: center; }
.dl-thumb > span:first-child { font-size: 3rem; filter: drop-shadow(0 4px 10px rgba(0,0,0,.5)); }
.dl-flag { position: absolute; top: 8px; right: 8px; padding: 2px 9px; border-radius: 999px; font-size: .72rem; font-weight: 800; background: rgba(0,0,0,.7); color: var(--warning); }
.dl-card-body { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px 14px; min-width: 0; }
.dl-cat { font-size: .74rem; font-weight: 700; color: var(--accent-2); text-transform: uppercase; letter-spacing: .04em; }
.dl-title { font-size: 1.02rem; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.dl-meta { font-size: .8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.dl-detail h1 { margin: 0 0 14px; overflow-wrap: anywhere; }
.dl-hero { display: block; width: 100%; max-height: 440px; object-fit: cover; border-radius: 12px; margin-bottom: 18px; border: 1px solid var(--border); }
.dl-box .btn-lg { font-size: 1.05rem; }
.dl-report summary { cursor: pointer; color: var(--muted); font-weight: 700; font-size: .9rem; }
.dl-report summary:hover { color: var(--danger); }

.dl-source { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: start; padding: 16px; border: 1px dashed var(--border); border-radius: 14px; margin-bottom: 16px; }
.dl-source .form-row { margin: 0; min-width: 0; }
.dl-or { align-self: center; font-weight: 800; color: var(--muted); text-transform: uppercase; font-size: .8rem; }
.dl-groups { display: flex; flex-wrap: wrap; gap: 6px 0; }
.dl-queue .card-head { margin-bottom: 8px; }

@media (max-width: 720px) {
  .dl-source { grid-template-columns: 1fr; }
  .dl-or { justify-self: center; }
  .dl-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .dl-cats { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .dl-catbtn { flex: 0 0 auto; }
}
/* Wenn Inhalt und Seitenleiste untereinander stehen: Download-Knopf zuerst */
@media (max-width: 1060px) { .dl-layout > aside { order: -1; } }

/* Lizenzcodes */
.dl-flag-key { top: auto; bottom: 8px; color: #ffd166; }
.dl-license { padding: 14px; border-radius: 12px; border: 1px dashed color-mix(in srgb, #ffd166 60%, transparent); background: rgba(255, 196, 0, .06); }
.dl-license-head { font-size: 1.05rem; }
.dl-license input { width: 100%; text-align: center; font-family: ui-monospace, monospace; letter-spacing: .08em; text-transform: uppercase; }
.dl-license-ok { margin: 0 0 8px; font-size: .85rem; color: var(--success); text-align: center; }
/* Beta */
.dl-flag-beta { top: 8px; right: auto; left: 8px; color: #7ee0ff; }
.dl-beta-set { margin: 4px 0 16px; padding: 12px 14px; border-radius: 12px; border: 1px dashed color-mix(in srgb, #38c6f4 50%, transparent); background: rgba(56, 198, 244, .05); }
.dl-beta-tag { background: rgba(56, 198, 244, .16) !important; color: #7ee0ff !important; border-color: rgba(56, 198, 244, .4) !important; }
.dl-beta-note { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 16px; padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(56, 198, 244, .45); background: linear-gradient(135deg, rgba(56, 198, 244, .12), rgba(56, 198, 244, .04)); }
.dl-beta-note strong { color: #7ee0ff; }
.dl-beta-note p { margin: 2px 0 0; font-size: .92rem; overflow-wrap: anywhere; }
.dl-beta-ico { font-size: 1.5rem; line-height: 1; }
.dl-beta-mini { margin: 0 0 8px; font-size: .82rem; color: #7ee0ff; text-align: center; }

/* ---------- Produktfotos (Galerie) ---------- */
.dl-gallery { margin-bottom: 18px; }
.dl-gal-main { position: relative; display: block; width: 100%; padding: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface-hover); cursor: zoom-in; }
.dl-gal-main img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: contain; margin: 0; border: 0; border-radius: 0; max-height: none; background: var(--surface-hover); }
.dl-gal-main .dl-hero { aspect-ratio: auto; max-height: 440px; object-fit: cover; }
.dl-gal-count { position: absolute; right: 10px; bottom: 10px; padding: 4px 10px; border-radius: 99px; font-size: .78rem; font-weight: 700; color: #fff; background: rgba(0, 0, 0, .55); backdrop-filter: blur(6px); }
.dl-gal-thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.dl-gal-th { flex: 0 0 104px; aspect-ratio: 16 / 10; padding: 0; border-radius: 9px; overflow: hidden; border: 2px solid transparent; background: var(--surface-hover); cursor: pointer; opacity: .65; transition: opacity .15s, border-color .15s; }
.dl-gal-th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dl-gal-th:hover { opacity: 1; }
.dl-gal-th.on { opacity: 1; border-color: var(--accent); }
.dl-flag-pics { top: auto; bottom: 8px; right: auto; left: 8px; color: #fff; }
.dl-gal-edit { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 10px; }
.dl-gal-tools label { white-space: nowrap; }
.dl-gal-item { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface-hover); }
.dl-gal-item img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.dl-gal-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px; font-size: .82rem; }
.dl-gal-tools input[type=number] { width: 58px; padding: 4px 6px; }
.dl-gal-tools .check { margin: 0; font-size: .8rem; }
/* Vollbild */
.dl-lb { position: fixed; inset: 0; z-index: 1000; display: grid; grid-template-rows: 1fr auto; background: rgba(8, 9, 12, .92); backdrop-filter: blur(6px); }
.dl-lb[hidden] { display: none; }
.dl-lb-stage { position: relative; display: grid; place-items: center; padding: 56px 70px 10px; min-height: 0; }
.dl-lb-stage img { max-width: 100%; max-height: calc(100vh - 120px); max-height: calc(100dvh - 120px); object-fit: contain; border-radius: 10px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); user-select: none; }
.dl-lb button { position: absolute; border: 0; cursor: pointer; color: #fff; background: rgba(255, 255, 255, .1); border-radius: 50%; width: 48px; height: 48px; font-size: 1.4rem; display: grid; place-items: center; transition: background .15s; }
.dl-lb button:hover { background: rgba(255, 255, 255, .22); }
.dl-lb-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.dl-lb-next { right: 14px; top: 50%; transform: translateY(-50%); }
.dl-lb-close { right: 14px; top: 12px; }
.dl-lb-info { text-align: center; color: rgba(255, 255, 255, .75); font-size: .88rem; padding: 10px 0 16px; }
@media (max-width: 640px) { .dl-lb-stage { padding: 56px 8px 10px; } .dl-lb-prev, .dl-lb-next { top: auto; bottom: 8px; transform: none; } .dl-gal-th { flex-basis: 84px; } }

/* ---------- Referenzen (1.5.0) ---------- */
.dl-refs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.dl-ref { display: flex; flex-direction: column; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-hover);
  color: var(--text); text-decoration: none; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.dl-ref:hover { transform: translateY(-3px); border-color: var(--border-strong); box-shadow: 0 18px 34px -20px rgba(0, 0, 0, .45); color: var(--text); text-decoration: none; }
.dl-ref-shot { display: block; aspect-ratio: 16 / 10; background: var(--bg-2); border-bottom: 1px solid var(--border); overflow: hidden; }
.dl-ref-shot img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform .4s ease; }
.dl-ref:hover .dl-ref-shot img { transform: scale(1.03); }
.dl-ref-fav { width: 100%; height: 100%; display: grid; place-items: center;
  background: radial-gradient(120% 100% at 0% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%), radial-gradient(120% 100% at 100% 100%, color-mix(in srgb, var(--accent-2) 16%, transparent), transparent 60%); }
.dl-ref-fav b { width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; font-size: 1.6rem; font-weight: 800;
  color: var(--accent-text, #fff); background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 10px 24px -12px var(--accent-glow, rgba(0,0,0,.4)); }
.dl-ref-body { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px 14px; }
.dl-ref-body strong { font-size: .98rem; line-height: 1.3; }
.dl-ref-body small { color: var(--muted); font-size: .8rem; }
.dl-ref-note { margin-top: 6px; color: var(--muted); font-size: .84rem; line-height: 1.4; }

/* Formular */
.dl-ref-row { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 12px; padding: 12px; margin-bottom: 10px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-hover); }
.dl-ref-img { width: 88px; height: 58px; border-radius: 9px; overflow: hidden; display: grid; place-items: center; background: var(--bg-2); border: 1px solid var(--border); color: var(--muted); font-size: 1.4rem; }
.dl-ref-img img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.dl-ref-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dl-ref-wide { grid-column: 1 / -1; }
.dl-ref-tools { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; }
.dl-ref-tools label, .dl-ref-fields > label { display: flex; gap: 8px; align-items: center; margin: 0; font-weight: 500; color: var(--muted); }
.dl-ref-tools input[type=file], .dl-ref-fields input[type=file] { font-size: .8rem; max-width: 230px; }
.dl-ref-edit > .btn { margin: 2px 0 6px; }
@media (max-width: 640px) {
  .dl-ref-row { grid-template-columns: 1fr; }
  .dl-ref-fields { grid-template-columns: 1fr; }
}
