/* Die Leiste von BetterShelf, nachgebaut in HTML im Maßstab der App: obere Reihe 40 px (Werkzeuge, Zwischenablage,
   Zeitschaltuhr, Ablage), untere Reihe 44 px (Musik, Programme, System). Maße aus better_shelf/produktvideos/src/shelf. */
.leiste {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: #202020; border-top: 1px solid var(--strich);
  color: var(--w); font: 12px/1.25 var(--fliess);
  padding-bottom: env(safe-area-inset-bottom);
  user-select: none;
}
@media (prefers-reduced-motion: no-preference) {
  .leiste { animation: leiste-hoch .55s .15s cubic-bezier(.2, .8, .2, 1) both; }
  @keyframes leiste-hoch { from { transform: translateY(100%); } }
  .clip.neu { animation: clip-neu .4s cubic-bezier(.2, .8, .2, 1) both; }
  @keyframes clip-neu { from { transform: translateY(-14px) scale(.96); opacity: 0; } }
}
.reihe { display: flex; align-items: center; }
.reihe.oben { height: 40px; gap: 8px; padding: 0 12px; }
.reihe.unten { height: 44px; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); padding-left: 12px; }
.zone { display: flex; align-items: center; gap: 4px; height: 34px; padding: 0 3px; border-radius: 8px; background: var(--zone); flex: none; }
.zone.mitte { flex: 1; min-width: 0; padding-right: 6px; }
.zone.mitte.aktiv { box-shadow: inset 0 0 0 1px var(--akzent); }
.zone.system { background: none; padding: 0; }
.leiste [data-teil] { position: relative; }
.leiste .weg { display: none; }

.lk {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: none;
  min-width: 34px; height: 28px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--w); text-decoration: none;
}
.lk:hover { background: var(--hover); }
.lk.aktiv, .lk[aria-pressed="true"], .zeit.laeuft { background: var(--gewaehlt); }
.schirm .leiste :focus-visible { outline-offset: -2px; }
.zeit { padding: 0 10px; font-variant-numeric: tabular-nums; }
.zaehler { min-width: 16px; height: 16px; padding: 0 4px; margin-right: 6px; border-radius: 8px; background: var(--akzent); font-size: 10px; line-height: 16px; text-align: center; }
.zaehler:not([hidden]) { display: inline-block; }
.lk:has(.zaehler:not([hidden])) { padding-left: 8px; }

