:root {
    --bg: #0e1116;
    --bg2: #151a22;
    --panel: #171d26;
    --line: #232b36;
    --txt: #e7edf5;
    --muted: #8b98a9;
    --faint: #5c6675;
    --accent: #6ea8fe;
    --accent-soft: rgba(110, 168, 254, 0.14);
    --accent2: #7dd3fc;
    --ok: #4ade80;
    --warn: #fbbf24;
    --err: #f87171;
    --radius: 12px;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--txt);
    font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: 0.2rem 0 1rem; }
h2 { font-size: 1.05rem; margin: 0 0 0.8rem; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.86rem; }
.sub { color: var(--muted); font-weight: 400; font-size: 0.8em; }

.topbar {
    display: flex; align-items: center; gap: 1rem;
    padding: 0.7rem 1.2rem; background: var(--bg2);
    border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10;
    flex-wrap: wrap;
}
.brand { font-weight: 700; color: var(--txt); font-size: 1.05rem; }
.nav { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.nav a {
    color: var(--muted); padding: 0.35rem 0.7rem; border-radius: 8px;
    font-size: 0.92rem;
}
.nav a:hover { background: var(--panel); text-decoration: none; color: var(--txt); }
.nav a.active { background: var(--accent-soft); color: var(--accent); }
.searchbox { margin-left: auto; }
.searchbox input {
    background: var(--bg); border: 1px solid var(--line); color: var(--txt);
    padding: 0.4rem 0.7rem; border-radius: 8px; width: 220px;
}
.logout { color: var(--muted); font-size: 1.2rem; }

.wrap { max-width: 1600px; margin: 0 auto; padding: 1.4rem 1.4rem 3rem; }
.wrap.wide { max-width: 100%; padding: 1.2rem 1.2rem 3rem; }
.footer { text-align: center; color: var(--faint); padding: 1rem; font-size: 0.8rem; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.8rem; margin-bottom: 1.4rem; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.9rem 1rem; }
.card .big { font-size: 1.5rem; font-weight: 700; }
.card .lbl { color: var(--muted); font-size: 0.82rem; margin-top: 0.2rem; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.2rem; }
@media (max-width: 800px) { .two-col { grid-template-columns: 1fr; } }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; margin-bottom: 1.2rem; }

.bars { display: flex; align-items: flex-end; gap: 2px; height: 130px; }
.bars.wide { height: 150px; }
.bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; position: relative; }
.bar-fill { background: linear-gradient(180deg, var(--accent), #3b6fd4); border-radius: 3px 3px 0 0; min-height: 2px; }
.bar-lbl { position: absolute; bottom: -1.1rem; left: 0; right: 0; text-align: center; font-size: 0.62rem; color: var(--faint); }
.clock .bar-fill { background: linear-gradient(180deg, var(--accent2), #2563eb); }

ol.rank { list-style: none; margin: 0; padding: 0; }
ol.rank li { display: flex; align-items: baseline; gap: 0.6rem; padding: 0.28rem 0; border-bottom: 1px solid var(--line); }
ol.rank li:last-child { border-bottom: 0; }
ol.rank .n { color: var(--faint); font-variant-numeric: tabular-nums; min-width: 2.4rem; text-align: right; font-size: 0.85rem; }

.kv { list-style: none; margin: 0; padding: 0; }
.kv li { display: flex; justify-content: space-between; padding: 0.3rem 0; border-bottom: 1px solid var(--line); }
.kv li:last-child { border-bottom: 0; }
.kv.inline { display: flex; flex-wrap: wrap; gap: 1.4rem; }
.kv.inline li { border: 0; gap: 0.4rem; padding: 0; }
.kv span { color: var(--muted); }

table { width: 100%; border-collapse: collapse; }
.list td, .list th { padding: 0.42rem 0.5rem; border-bottom: 1px solid var(--line); text-align: left; }
.list th { color: var(--muted); font-weight: 600; font-size: 0.82rem; }
.table-shell { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.4rem 0.7rem; overflow-x: auto; }
.rank-table td { vertical-align: middle; }
.cover-cell { width: 46px; }
.cover-cell img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; }
.cover-fallback {
    width: 40px; height: 40px; border-radius: 6px; background: var(--bg2);
    display: flex; align-items: center; justify-content: center; color: var(--faint);
}
.cover-fallback.big { width: 120px; height: 120px; font-size: 2.4rem; border-radius: 12px; }

.entity-head { display: flex; gap: 1.4rem; align-items: flex-end; margin-bottom: 1.4rem; }
.entity-img img { width: 120px; height: 120px; object-fit: cover; border-radius: 12px; }
.entity-head h1 { margin: 0.1rem 0 0.5rem; }

.tabs { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.tab { padding: 0.35rem 0.8rem; border-radius: 8px; color: var(--muted); background: var(--panel); border: 1px solid var(--line); font-size: 0.9rem; }
.tab:hover { text-decoration: none; color: var(--txt); }
.tab.active { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.tab.small { font-size: 0.82rem; padding: 0.28rem 0.6rem; }
.filter-row { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.8rem; }

.btn { background: var(--bg2); border: 1px solid var(--line); color: var(--txt); padding: 0.45rem 0.9rem; border-radius: 8px; cursor: pointer; font-size: 0.9rem; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: #06121f; border-color: transparent; font-weight: 600; }

input, select, textarea {
    background: var(--bg); border: 1px solid var(--line); color: var(--txt);
    padding: 0.45rem 0.6rem; border-radius: 8px; width: 100%; font: inherit;
}
label { display: block; color: var(--muted); font-size: 0.84rem; margin: 0.5rem 0 0.25rem; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; margin: 0 0 1.2rem; }
legend { color: var(--accent); padding: 0 0.5rem; font-weight: 600; }
.two-col > div { min-width: 0; }
.settings-form .btn { margin-top: 0.4rem; }
.inline-form { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.inline-form input { width: auto; }
.more { display: inline-block; margin-top: 0.6rem; font-size: 0.88rem; }
.empty { text-align: center; color: var(--muted); padding: 1.5rem; }

.pager { display: flex; gap: 1rem; align-items: center; justify-content: center; margin-top: 1.2rem; }

.banner { padding: 0.7rem 1rem; border-radius: 10px; margin-bottom: 1rem; }
.banner.ok { background: rgba(74, 222, 128, 0.12); color: var(--ok); }
.banner.err { background: rgba(248, 113, 113, 0.12); color: var(--err); }
.tag { font-size: 0.78rem; padding: 0.1rem 0.5rem; border-radius: 6px; background: var(--bg2); color: var(--muted); }
.tag.lvl-info { color: var(--accent2); }
.tag.lvl-warn { color: var(--warn); }
.tag.lvl-error { color: var(--err); }

.login-card { max-width: 360px; margin: 8vh auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; }
.login-card h1 { text-align: center; }
.login-card .btn { width: 100%; margin-top: 1rem; }
.placeholder { text-align: center; padding: 2.5rem 1rem; }
.placeholder .big-ico { font-size: 2.6rem; display: block; margin-bottom: 0.6rem; }
.placeholder ul { display: inline-block; text-align: left; }

/* ---------------------------------------------------------------- timeline */
.tl-toolbar { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
.tl-toolbar #tl-hint { margin-left: auto; }
.btn.tiny { padding: 0.25rem 0.55rem; font-size: 0.82rem; }
.tl-wrap { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.3rem; }
#tl-canvas { width: 100%; height: 300px; display: block; cursor: crosshair; touch-action: none; }
#tl-canvas:active { cursor: crosshair; }
.tl-lanes { margin: 0.6rem 0 1.2rem; }
.tl-lane { position: relative; height: 34px; margin: 4px 0; }
.tl-lane-track { position: absolute; inset: 0; border-radius: 6px; background: var(--bg2); border: 1px solid var(--line); overflow: hidden; cursor: crosshair; }
.tl-lane-label { position: absolute; left: 6px; top: 6px; font-size: 0.76rem; color: var(--txt); background: rgba(0,0,0,0.55); border-left: 3px solid var(--accent); padding: 2px 7px; border-radius: 6px; pointer-events: none; }
.tl-event { position: absolute; top: 4px; bottom: 4px; border-radius: 4px; color: #06121f; font-size: 0.72rem; line-height: 1.5; padding: 0 5px; overflow: hidden; white-space: nowrap; cursor: pointer; opacity: 0.9; }
.tl-event:hover { opacity: 1; box-shadow: 0 0 0 1px #fff inset; }
.tl-top-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem 1.6rem; }
.tl-top-cols h3 { font-size: 0.82rem; color: var(--muted); margin: 0 0 0.3rem; text-transform: uppercase; letter-spacing: 0.04em; }
.tl-top-cols > div { min-width: 0; }
.tl-top-cols .rank li { display: flex; align-items: center; gap: 0.45rem; min-width: 0; }
.tl-top-cols .rank .n { min-width: 1.9rem; flex: 0 0 auto; }
.tl-cover { width: 26px; height: 26px; border-radius: 4px; object-fit: cover; flex: 0 0 auto; }
.tl-cover.ph { display: flex; align-items: center; justify-content: center; background: var(--bg2); color: var(--faint); font-size: 0.78rem; }
.tl-link { display: flex; flex-direction: column; min-width: 0; overflow: hidden; line-height: 1.25; }
.tl-link b, .tl-link .small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 820px) { .tl-top-cols { grid-template-columns: 1fr; } }
.tl-cats { display: flex; flex-direction: column; gap: 0.3rem; }
.tl-cat { display: flex; align-items: center; gap: 0.5rem; padding: 0.25rem 0.4rem; border: 1px solid var(--line); border-radius: 8px; }
.tl-cat input[type=color] { width: 26px; height: 22px; padding: 0; border: 0; background: none; }
.tl-cat .nm { flex: 1; cursor: pointer; }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal.hidden { display: none; }
.modal-box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.3rem; width: min(460px, 92vw); }
.modal-box h2 { margin-bottom: 0.6rem; }
.modal-actions { display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 1rem; }

/* ---------------------------------------------------------------- now playing / filter */
.filters { display: flex; gap: 0.3rem; }
.chip { font-size: 0.78rem; padding: 0.25rem 0.6rem; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); background: var(--panel); white-space: nowrap; }
.chip.on { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.chip:hover { text-decoration: none; }
.np-slot:empty { display: none; }
.np-bar { display: flex; align-items: center; gap: 0.6rem; padding: 0.4rem 1.2rem; background: linear-gradient(90deg, rgba(110,168,254,0.14), transparent 70%); border-bottom: 1px solid var(--line); font-size: 0.9rem; }
.np-dot { color: var(--ok); animation: np-pulse 1.6s ease-in-out infinite; }
.np-title { color: var(--muted); }
@keyframes np-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ---------------------------------------------------------------- immich / photos */
.tl-photo-lane { height: 48px; }
.tl-photo { position: absolute; top: 6px; width: 32px; height: 34px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); cursor: pointer; background: var(--bg2); }
.tl-photo:hover { border-color: var(--accent2); z-index: 5; }
.tl-photo-bar { position: absolute; bottom: 3px; background: linear-gradient(180deg, var(--accent2), #2563eb); border-radius: 3px 3px 0 0; opacity: 0.8; cursor: pointer; }
.tl-photo-bar:hover { opacity: 1; }
.tl-photo-empty { position: absolute; left: 8px; top: 12px; font-size: 0.75rem; color: var(--faint); }

.lightbox { display: flex; gap: 1rem; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; width: min(1100px, 94vw); max-height: 92vh; }
.lightbox-media { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; background: #000; border-radius: 8px; overflow: hidden; }
.lightbox-media img, .lightbox-media video { max-width: 100%; max-height: 82vh; display: block; }
.lightbox-side { width: 290px; flex: 0 0 auto; display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; }
.lightbox-side h3 { margin: 0; font-size: 0.95rem; word-break: break-all; }
.lightbox-nav { display: flex; gap: 0.4rem; margin-top: auto; }
@media (max-width: 820px) { .lightbox { flex-direction: column; } .lightbox-side { width: auto; } }

.ev-photos { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.3rem; }
.ev-photo { position: relative; }
.ev-photo img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.ev-photo-del { position: absolute; top: -6px; right: -6px; background: var(--err); color: #000; border: 0; border-radius: 50%; width: 18px; height: 18px; cursor: pointer; font-size: 0.7rem; line-height: 1; padding: 0; }
.tag.ok { color: var(--ok); }

.sc-pinned { display: inline-flex; gap: 2px; vertical-align: middle; }
.sc-thumb { width: 26px; height: 26px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); }
.ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 0.4rem; max-height: 60vh; overflow-y: auto; margin: 0.5rem 0; }
.ph-item { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; cursor: pointer; border: 2px solid transparent; }
.ph-item:hover { border-color: var(--accent); }

/* Personen-Auswahl + Monatscover */
.tl-person-wrap { display: flex; align-items: center; gap: 0.35rem; color: var(--muted); font-size: 0.85rem; }
.tl-person-wrap select { width: auto; max-width: 230px; padding: 0.25rem 0.4rem; }
.tl-photo-lane { height: 66px; }
.tl-photo-bar.person { background: linear-gradient(180deg, #f59e0b, #b45309); }
.tl-mcover { position: absolute; top: 3px; width: 30px; height: 30px; object-fit: cover; border-radius: 5px; border: 1px solid var(--line); cursor: pointer; z-index: 2; background: var(--bg2); }
.tl-mcover:hover { border-color: var(--accent); z-index: 6; }
.tl-mcover.pinned { border-color: var(--warn); box-shadow: 0 0 0 1px var(--warn); }

/* ---------------------------------------------------------------- timeline layout */
.tl-layout { display: grid; grid-template-columns: minmax(230px, 320px) minmax(0, 1fr) minmax(230px, 320px); gap: 1.2rem; align-items: start; margin-bottom: 1.4rem; }
.tl-side { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.tl-people-list { max-height: 460px; }
.tl-center { min-width: 0; }
.tl-layout .panel { margin-bottom: 0; padding: 0.75rem 0.85rem; }
.tl-layout .panel h3 { font-size: 0.86rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin: 0 0 0.5rem; }
.tl-preview { width: 100%; aspect-ratio: 4 / 3; background: var(--bg2); border-radius: 8px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.tl-preview img { width: 100%; height: 100%; object-fit: cover; cursor: pointer; }
.tl-people-list { max-height: 460px; overflow-y: auto; font-size: 0.86rem; }
.tl-person-row { display: flex; justify-content: space-between; gap: 0.4rem; padding: 0.16rem 0; border-bottom: 1px solid var(--line); }
.tl-person-row b { color: var(--accent2); font-variant-numeric: tabular-nums; }
.tl-top-link { display: flex; gap: 0.6rem; align-items: center; color: var(--txt); }
.tl-top-link:hover { text-decoration: none; }
.tl-top-link .tl-cover { width: 54px; height: 54px; border-radius: 6px; }
.tl-top-item b { display: block; line-height: 1.2; }
.tl-top-item .tag { display: inline-block; margin-top: 0.25rem; }
.tl-top-tracks { font-size: 0.86rem; }
.tl-top-track { display: flex; flex-direction: column; padding: 0.2rem 0; border-bottom: 1px solid var(--line); }
.tl-top-track .tag { align-self: flex-start; margin-top: 0.15rem; }
@media (max-width: 1050px) { .tl-layout { grid-template-columns: 1fr; } }

/* Scrobble-Popup + Galerie */
.modal-box.wide { width: min(920px, 94vw); max-height: 88vh; display: flex; flex-direction: column; }
.scrob-list { overflow-y: auto; max-height: 62vh; }
.scrob-row { display: grid; grid-template-columns: 155px minmax(0, 1fr) minmax(0, 1.4fr); gap: 0.6rem; padding: 0.22rem 0; border-bottom: 1px solid var(--line); align-items: baseline; font-size: 0.9rem; }
.scrob-row a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 0.4rem; overflow-y: auto; max-height: 64vh; padding: 0.2rem; }
.gal-item { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; cursor: pointer; background: var(--bg2); border: 1px solid var(--line); }
.gal-item:hover { border-color: var(--accent); }

/* Hover-Leiste über der Timeline */
.tl-hoverbar { display: flex; align-items: center; gap: 0.35rem; margin: 0.3rem 0; min-height: 1.1rem; }
.tl-hoverbar.hidden { display: none; }
.tl-hover-label { font-size: 0.82rem; color: var(--accent2); margin-right: 0.2rem; white-space: nowrap; }
.lb-people { display: flex; flex-wrap: wrap; gap: 0.25rem; margin: 0.2rem 0 0.4rem; font-size: 0.82rem; }

/* Zeitleisten-Container */
.tl-container { position: relative; border-left: 3px solid var(--accent); background: var(--panel); border-radius: 8px; margin: 6px 0; padding: 4px 8px 8px; }
.tl-container-head { display: flex; align-items: center; gap: 0.4rem; font-size: 0.82rem; color: var(--muted); margin-bottom: 4px; }
.tl-container-rows { position: relative; }
.tl-container-empty { font-size: 0.75rem; color: var(--faint); padding: 4px 0; }
.tl-event { position: absolute; height: 20px; line-height: 20px; border-radius: 4px; color: #06121f; font-size: 0.72rem; padding: 0 6px; overflow: hidden; white-space: nowrap; cursor: pointer; opacity: 0.92; }
.tl-event:hover { opacity: 1; box-shadow: 0 0 0 1px #fff inset; }

.tl-cat { display: block; border: 1px solid var(--line); border-radius: 8px; padding: 0.4rem 0.55rem; margin-bottom: 0.5rem; }
.tl-cat-head { display: flex; align-items: center; gap: 0.4rem; }
.tl-cat-head .nm { cursor: pointer; font-weight: 600; }
.tl-cat-head input[type=color] { width: 26px; height: 22px; padding: 0; border: 0; background: none; }
.tl-cat-entries { margin-top: 0.3rem; }
.tl-ev-row { display: flex; align-items: center; gap: 0.4rem; padding: 0.15rem 0; border-bottom: 1px solid var(--line); font-size: 0.86rem; }
.tl-ev-row:last-child { border-bottom: 0; }
.spacer { flex: 1; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }

/* Container: eine Zeile, kompakt */
.tl-container { padding: 3px 8px 5px; }
.tl-container-row { position: relative; height: 22px; }
.tl-container-head { margin-bottom: 2px; }

/* Timeline-Steuerung in der rechten Spalte */
.tl-controls { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.tl-side .tl-person-wrap { display: flex; align-items: center; gap: 0.35rem; margin: 0.3rem 0; font-size: 0.85rem; color: var(--muted); }
.tl-side .tl-person-wrap select { flex: 1; min-width: 0; }
.tl-side #tl-gallery-btn { width: 100%; }
.tl-side #tl-hint { margin: 0.5rem 0 0; line-height: 1.35; }

/* Container-Zeile: Balken nicht hinauslaufen lassen */
.tl-container-row { overflow: hidden; }

/* Recap */
.recap-hero-inner { display: flex; align-items: center; gap: 1rem; color: var(--txt); }
.recap-hero-inner:hover { text-decoration: none; }
.recap-hero-inner img { width: 130px; height: 130px; object-fit: cover; border-radius: 12px; }
.recap-hero-name { font-size: 1.6rem; font-weight: 700; }
.recap-new { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.recap-chip { display: flex; align-items: center; gap: 0.45rem; background: var(--bg2); border: 1px solid var(--line); border-radius: 999px; padding: 0.25rem 0.7rem 0.25rem 0.3rem; color: var(--txt); font-size: 0.86rem; }
.recap-chip:hover { border-color: var(--accent); text-decoration: none; }
.recap-chip img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.recap-chip .cover-fallback { width: 26px; height: 26px; border-radius: 50%; font-size: 0.8rem; }

/* Recap: kleiner & Duo */
.recap-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 800px) { .recap-duo { grid-template-columns: 1fr; } }
.recap-hero-inner img { width: 84px; height: 84px; }
.recap-hero-name { font-size: 1.15rem; }
.recap-chip { font-size: 0.78rem; padding: 0.15rem 0.55rem 0.15rem 0.2rem; }
.recap-chip img { width: 18px; height: 18px; }
.recap-chip .cover-fallback { width: 18px; height: 18px; font-size: 0.7rem; }
.recap-albums { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 0.7rem; }
.recap-album { display: flex; flex-direction: column; gap: 0.25rem; color: var(--txt); min-width: 0; }
.recap-album:hover { text-decoration: none; }
.recap-album img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.recap-album .cover-fallback { width: 100%; aspect-ratio: 1; border-radius: 8px; font-size: 1.6rem; }
.recap-album-name { font-size: 0.82rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recap-album .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Recap: Delta + Heatmap */
.delta { font-size: 0.78rem; font-weight: 600; margin-left: 0.3rem; }
.delta.up { color: var(--ok); }
.delta.down { color: var(--err); }
.heatmap { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 12px); grid-auto-columns: 12px; gap: 2px; overflow-x: auto; padding-bottom: 0.3rem; }
.hm-cell { width: 12px; height: 12px; border-radius: 2px; background: var(--bg2); }
.hm-cell.empty { background: transparent; }
.hm-cell.l1 { background: #1e3f68; }
.hm-cell.l2 { background: #2f5f9c; }
.hm-cell.l3 { background: #4f8fd6; }
.hm-cell.l4 { background: #7db4ff; }

/* Tooltip am Cursor (Timeline) */
.tl-tip { position: fixed; z-index: 60; pointer-events: none; display: flex; align-items: baseline; gap: 0.45rem; background: rgba(14,17,22,0.96); border: 1px solid var(--line); border-radius: 7px; padding: 0.22rem 0.5rem; font-size: 0.8rem; color: #dfe8f5; white-space: nowrap; box-shadow: 0 4px 14px rgba(0,0,0,.4); }
.tl-tip b { color: var(--accent2); font-variant-numeric: tabular-nums; }
.tl-tip.hidden { display: none; }

/* Recap-Podium (Top 3) */
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; align-items: end; }
.podium-item { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; text-align: center; color: var(--txt); padding: 0.6rem 0.35rem; border-radius: 10px; border: 1px solid var(--line); background: var(--bg2); min-width: 0; }
.podium-item:hover { text-decoration: none; }
.podium-item img, .podium-item .cover-fallback { width: 74px; height: 74px; border-radius: 8px; object-fit: cover; }
.podium-item.rank-1 img, .podium-item.rank-1 .cover-fallback { width: 96px; height: 96px; }
.podium-item.rank-2 img, .podium-item.rank-2 .cover-fallback { width: 82px; height: 82px; }
.podium-item.rank-1 { border-color: #d4af37; box-shadow: 0 0 0 1px rgba(212,175,55,.45); }
.podium-item.rank-2 { border-color: #c0c0c0; }
.podium-item.rank-3 { border-color: #cd7f32; }
.medal { font-size: 1.25rem; line-height: 1; }
.podium-name { font-weight: 600; font-size: 0.86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

/* Dashboard: Diese Woche (Tabs) */
.wk-list { display: flex; flex-direction: column; }
.wk-list.hidden { display: none; }
.wk-item { display: flex; align-items: center; gap: 0.55rem; padding: 0.22rem 0; border-bottom: 1px solid var(--line); color: var(--txt); min-width: 0; }
.wk-item:hover { text-decoration: none; }
.wk-item:last-child { border-bottom: 0; }
.wk-item img, .wk-item .cover-fallback { width: 30px; height: 30px; border-radius: 5px; object-fit: cover; flex: 0 0 auto; }
.wk-item .n { color: var(--faint); min-width: 2rem; text-align: right; font-variant-numeric: tabular-nums; font-size: 0.82rem; flex: 0 0 auto; }
.wk-item .meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.wk-item .meta b, .wk-item .meta .small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab { cursor: pointer; }

/* Bild-Auswahl */
.entity-img { position: relative; cursor: pointer; }
.imgpick-hint { position: absolute; right: 4px; bottom: 4px; background: rgba(14,17,22,0.85); border: 1px solid var(--line); border-radius: 6px; padding: 1px 5px; font-size: 0.8rem; opacity: 0; transition: opacity 0.15s; }
.entity-img:hover .imgpick-hint { opacity: 1; }
.imgpick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 0.6rem; max-height: 60vh; overflow-y: auto; margin: 0.5rem 0; }
.imgpick-item { display: flex; flex-direction: column; gap: 0.25rem; background: var(--bg2); border: 2px solid var(--line); border-radius: 8px; padding: 4px; cursor: pointer; }
.imgpick-item:hover { border-color: var(--accent); }
.imgpick-item.cur { border-color: var(--ok); }
.imgpick-item img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 5px; background: var(--bg); }
.imgpick-item .src { font-size: 0.72rem; color: var(--muted); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Externe Links */
.ext-links { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.4rem 0 0.6rem; }
.ext-link { font-size: 0.8rem; padding: 0.15rem 0.55rem; border-radius: 999px; border: 1px solid var(--line); background: var(--bg2); color: var(--muted); }
.ext-link:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* Mobile / Touch */
@media (max-width: 700px) {
    .wrap, .wrap.wide { padding: 0.8rem 0.7rem 2rem; }
    .topbar { gap: 0.5rem; padding: 0.5rem 0.7rem; }
    .searchbox input { width: 120px; }
    .tl-layout { grid-template-columns: 1fr; }
    .tl-side { flex-direction: row; flex-wrap: wrap; }
    .tl-side .panel { flex: 1 1 220px; }
    .cards { grid-template-columns: repeat(2, 1fr); }
    .btn.tiny { padding: 0.4rem 0.7rem; font-size: 0.9rem; }   /* groessere Touch-Targets */
    .list td, .list th { padding: 0.55rem 0.4rem; }
}

/* Alias-Gruppen */
@media (max-width: 700px) { }










.alias-group { border: 1px solid var(--line); border-radius: 10px; padding: 0.5rem 0.7rem; margin-bottom: 0.6rem; background: var(--bg2); }
.alias-group-head { display: flex; align-items: center; gap: 0.5rem; }
.alias-group-check { flex: 0 0 auto; width: auto; margin: 0; cursor: pointer; }
.alias-group-head img, .alias-group-head .cover-fallback { width: 30px; height: 30px; border-radius: 5px; object-fit: cover; }
.alias-group-head .spacer { flex: 1; }
.alias-group-items { display: block; margin: 0.5rem 0 0; }
.alias-item { display: flex; justify-content: flex-start; text-align: left; align-items: center; gap: 0.55rem; font-size: 0.86rem; margin: 0; padding: 0.18rem 0; border-bottom: 1px solid var(--line); }
.alias-item:last-child { border-bottom: 0; }
.alias-item input[type=checkbox] { flex: 0 0 auto; width: auto; }
.alias-item-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--txt); text-align: left; }
.alias-item .mono { flex: 0 0 auto; color: var(--faint); margin-left: 0.5rem; }

/* Genre-Seiten */
.genre-cloud { display: flex; flex-wrap: wrap; gap: 0.4rem 0.6rem; align-items: baseline; }
.genre-tag { display: inline-flex; align-items: baseline; gap: 0.3rem; background: var(--bg2); border: 1px solid var(--line); border-radius: 999px; padding: 0.2rem 0.7rem; color: var(--txt); line-height: 1.3; }
.genre-tag:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.genre-count { font-size: 0.68em; color: var(--faint); }
.genre-artist { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; text-align: center; color: var(--txt); padding: 0.6rem 0.4rem; border: 1px solid var(--line); border-radius: 10px; background: var(--bg2); min-width: 0; }
.genre-artist:hover { text-decoration: none; border-color: var(--accent); }
.genre-artist img { width: 72px; height: 72px; border-radius: 8px; object-fit: cover; }
.genre-artist .cover-fallback { width: 72px; height: 72px; font-size: 1.4rem; }
.genre-artist-name { font-size: 0.84rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

/* Inline-Flag (Kinder/Hörbuch) */
.flag-inline { display: inline; }
.flag-inline .btn { padding: .12rem .45rem; font-size: .74rem; }

/* ---------------------------------------------------------- now playing bar (unified) */
.nowplaying-bar { max-width: 1140px; margin: 0 auto; padding: 0 1.2rem 0.55rem; }
.nowplaying {
    display: flex; align-items: center; gap: 0.7rem;
    background: var(--panel); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 0.4rem 0.7rem; min-height: 46px;
}
.nowplaying.idle { opacity: 0.55; }
.np-cover { width: 38px; height: 38px; border-radius: 7px; object-fit: cover; border: 1px solid var(--line); flex: 0 0 auto; background: var(--bg2); }
.np-cover-fallback { display: flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent2); font-size: 1rem; }
.np-meta { min-width: 0; flex: 1; }
.np-title { font-weight: 600; font-size: 0.92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-sub { color: var(--muted); font-size: 0.78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-live { display: inline-flex; align-items: center; gap: 0.35rem; color: var(--ok); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; }
.np-idle { color: var(--muted); font-size: 0.85rem; }
.np-src { margin-left: 0.5rem; color: var(--accent2); font-size: 0.72rem; border: 1px solid var(--accent-soft); border-radius: 999px; padding: 0 0.45rem; }
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); animation: np-pulse 1.6s ease-in-out infinite; display: inline-block; }
@media (max-width: 640px) { .np-live { display: none; } }
.btn.tiny { padding: 0.2rem 0.55rem; font-size: 0.78rem; border-radius: 7px; }
.np-ctl { display: flex; gap: 0.25rem; }
.np-ctl .btn { min-width: 30px!important; padding: 0.2rem 0.45rem!important; text-align: center; color: var(--accent2); border-color: var(--accent-soft); }
.np-ctl .btn:hover { background: var(--accent-soft); }
.np-ctl form { display: inline; margin: 0; }

/* ---------------------------------------------------------- Jahrzehnte */
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.decade-picker { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0 0 1rem; }
.chip.toggle { display: inline-flex; align-items: center; gap: 0.35rem; cursor: pointer; user-select: none; }
.bar-horiz { height: 12px; min-width: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--accent), #3b6fd4); }
.year-input { width: 5.2rem; padding: 0.25rem 0.4rem; background: var(--bg2); border: 1px solid var(--line); color: var(--txt); border-radius: 7px; font-size: 0.82rem; }

.tag-src { font-size: 0.6rem; font-weight: 700; text-transform: uppercase; color: var(--accent2); border: 1px solid var(--accent-soft); border-radius: 999px; padding: 0 0.3rem; margin-left: 0.25rem; vertical-align: middle; }

.pager { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; margin-top: 1rem; }
.pager-cur { padding: 0.25rem 0.6rem; border-radius: 8px; background: var(--accent); color: #06121f; font-weight: 700; }

/* ---------------------------------------------------------- Statistiken */
canvas { display: block; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; }
.sub a.active { color: var(--accent); font-weight: 700; }

/* ---------------------------------------------------------- Album Battle */
.battle-embed { height: calc(100vh - 200px); min-height: 620px; }
.battle-embed iframe { width: 100%; height: 100%; border: 1px solid var(--line); border-radius: 12px; background: var(--bg2); }
.battle-badge { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.8rem; color: var(--accent2); border: 1px solid var(--accent-soft); border-radius: 999px; padding: 0.1rem 0.55rem; }

.cover-cell { width: 56px; }
.rank-cover { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; border: 1px solid var(--line); background: var(--bg2); display: block; }
.cover-fallback.small { width: 44px; height: 44px; font-size: 1.1rem; border-radius: 6px; }

/* ---------------------------------------------------------- Album Battle (nativ) */
.bd-duel { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: start; }
.bd-card { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 1rem; position: relative; }
.bd-rank { position: absolute; top: 10px; right: 12px; font-weight: 700; color: var(--faint); font-size: 0.85rem; }
.bd-cover { display: flex; justify-content: center; }
.bd-cover img { max-width: 100%; max-height: 320px; border-radius: 10px; box-shadow: 0 6px 18px rgba(0,0,0,0.45); }
.bd-artist { margin: 0.6rem 0 0; font-size: 1.25rem; }
.bd-album { margin: 0.1rem 0 0.5rem; font-size: 1rem; color: var(--muted); font-weight: 600; }
.bd-meta { color: var(--accent); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.4px; }
.bd-stats { color: var(--muted); font-size: 0.85rem; margin: 0.4rem 0; }
.bd-desc { color: var(--muted); font-size: 0.85rem; text-align: justify; max-height: 110px; overflow-y: auto; padding-right: 6px; margin: 0 0 0.5rem; }
.bd-tracks summary { cursor: pointer; color: var(--accent); font-size: 0.82rem; font-weight: 700; }
.bd-tracks ol { max-height: 140px; overflow-y: auto; margin: 0.4rem 0 0 1.1rem; color: var(--muted); font-size: 0.8rem; }
.bd-tracks li { margin-bottom: 0.2rem; }
.bd-card-actions { display: flex; gap: 0.5rem; margin-top: auto; padding-top: 0.6rem; }
.bd-vs { align-self: center; background: var(--bg2); color: var(--muted); padding: 14px; border-radius: 50%; font-weight: 700; border: 2px solid var(--line); }
.bd-actions { display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap; margin-top: 1.4rem; }
.bd-actions .btn { padding: 0.7rem 1.3rem; font-size: 0.95rem; }
@media (max-width: 800px) {
  .bd-duel { grid-template-columns: 1fr; }
  .bd-vs { justify-self: center; }
}

/* Album Battle: gleich hohe Boxen + Beschreibungs-Popup */
.bd-duel { align-items: stretch; }
.bd-card { height: 100%; }
.bd-cover img { max-height: 260px; }
.bd-links { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: flex-start; margin: 0.2rem 0 0.6rem; }
.bd-tracks { flex: 1 1 auto; }
.bd-modal { max-width: 680px; width: 92%; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); color: var(--txt); padding: 1.2rem 1.3rem; }
.bd-modal::backdrop { background: rgba(0,0,0,0.65); }
.bd-modal h3 { margin: 0 0 0.6rem; }
.bd-modal p { color: var(--muted); font-size: 0.9rem; line-height: 1.5; max-height: 55vh; overflow-y: auto; text-align: justify; }
.bd-modal form { margin-top: 0.8rem; text-align: right; }

/* Album-Battle-Rang-Badge (überall bei Alben) */
.duel-badge { display: inline-block; font-size: 0.68rem; font-weight: 700; padding: 0.05rem 0.4rem; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); background: var(--bg2); vertical-align: middle; margin-left: 0.35rem; white-space: nowrap; }
.duel-badge.db-t3 { color: #06121f; background: linear-gradient(135deg, #ffe08a, #f59e0b); border-color: transparent; }
.duel-badge.db-t10 { color: #06121f; background: linear-gradient(135deg, #d8b4fe, #8b5cf6); border-color: transparent; }
.duel-badge.db-t20 { color: #06121f; background: linear-gradient(135deg, #bae6fd, #38bdf8); border-color: transparent; }
.duel-badge.db-t50 { color: var(--accent); background: var(--accent-soft); border-color: transparent; }

/* Top-Alben auf der Duellseite hervorheben */
.bd-rank { padding: 0.12rem 0.5rem; border-radius: 999px; border: 1px solid var(--line); background: var(--bg2); font-size: 0.78rem; }
.bd-rank.db-t3, .duel-badge.db-t3 { color: #06121f; background: linear-gradient(135deg, #ffe08a, #f59e0b); border-color: transparent; }
.bd-rank.db-t10, .duel-badge.db-t10 { color: #06121f; background: linear-gradient(135deg, #d8b4fe, #8b5cf6); border-color: transparent; }
.bd-rank.db-t20, .duel-badge.db-t20 { color: #06121f; background: linear-gradient(135deg, #bae6fd, #38bdf8); border-color: transparent; }
.bd-rank.db-t50, .duel-badge.db-t50 { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.bd-card.bd-top3 { border-color: #f59e0b; box-shadow: 0 0 0 1px rgba(245,158,11,0.55), 0 0 22px rgba(245,158,11,0.18); }
.bd-card.bd-top10 { border-color: #8b5cf6; box-shadow: 0 0 0 1px rgba(139,92,246,0.5); }
.bd-card.bd-top20 { border-color: #38bdf8; box-shadow: 0 0 0 1px rgba(56,189,248,0.5); }
.bd-card.bd-top50 { border-color: var(--accent); }