/* Karten der Zwischenablage (auch groß im Abschnitt) */
.karten { display: flex; gap: 8px; min-width: 0; flex: 1; overflow: hidden; }
.clip {
  position: relative; display: flex; align-items: center; gap: 8px; flex: none; width: 220px; height: 28px; padding: 0 10px;
  border: 0; border-radius: 6px; background: rgba(255, 255, 255, .075); color: var(--w); font: 12px var(--fliess); text-align: left; overflow: hidden;
}
.clip:hover { background: var(--hover); }
.clip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.clip .i { color: var(--w2); }
.clip.fest { padding-left: 13px; }
.clip.fest::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--akzent); }
.clip .fleck { width: 18px; height: 18px; border-radius: 4px; flex: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }
.clip .bildchen { width: 40px; height: 20px; border-radius: 3px; flex: none; background: linear-gradient(135deg, #fff 0 55%, #B9CDF2 55% 80%, #1F6FEB 80%); }
.clip.blitz { background: var(--akzent); }
.clip.blitz .i { color: #fff; }

/* untere Reihe */
.seite { display: flex; align-items: center; min-width: 0; }
.seite.r { justify-content: flex-end; }
.medien { width: 290px; gap: 2px; }
.medien .lk { min-width: 28px; }
.cover { width: 26px; height: 26px; border-radius: 4px; flex: none; margin: 0 8px 0 6px; background: linear-gradient(135deg, #7C3AED, #EC4899 60%, #F59E0B); }
.titel { min-width: 0; display: grid; }
.titel b, .titel small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.titel b { font-weight: 600; }
.titel small, .uhr small { font-size: 11px; color: var(--w2); }
.apps { display: flex; gap: 2px; align-items: center; }
.app { position: relative; display: grid; place-items: center; width: 40px; height: 36px; padding: 0; border: 0; border-radius: 6px; background: none; color: #fff; font: inherit; text-decoration: none; cursor: pointer; }
.app:hover, .app.vorn { background: rgba(255, 255, 255, .09); }
.app.aktiv { background: var(--gewaehlt); }
.app span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; }
.app span .i { width: 14px; height: 14px; stroke-width: 1.5; }
.a0 span { background: #E8A33D; } .a1 span { background: #3B82F6; } .a2 span { background: #7C3AED; } .a3 span { background: #0EA5E9; }
.a4 span { background: #22C55E; } .a5 span { background: #EC4899; } .a6 span { background: #64748B; }
.app.laeuft::before { content: ""; position: absolute; bottom: 1px; left: 50%; width: 6px; height: 3px; margin-left: -3px; border-radius: 2px; background: var(--w3); }
.app.vorn::before { width: 14px; margin-left: -7px; background: var(--akzent); }
.startk { color: #4C8DF6; }
.startk .i { width: 18px; height: 18px; }
.system .lk { min-width: 36px; height: 36px; }
.uhr { display: grid; justify-items: end; padding: 0 10px 0 8px; min-width: 84px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.uhr b { font-weight: 400; }
.schlitz { position: relative; width: 14px; height: 44px; border-left: 1px solid var(--strich); flex: none; }
.schlitz:hover { background: var(--hover); }

/* Namen beim Drüberfahren */
@media (hover: hover) {
  .leiste:not(.bearbeiten) [data-tip]:hover::after, .leiste:not(.bearbeiten) [data-tip]:focus-visible::after {
    content: attr(data-tip); position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%);
    padding: 5px 9px; border-radius: 4px; background: #2C2C2C; border: 1px solid rgba(255, 255, 255, .1); color: var(--w);
    font: 12px var(--fliess); white-space: nowrap; pointer-events: none; box-shadow: 0 4px 12px rgba(0, 0, 0, .4); z-index: 5;
  }
  .leiste:not(.bearbeiten) .zone.links [data-tip]:first-child::after { left: 0; transform: none; }
  .leiste:not(.bearbeiten) .rand-r::after, .leiste:not(.bearbeiten) .schlitz::after { left: auto !important; right: 0; transform: none !important; }
}

/* Bearbeiten: Fach "Ausgeblendet" über der Leiste, Elemente mit gestricheltem Rahmen, Klick blendet aus */
.fach {
  position: absolute; left: 0; right: 0; bottom: 100%; height: 40px; display: flex; align-items: center; gap: 10px; padding: 0 12px;
  background: #202020; border-top: 1px solid var(--strich); color: var(--w2);
}
.fach-teile { flex: 1; display: flex; gap: 6px; min-width: 0; overflow: hidden; }
.fach-teile button { flex: none; height: 26px; padding: 0 10px; border-radius: 6px; border: 1px dashed var(--akzent); background: rgba(var(--akzent-rgb), .2); color: var(--w); font-size: 12px; }
.fach-teile button:hover { background: var(--gewaehlt); }
.fach .kn { min-height: 26px; }
.bearbeiten [data-teil] { cursor: grab; touch-action: none; user-select: none; }
.bearbeiten .rueckt { cursor: grabbing; opacity: .65; }
.bearbeiten [data-teil]::before {
  content: ""; position: absolute; inset: 0; z-index: 2; border: 1px dashed var(--akzent); border-radius: 6px; background: rgba(var(--akzent-rgb), .2);
}
.bearbeiten [data-teil]:hover::before { background: rgba(229, 72, 77, .35); border-color: #E5484D; }
.bearbeiten [data-teil]::after {
  content: "×"; position: absolute; top: -5px; right: -5px; z-index: 3; width: 14px; height: 14px; border-radius: 7px; background: #E5484D; color: #fff;
  font: 700 11px/13px var(--fliess); text-align: center;
}
.bearbeiten [data-teil] > * { pointer-events: none; }

/* Datei wird gezogen: die Leiste nimmt sie an */
.abwurf { display: none; position: absolute; inset: 0; z-index: 6; align-items: center; justify-content: center; gap: 10px; background: rgba(var(--akzent-rgb), .94); font: 600 14px var(--fliess); }
.leiste.ziel .abwurf { display: flex; }
.leiste.ziel.nah .abwurf { background: #3B82F6; }
.geist {
  position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none; max-width: 260px; padding: 3px 9px; border-radius: 6px; background: #FFD600; color: #0F1B2D;
  font: 12px var(--fliess); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

@media (max-width: 1040px) { .medien { display: none; } }
@media (max-width: 860px) { .apps .app:nth-child(n+6) { display: none; } }
/* Handy: Reihe 1 Werkzeuge und Ablage, Reihe 2 Zwischenablage und Uhr */
@media (max-width: 700px) {
  .leiste { display: grid; grid-template: "a b" 40px "c d" 44px / minmax(0, 1fr) auto; column-gap: 8px; align-items: center; padding-left: 8px; padding-right: 8px; }
  .reihe, .seite.r, .zone.system { display: contents; }
  .zone.links { grid-area: a; justify-self: start; }
  .zone.rechts { grid-area: b; }
  .zone.mitte { grid-area: c; }
  .uhr { grid-area: d; padding-right: 2px; min-width: 0; }
  .seite.l, .apps, .zeit, .system .lk, .schlitz { display: none; }
  .clip { width: 150px; }
  .fach, .fach ~ .abwurf { grid-area: auto; }
}
@media (max-width: 359px) { .zone.links [data-teil="git"] { display: none; } }

/* ---- Nachgezogen: Zeitschaltuhr mit Pause, Musik mit Verlauf, Programme starten, Karten anheften und entfernen ---- */
.pause [data-zeit] { opacity: .5; }
.zeit.um, .pille.um { background: var(--akzent); }
.cover[data-cover="1"] { background: linear-gradient(135deg, #0EA5E9, #22C55E 70%); }
.cover[data-cover="2"] { background: linear-gradient(135deg, #F59E0B, #EF4444 65%, #7C3AED); }
.lauf { display: block; height: 2px; margin-top: 3px; border-radius: 1px; background: rgba(255, 255, 255, .14); overflow: hidden; }
.lauf i { display: block; width: 0; height: 100%; background: var(--akzent); transition: width .25s linear; }
.clip .tun { display: none; place-items: center; flex: none; width: 22px; height: 22px; margin-right: -4px; border-radius: 4px; color: var(--w2); cursor: pointer; }
.clip .tun[data-tun="pin"] { margin-left: auto; margin-right: 0; }
.clip .tun .i { width: 13px; height: 13px; color: inherit; }
.clip:hover .tun, .clip:focus-visible .tun, .clip .tun.an { display: grid; }
.clip .tun.an { color: #7FAAF5; }
.clip .tun:hover { background: rgba(255, 255, 255, .16); color: #fff; }
@media (hover: none) { .clip .tun { display: grid; } }
@media (prefers-reduced-motion: no-preference) {
  .zeit.um, .pille.um { animation: zeit-um .4s ease-in-out 6 alternate; }
  .app.huepft span { animation: app-huepf .45s cubic-bezier(.3, 1.6, .5, 1); }
  @keyframes zeit-um { from { background: var(--gewaehlt); } to { background: var(--akzent); } }
  @keyframes app-huepf { 0% { translate: 0 0; } 40% { translate: 0 -7px; } 100% { translate: 0 0; } }
}
