  /* ── RESET ── */
  *{box-sizing:border-box;margin:0;padding:0}
  :root{
    --gray-500:#72658c;
    --gray-600:#574e6a;
    --gray-700:#453d53;
    --warning-400:#f87171;
    --background:#1c1823;
    --solid:#2e293a;
    --solid-primary:#75ead4;
    --solid-on-card:#453d53;
    --text:#f5f2fa;
    --text-muted:#d1cae0;
    --text-disabled:#9f93b8;
    --text-primary:#75ead4;
    --text-on-primary:#1e4e4a;
    --low:1px 2px 2px hsl(262deg 20% 7%/0.25);
    --medium:1px 2px 2px hsl(262deg 20% 7%/0.3),2px 4px 4px hsl(262deg 20% 7%/0.3),3px 6px 6px hsl(262deg 20% 7%/0.3);
    --audio-cover-caption-height:clamp(64px,8vw,88px);
    --audio-cover-frame-padding:12px;
    --audio-title-overlap:-14px;
  }
  [data-theme="light"]{
    --background:#f5f2fa;
    --solid:#ffffff;
    --solid-primary:#28766e;
    --solid-on-card:#f1edf8;
    --text:#1c1823;
    --text-muted:#72658c;
    --text-disabled:#9f93b8;
    --text-primary:#319488;
    --text-on-primary:#d1fbf1;
    --low:1px 2px 2px hsl(262deg 20% 50%/0.4);
    --medium:1px 2px 2px hsl(262deg 20% 50%/0.15),2px 4px 4px hsl(262deg 20% 50%/0.15),3px 6px 6px hsl(262deg 20% 50%/0.15);
    --tt-bg:rgba(255,255,255,0.9);
  }
  html{scrollbar-color:var(--gray-700) transparent;scrollbar-width:thin;scrollbar-gutter:stable}
  body{
    margin:0;background:var(--background);color:var(--text);
    font-family:'Nunito','Nunito Fallback',system-ui,-apple-system,sans-serif;
    -webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;
    line-height:1.5;
  }
  ::-webkit-scrollbar{width:6px;height:12px;background:transparent}
  ::-webkit-scrollbar-thumb{background:var(--gray-700);border-radius:3px}
  ::-webkit-scrollbar-thumb:hover{background:var(--gray-500)}
  a{color:inherit;text-decoration:none}
  a:hover{text-decoration:underline}
  p{line-height:inherit}
  button{
    border:none;margin:0;padding:0;background:transparent;color:inherit;
    font:inherit;text-align:inherit;outline:none;line-height:inherit;
    -webkit-appearance:none;cursor:pointer;
  }
  input[type="range"]{-webkit-appearance:none;appearance:none;outline:none;cursor:pointer}
  img,video{display:block;max-width:100%}

  .app-wrap{isolation:isolate;height:100vh;height:100dvh;display:flex;flex-direction:column;overflow:hidden;}
  .debug-panel{position:fixed;inset:12px;z-index:100;background:rgba(20,17,29,.98);border:1px solid var(--solid-on-card);border-radius:12px;box-shadow:0 20px 60px rgba(0,0,0,.55);padding:14px;color:var(--text);}
  .debug-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px;}
  .debug-head button{border:0;border-radius:999px;padding:7px 12px;background:var(--solid-on-card);color:var(--text);font:inherit;cursor:pointer;margin-left:6px;}
  .debug-panel pre{height:calc(100% - 42px);overflow:auto;margin:0;padding:10px;background:#0d0b12;border-radius:8px;color:#b8f5e9;font:12px/1.45 monospace;white-space:pre-wrap;overflow-wrap:anywhere;}

  #loading{display:flex;flex-direction:column;align-items:center;justify-content:center;flex:1;gap:12px;}
  .spinner{border:3px solid var(--solid-on-card);border-top:3px solid var(--text-primary);border-radius:50%;width:44px;height:44px;animation:spin .7s linear infinite;}
  @keyframes spin{to{transform:rotate(360deg)}}
  @keyframes progressStripe{0%{left:-42px;opacity:0}5%{opacity:1}100%{left:100%;opacity:1}}
  @keyframes coverShimmer{0%,100%{opacity:1}50%{opacity:.5}}
  .load-text{color:var(--text-muted);font-size:.9em}

  #error{display:none;text-align:center;padding:60px 20px;color:var(--warning-400);}

  #playerArea{display:none;flex:1;padding:0 72px;gap:5%;align-items:stretch;min-height:0;}
  @media(max-width:870px){#playerArea{flex-direction:column;gap:20px;padding:4px 16px 16px;overflow:hidden;}}

  /* Audio mode on small screens deliberately uses the document scroll. The
     cover stays in the visual layer while the sidebar moves over it. */
  @media(max-width:870px){
    .topbar{
      position:sticky;
      top:0;
      z-index:50;
    }
    body.mobile-audio-mode .topbar{
      background:color-mix(in srgb,var(--solid) 86%,transparent);
      -webkit-backdrop-filter:blur(16px);
      backdrop-filter:blur(16px);
    }
    body.mobile-audio-mode,
    body.mobile-audio-mode .app-wrap{overflow:visible;}
    body.mobile-audio-mode .app-wrap{height:auto;min-height:100dvh;}
    body.mobile-audio-mode #playerArea{overflow:visible;min-height:0;gap:0;}
    body.mobile-audio-mode #playerArea .vid-col{
      position:sticky;top:0;z-index:1;
      height:60vh;
    }
    body.mobile-audio-mode #playerArea .audio-cover{
      position:absolute;inset:0;background:transparent;overflow:visible;opacity:1;
    }
    body.mobile-audio-mode #playerArea .audio-cover-bg{
      position:fixed;inset:0;width:100vw;height:100dvh;max-width:none;max-height:none;
      z-index:0;opacity:.9;pointer-events:none;
    }
    body.mobile-audio-mode #playerArea .sidebar{
      --mobile-sidebar-sticky-top:116px;
      position:relative;z-index:30;margin-top:0;width:calc(100% + 32px);
      margin-left:-16px;padding:16px 16px calc(88px + env(safe-area-inset-bottom,0px));overflow:visible;gap:12px;
      height:auto;min-height:0;max-height:none;background:var(--background);
      box-shadow:0 92px 0 var(--background),0 -14px 24px rgba(0,0,0,.48);
      overflow-anchor:none;
    }
    body.mobile-audio-mode #playerArea .sidebar-content{width:min(300px,100%);margin-inline:auto;}
    body.mobile-audio-mode #playerArea .sidebar-sticky-unit{
      position:sticky;top:var(--mobile-sidebar-sticky-top);z-index:10;
      width:calc(100% + 32px);margin-inline:-16px;
      padding:12px 16px 0;box-sizing:border-box;background:var(--background);
      box-shadow:0 16px 0 var(--background);
    }
    body.mobile-audio-mode #playerArea .switcher{
      position:relative;top:auto;z-index:auto;width:fit-content;margin-inline:auto;
      padding:0;background:var(--solid);box-shadow:var(--low);border-radius:2rem;
    }
    body.mobile-audio-mode #playerArea .switcher > .tab-btn{
      z-index:1;background:transparent;
    }
    body.mobile-audio-mode #playerArea .switcher > .tab-btn:first-of-type{
      border-radius:2rem 0 0 2rem;
    }
    body.mobile-audio-mode #playerArea .switcher > .tab-btn:last-of-type{
      border-radius:0 2rem 2rem 0;
    }
    body.mobile-audio-mode #playerArea .sticky-entry-label{
      display:block;width:min(300px,100%);margin:16px auto 0;padding:0 0 0 2px;box-sizing:border-box;
      text-align:left;
    }
    body.mobile-audio-mode #playerArea .sticky-entry-label.history-label{
      font-size:.72em;font-weight:400;text-transform:none;letter-spacing:normal;color:var(--text-disabled);text-align:center;padding:0;margin-top:16px;
    }
    body.mobile-audio-mode #playerArea .history-count{
      display:none;
    }
    body.mobile-audio-mode #playerArea #infoContent .info-section-title:first-child{
      display:none;
    }
    body.mobile-audio-mode #playerArea .history-count{
      margin-inline:-16px;padding:8px 16px;
    }
    body.mobile-audio-mode #playerArea .sidebar-content,
    body.mobile-audio-mode #playerArea .sidebar-content .tab-panel.active{overflow:visible;}
    body.mobile-audio-mode #playerArea #infoContent,
    body.mobile-audio-mode #playerArea #historyContent{overflow:visible;}
    body.mobile-audio-mode #bar{
      position:fixed;left:0;right:0;bottom:env(safe-area-inset-bottom,0px);z-index:60;
    }
    body.mobile-audio-mode #playerArea{padding-bottom:0;}
  }

  /* In der installierten Web-App fehlt die Browserleiste als natürlicher
     Abstand unter der fixierten Playerbar. Etwas Luft hält sie vom unteren
     Bildschirmrand bzw. vom Home-Indikator fern. */
  @media (max-width:870px) and (display-mode:standalone){
    /* The fixed bar sits above the home indicator. Keep that reserved area
       in the same color so the bar visually reaches the bottom edge. */
    body.mobile-audio-mode::after{
      content:"";
      position:fixed;
      left:0;
      right:0;
      bottom:0;
      height:calc(env(safe-area-inset-bottom,0px) + 14px);
      background:var(--solid);
      z-index:59;
      pointer-events:none;
    }
    body.mobile-audio-mode #bar{
      bottom:calc(env(safe-area-inset-bottom,0px) + 14px);
    }
  }

  @media(max-width:700px){
    body.mobile-audio-mode #playerArea .vid-col{height:52vh;}
    body.mobile-audio-mode #playerArea .sidebar{--mobile-sidebar-sticky-top:72px;}
    body.mobile-audio-mode .topbar.filters-open .filter-form{
      position:absolute;top:calc(100% + 12px);left:0;right:0;width:auto;
      padding:12px;border-radius:12px;background:var(--solid);box-shadow:var(--low);z-index:2;
    }
  }

  @media(max-width:420px){
    body.mobile-audio-mode #playerArea .vid-col{height:48vh;}
  }

  .vid-col{position:relative;flex:1;display:flex;align-items:center;justify-content:center;min-height:0;min-width:0;}
  @media(max-width:870px){.vid-col{height:auto;min-height:0;aspect-ratio:16/9;margin:0 -16px;flex:none;}}
  .vid-wrap{position:relative;width:100%;max-height:100%;aspect-ratio:16/9;background:#000;border-radius:4px;overflow:hidden;}
  @media(max-width:870px){.vid-wrap{border-radius:0;}}
  .vid-wrap video{width:100%;height:100%;display:block;outline:none;}
  /* Keep both iOS audio sessions in the document. display:none can make
     WebKit drop the inactive session before the overlap hand-off. */
  .vid-wrap audio{position:absolute;left:-10000px;top:0;width:1px;height:1px;opacity:0;pointer-events:none;}
  .audio-cover{--history-depth:1;--history-scale:.82;position:absolute;inset:0 0 32px;display:none;align-items:center;justify-content:center;overflow:hidden;background:var(--solid);z-index:2;}
  .audio-cover.active{display:flex;}
  .audio-cover-bg{position:absolute;width:100%;height:100%;max-width:none;max-height:none;object-fit:cover;filter:blur(10px);transform:scale(1.04);opacity:.42;}
  .audio-cover-history{position:absolute;z-index:1;inset:0;pointer-events:none;}
  .audio-cover-history-card{position:absolute;left:50%;top:50%;box-sizing:border-box;padding:10px 10px 8px;background:#fff;border-radius:2px;overflow:hidden;transform:translate(-50%,-50%) translate(calc(var(--history-x) * var(--history-depth)),calc(var(--history-y) * var(--history-depth))) scale(var(--history-scale)) rotate(var(--history-angle));}
  .audio-cover-history-card img{display:block;width:100%;height:calc(100% - 58px);object-fit:cover;}
  .audio-cover-history-caption{height:58px;padding:7px 3px 0;box-sizing:border-box;color:#17151a;font-family:"Permanent Marker","Segoe Print","Bradley Hand",cursive;line-height:1.05;overflow:hidden;}
  .audio-cover-history-title{font-size:clamp(.72rem,1.15vw,1rem);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
  .audio-cover-history-meta{display:flex;justify-content:space-between;gap:5px;margin-top:5px;font-size:clamp(.48rem,.72vw,.65rem);white-space:nowrap;}
  .audio-cover-frame{position:relative;z-index:2;isolation:isolate;display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;width:fit-content;max-width:calc(100% - 32px);padding:var(--audio-cover-frame-padding);box-sizing:border-box;overflow:hidden;background:#fff;border-radius:2px;box-shadow:0 24px 52px rgba(0,0,0,.52);}
  .audio-cover-main{position:relative;z-index:1;display:block;width:clamp(320px,52vw,590px);height:auto;max-width:none;max-height:none;object-fit:contain;flex:none;}
  .audio-cover-caption{position:relative;z-index:10;display:flex;align-items:flex-start;justify-content:space-between;gap:18px;width:100%;min-width:0;height:var(--audio-cover-caption-height);padding:9px 12px 18px;box-sizing:border-box;color:#17151a;font-family:"Permanent Marker","Segoe Print","Bradley Hand",cursive;font-size:1em;line-height:1.5;pointer-events:none;}
  .audio-cover-anime{position:relative;z-index:3;align-self:flex-start;min-width:0;width:100%;max-width:100%;margin:var(--audio-title-overlap) 0 0 -2px;padding:3px 0 5px;overflow:visible;background:transparent;font-family:inherit;font-size:clamp(1.35rem,2.25vw,2rem);line-height:1.25;letter-spacing:.015em;text-shadow:.45px .45px 0 #fff,-.35px -.35px 0 #17151a;transform:rotate(var(--caption-title-angle,-5deg));transform-origin:left bottom;}
  .audio-cover-anime span{position:relative;z-index:1;display:block;width:fit-content;max-width:calc(100% - 44px);line-height:.68;white-space:normal;box-decoration-break:clone;-webkit-box-decoration-break:clone;padding:0 5px 3px;}
  .audio-cover-artist{position:absolute;left:10px;bottom:8px;z-index:3;max-width:calc(100% - 110px);font-family:inherit;font-size:clamp(.72rem,1.1vw,1rem);line-height:1.15;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;transform:rotate(var(--caption-artist-angle,0deg));transform-origin:left bottom;}
  .audio-cover-date{position:absolute;right:-4px;bottom:32px;z-index:7;display:flex;flex:0 0 auto;flex-direction:column;align-items:center;gap:1px;margin:0;font-size:clamp(.72rem,1.1vw,1rem);letter-spacing:.03em;line-height:1.05;text-align:center;text-transform:lowercase;text-shadow:.25px .25px 0 #17151a;transform:rotate(var(--caption-date-angle,-35deg));transform-origin:bottom right;}
  .vid-col.audio-mode .vid-wrap{visibility:visible;}
  .vid-col.audio-mode .vid-wrap video{display:none;}
  .player-video.audio-mode{opacity:0;pointer-events:none;}
  @media(max-width:870px){.audio-cover{inset:0 0 12px;padding:10px 8px;}.audio-cover-frame{max-width:calc(100% - 16px);padding:8px;}.audio-cover-main{width:auto;}.audio-cover-caption{gap:8px;line-height:1.15;padding:7px 6px 10px;}.audio-cover-anime{--audio-title-overlap:clamp(-22px,-4vw,-12px);padding:2px 6px 4px 4px;font-size:clamp(1rem,6vw,1.5rem);}.audio-cover-artist{left:6px;bottom:-4px;max-width:calc(100% - 70px);font-size:.68rem;}.audio-cover-date{right:-4px;bottom:17px;font-size:.64rem;}}
  @media(min-width:1200px){.audio-cover{--history-depth:1.08;--history-scale:.8;}}
  @media(min-width:1450px){.audio-cover{--history-depth:1.16;--history-scale:.78;}}
  @media(min-width:1750px){.audio-cover{--history-depth:1.28;--history-scale:.75;}}
  .ov-btn svg{width:18px;height:18px;fill:currentColor;display:block;}
  .player-video{position:absolute;inset:0;object-fit:contain;background:#000;transition:opacity .12s linear;}
  .player-video.standby{opacity:0;pointer-events:none;}
  .player-video.active{opacity:1;pointer-events:auto;z-index:1;}

  .ov-wrap{
    position:absolute;
    right:16px;
    top:16px;
    z-index:3;

    display:flex;
    gap:8px;

    opacity:0;
    visibility:hidden;
    pointer-events:none;

    transition:
        opacity 250ms,
        visibility 250ms;
  }

  .vid-wrap:hover .ov-wrap,
  .ov-wrap:focus-within{
      opacity:1;
      visibility:visible;
      pointer-events:auto;
  }

  @media(max-width:870px){
      .ov-wrap{
          opacity:1;
          visibility:visible;
          pointer-events:auto;
      }
  }
  .ov-btn:hover{background:rgba(0,0,0,0.7);color:var(--text);}


  /* ── TOP NAV / FILTERS ── */
  .topbar{
    display:flex;align-items:center;justify-content:space-between;gap:24px;
    margin:16px 72px 20px;padding:12px 16px;border-radius:12px;
    background:var(--solid);box-shadow:var(--low);flex-shrink:0;
    min-height:96px;overflow:hidden;
  }
  .brand{
    display:flex;align-items:center;align-self:stretch;gap:14px;min-width:max-content;
    margin:-12px 0 -12px -16px;padding:0 0 0 0;
  }
  .brand-toggle{
    display:flex;align-items:center;justify-content:center;width:96px;height:auto;align-self:stretch;
    flex:0 0 auto;background:var(--solid-on-card);overflow:hidden;border-radius:12px 0 0 12px;
  }
  .brand-toggle img{display:block;flex:0 0 auto;width:100%;height:100%;min-width:1px;min-height:1px;aspect-ratio:1 / 1;object-fit:cover;visibility:visible;opacity:1;-webkit-backface-visibility:hidden;backface-visibility:hidden;}
  .brand h1{font-size:1.35rem;line-height:1;font-weight:800;letter-spacing:.01em;}
  .filter-form{display:flex;align-items:flex-end;justify-content:flex-end;gap:12px;min-width:0;align-self:center;}
  .filter-field{display:flex;flex-direction:column;gap:4px;min-width:0;position:relative;}
  .filter-field label{font-size:.68rem;font-weight:800;text-transform:uppercase;letter-spacing:.08em;color:var(--text-disabled);}
  .filter-input{
    height:38px;border:1px solid transparent;border-radius:9px;outline:none;
    background:var(--solid-on-card);color:var(--text);font:inherit;font-size:.85rem;font-weight:600;
    padding:0 11px;box-shadow:none;transition:border-color .15s,box-shadow .15s,background .15s;
  }
  .filter-input::placeholder{color:var(--text-disabled);}
  .filter-input:hover{border-color:var(--gray-600);}
  .filter-input:focus{border-color:var(--text-primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--text-primary) 18%,transparent);}
  /* iOS zooms focused text fields below 16px; keep mobile inputs at the native threshold. */
  @media(max-width:870px){.filter-input{font-size:16px;}}
  #anilistUser{width:190px;}
  .year-fields{display:flex;align-items:center;gap:7px;}
  .year-fields .filter-input{width:86px;text-align:center;padding-inline:7px;}
  .year-sep{height:38px;display:flex;align-items:center;color:var(--text-disabled);font-weight:800;}
  .filter-apply{
    height:38px;padding:0 15px;border-radius:999px;background:var(--solid-primary);
    color:var(--text-on-primary);font-size:.76rem;font-weight:800;text-transform:uppercase;letter-spacing:.06em;
    transition:filter .15s,transform .1s;white-space:nowrap;align-self:flex-end;
  }
  .filter-apply:hover{filter:brightness(1.08);}
  .filter-apply:active{transform:scale(.97);}
  .filter-apply:disabled{opacity:.55;cursor:wait;}
  .filter-toggle{display:none;height:38px;padding:0 14px;border-radius:999px;background:var(--solid-on-card);color:var(--text-muted);font-size:.76rem;font-weight:800;text-transform:uppercase;letter-spacing:.06em;white-space:nowrap;}
  .filter-status{
    position:absolute;left:0;top:100%;margin-top:2px;font-size:.68rem;color:var(--text-disabled);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:190px;
    opacity:0;pointer-events:none;transform:translateY(-2px);transition:opacity .15s ease,transform .15s ease;
  }
  .filter-status.ok{color:var(--text-primary);}
  .filter-status.error{color:var(--warning-400);}
  @media(max-width:980px){
    .topbar{margin-inline:24px;align-items:flex-start;}
    .filter-form{flex-wrap:wrap;align-items:flex-end;}
  }
  @media(max-width:700px){
    .topbar{margin:10px 12px 14px;padding:0 12px 12px;flex-direction:column;align-items:stretch;gap:12px;overflow:visible;min-height:0;}
    .topbar.filters-open{gap:24px;}
    .brand{margin:0 -12px -12px;align-self:auto;}
    .brand-toggle{width:72px;height:72px;border-radius:12px 0 0 0;}
    .brand h1{font-size:1.1rem;}
    .filter-toggle{display:inline-flex;align-items:center;justify-content:center;margin-left:auto;align-self:center;}
    .topbar:not(.filters-open) .filter-form{display:none;}
    .filter-form{justify-content:flex-start;align-items:flex-end;align-self:auto;width:100%;}
    .filter-field:first-child{flex:1 1 100%;}
    #anilistUser{width:100%;}
    .filter-apply{margin-left:auto;}
  }
  @media(max-width:420px){
    .filter-toggle{margin-right:12px;}
    .filter-apply{margin-right:0;}
  }

  /* ── SIDEBAR ── */
  .sidebar{display:flex;flex-direction:column;gap:24px;min-width:0;min-height:0;padding-top:0;padding-bottom:8px;width:300px;flex-shrink:0;margin-top:24px}
  @media(max-width:870px){.sidebar{flex:1 1 auto;padding-top:0;gap:12px;min-height:0;max-height:none;width:min(300px,100%);margin:0 auto 0;overflow:hidden;}}

  /* ── TABS ── */
  .switcher{--pill-left:0px;--pill-width:0px;position:relative;display:flex;align-items:stretch;width:fit-content;margin-inline:auto;border-radius:2rem;white-space:nowrap;background:var(--solid);box-shadow:var(--low);isolation:isolate;overflow:hidden;}
  .switcher::before{content:"";position:absolute;z-index:0;top:0;bottom:0;left:var(--pill-left);width:var(--pill-width);border-radius:2rem;background:var(--solid-primary);transition:left 320ms cubic-bezier(.22,.61,.36,1),width 320ms cubic-bezier(.22,.61,.36,1);}
  .switcher > .tab-btn{z-index:1;}
  .sticky-entry-label{display:none;}
  .tab-btn{
    position:relative;display:inline-flex;align-items:center;justify-content:center;
    padding:8px 16px;font-size:.9rem;font-weight:700;text-transform:uppercase;letter-spacing:.1rem;
    cursor:pointer;background:transparent;font-family:inherit;
    color:var(--text-muted);transition:color 500ms;
  }
  @media(hover:hover)and(pointer:fine){.tab-btn:hover{color:var(--text);transition-duration:250ms;}}
  .tab-btn.active{color:var(--text-on-primary);}
.switcher-bg{
  position:absolute;z-index:1;top:0;left:0;width:100%;height:100%;
  background:var(--solid-primary);border-radius:2rem;
}
.tab-btn .switcher-bg{opacity:0;}
.tab-btn.active .switcher-bg{opacity:1;}
.tab-btn .tab-label{z-index:2;position:relative;}

  /* ── SIDEBAR CONTENT ── */
  .sidebar-content{flex:1;min-height:0;display:flex;flex-direction:column;gap:16px;overflow:hidden;}
  .sidebar-content .tab-panel{display:none;min-height:0;}
  .sidebar-content .tab-panel.active{display:flex;flex-direction:column;gap:16px;flex:1;min-height:0;}
  #infoContent{overflow-y:auto;min-height:0;flex:1;padding:4px 12px 6px 2px;scrollbar-gutter:stable;}
  #historyContent{display:flex;flex-direction:column;gap:20px;overflow-y:auto;min-height:0;flex:1;padding:4px 12px 6px 2px;scrollbar-gutter:stable;}
  @media(max-width:870px){
    .sidebar-content{flex:1 1 auto;overflow:hidden;}
    .sidebar-content .tab-panel.active{flex:1 1 auto;}
  }

  /* ── SIDEBAR CARDS (History / Next Up style) ── */
  .theme-card,.info-card,.info-summary-card{
    display:flex;align-items:stretch;border-radius:10px;overflow:hidden;
    position:relative;background:var(--solid);box-shadow:var(--low);
    transition:box-shadow .15s,background .15s;
    max-height:64px;flex-shrink:0;
  }
  .theme-card{cursor:pointer;}
  .theme-card:hover{box-shadow:var(--medium);}
  .theme-card.current{box-shadow:var(--medium);}
  .theme-card.current:before,.info-card:before,.info-summary-card:before{
    content:"";position:absolute;left:0;top:0;bottom:0;width:4px;
    background:var(--text-primary);z-index:3;pointer-events:none;
  }
  .theme-card .cover,.info-card .icon-box,.info-summary-card .cover{
    width:64px;flex-shrink:0;align-self:stretch;background:var(--solid-on-card);
    display:flex;align-items:center;justify-content:center;
    color:var(--text-muted);position:relative;overflow:hidden;
  }
  .theme-card .cover img,
  .info-summary-card .cover img,
  .bar-cover-wrap img{
    width:100%;
    height:100%;
    object-fit:cover;
    object-position:center;
  }
  .info-card img.icon-box{
    width:64px;
    height:64px;
    object-fit:cover;
    object-position:center;
    flex-shrink:0;
  }
  .cover-fallback{
    position:absolute;inset:0;display:flex;align-items:center;justify-content:center;
    font-size:.72em;font-weight:800;letter-spacing:.04em;color:var(--text-disabled);
  }
  @media(prefers-reduced-motion:no-preference){
    .theme-card .cover:not(:has(.cover-img.loaded)),
    .info-summary-card .cover:not(:has(.cover-img.loaded)),
    .bar-cover-wrap:not(:has(.cover-img.loaded)){
      animation:coverShimmer 2s cubic-bezier(0.4,0,0.6,1) infinite;
    }
  }

  /* Jede sichtbare Titelzeile erhält ihre eigene Schraffur. */
  .audio-cover-anime > span.has-title-lines{
    display:flex;
    flex-direction:column;
    align-items:flex-start;
    width:100%;
    line-height:.68;
    white-space:nowrap;
  }
  .audio-cover-anime > span.has-title-lines::before,
  .audio-cover-anime > span.has-title-lines::after{
    display:none !important;
  }
  .audio-cover-anime > span.has-title-lines > .audio-cover-anime-first-line,
  .audio-cover-anime > span.has-title-lines > .audio-cover-anime-second-line,
  .audio-cover-anime > span.has-title-lines > .audio-cover-anime-third-line{
    position:relative;
    z-index:1;
    display:block;
    width:max-content;
    max-width:100%;
    background:none;
    isolation:isolate;
    white-space:nowrap !important;
  }
  /* Restored cover hatch: the irregular, hand-drawn shape is intentionally
     kept on the title line instead of being generated by the whole caption. */
  .audio-cover-anime > span > .audio-cover-anime-first-line::before,
  .audio-cover-anime > span > .audio-cover-anime-second-line::before,
  .audio-cover-anime > span > .audio-cover-anime-third-line::before{
    content:"";
    position:absolute;
    z-index:-1;
    inset:-.08em -.65em -.65em -.18em;
    border-radius:0;
    background:
      repeating-linear-gradient(-27deg,rgba(255,255,255,.72) 0,rgba(255,255,255,.72) 1.2px,transparent 1.2px,transparent 5px),
      repeating-linear-gradient(-34deg,rgba(255,255,255,.44) 0,rgba(255,255,255,.44) 2px,transparent 2px,transparent 8px),
      repeating-linear-gradient(-21deg,rgba(255,255,255,.22) 0,rgba(255,255,255,.22) 1px,transparent 1px,transparent 11px);
    background-blend-mode:screen;
    clip-path:polygon(0 24%,4% 15%,9% 18%,14% 8%,20% 13%,26% 5%,32% 10%,38% 3%,44% 8%,50% 2%,56% 7%,62% 4%,68% 11%,74% 5%,80% 13%,86% 7%,92% 15%,98% 9%,100% 24%,97% 35%,100% 47%,96% 59%,100% 71%,95% 82%,98% 94%,90% 90%,83% 100%,75% 94%,67% 99%,59% 93%,51% 100%,43% 95%,35% 98%,27% 91%,19% 97%,12% 89%,5% 94%,1% 83%,4% 72%,0 61%,3% 50%,0 39%);
    transform:rotate(-.7deg) skewX(-1.5deg);
    filter:blur(.15px);
  }
  /* The generated line wrapper is intentionally strict: each of its two
     children is one visual line, never a second hidden wrap inside a line. */
  .audio-cover-anime-title-lines{
    display:flex;
    flex-direction:column;
    align-items:flex-start;
    width:100%;
    line-height:.68;
    white-space:nowrap;
  }
  .audio-cover-anime-three-lines{
    line-height:.52;
  }
  .audio-cover-anime-title-lines > .audio-cover-anime-first-line,
  .audio-cover-anime-title-lines > .audio-cover-anime-second-line,
  .audio-cover-anime-title-lines > .audio-cover-anime-third-line{
    display:block;
    width:max-content;
    max-width:100%;
    white-space:nowrap !important;
  }
  /* Generated title lines share one hatch implementation in every layout. */
  .audio-cover-anime > span::before{display:none;}
  @media(max-width:870px){
    /* Mobile keeps the old stable compositing layer used by iOS. */
  .audio-cover-anime > span > .audio-cover-anime-first-line::before,
  .audio-cover-anime > span > .audio-cover-anime-second-line::before,
  .audio-cover-anime > span > .audio-cover-anime-third-line::before{
      transform:none;
      filter:none;
      -webkit-transform:none;
      -webkit-backface-visibility:hidden;
    }
  }
  .cover-img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:0;transition:opacity .25s;}
  .cover-img.loaded{opacity:1;}
  .theme-card .cover .play-overlay{
    position:absolute;inset:0;z-index:1;
    display:flex;align-items:center;justify-content:center;
    background:rgba(0,0,0,0.4);opacity:0;transition:opacity .15s;
    color:var(--text);font-size:.9rem;
  }
  .theme-card:hover .cover .play-overlay{opacity:1;}
  .theme-card .info,.info-card .txt,.info-summary-card .body{flex:1;min-width:0;display:flex;flex-direction:column;justify-content:center;gap:.2rem;padding:10px 14px;}
  .theme-card .title,.info-card .txt .t,.info-summary-card .name{font-size:.88em;font-weight:700;color:var(--text-primary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
  .info-summary-card .name a{color:inherit;}
  .theme-card .title .by{color:var(--text-muted);font-weight:600;}
  .theme-card .meta,.info-card .txt .s,.info-summary-meta{font-size:.78em;color:var(--text-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
  .theme-card .meta .dot,.info-summary-meta .dot{margin:0 4px;opacity:.7;}
  .info-summary-meta a{color:var(--text-primary);}
  .sidebar-empty{color:var(--text-disabled);font-size:.82em;font-style:italic;text-align:center;padding:20px;}

  /* ── INFO TAB ── */
  .info-details{padding:4px 0;display:flex;flex-direction:column;gap:16px;}
  .info-section-title{font-size:.9rem;font-weight:700;text-transform:uppercase;letter-spacing:1px;color:var(--text-muted);margin:0px;}
  .info-section-title:first-child{margin-top:0;}
  .info-links{display:flex;flex-wrap:wrap;gap:6px;}
  .info-link{
    display:inline-flex;align-items:center;gap:4px;
    padding:3px 10px;border-radius:999px;
    font-size:.75em;font-weight:600;
    background:var(--solid);color:var(--text-muted);transition:all .15s;
  }
  .info-link:hover{background:var(--solid-primary);color:var(--text-on-primary);}
  .history-count{font-size:.72em;color:var(--text-disabled);text-align:center;flex-shrink:0;padding-top:4px;}

  /* ── PLAYER BAR ── */
  .bar{background:var(--solid);width:100%;position:relative;}
  .bar-prog{position:absolute;top:0;left:0;right:0;cursor:pointer;touch-action:none;z-index:30;padding:14px 0;transform:translateY(-50%);}
  .bar-prog .bp-wrap{position:relative;width:100%;height:2px;background:var(--solid-on-card);border-radius:0;transition:height 100ms;}
  .bar-prog:hover .bp-wrap{height:4px;}
  .bar-prog .bp-fill{position:absolute;top:0;left:0;height:100%;background:var(--text-primary);width:0;}
  .bar.media-loading .bar-prog .bp-wrap{height:4px;}
  .bar.media-loading .bar-prog .bp-fill{width:100%!important;background:transparent;overflow:hidden;}
  .bar.media-loading .bar-prog .bp-fill::before{content:"";position:absolute;left:-42px;top:0;width:42px;height:100%;background:var(--text-primary);opacity:0;animation:progressStripe .7s linear 1.5s infinite backwards;}
  .bar.media-loading .bar-prog .bp-fill::after{display:none;}
  .bar-prog .bp-fill::after{content:"";position:absolute;top:50%;right:0;width:16px;height:16px;border-radius:50%;background:var(--text-primary);transform:translateY(-50%);opacity:0;transition:opacity 200ms;}
  .bar-prog:hover .bp-fill::after{opacity:1;transition:opacity 100ms;}
  .bar-prog .bp-buf{position:absolute;top:0;left:0;height:100%;background:var(--text-muted);opacity:.2;width:0;}
  .bar-prog .bp-tt{position:absolute;top:-24px;padding:4px 8px;background-color:var(--solid);pointer-events:none;opacity:0;transition:opacity 100ms;transform:translateX(-50%)}
  .bar-prog:hover .bp-tt,.bar-prog.seeking .bp-tt{opacity:1;}

  .bar-inner{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;padding:10px 32px;height: 76px;width:100%;column-gap:16px;position:static;}
  .bar-cover-wrap{position:absolute;left:0;top:0;height:100%;width:76px;overflow:hidden;background:var(--solid-on-card);color:var(--text-muted);z-index:10;display:flex;align-items:center;justify-content:center;}
  .bar-cover-wrap .cover-fallback{font-size:.62em;}
  .links-card{max-height:none !important;}
  .bar-left{display:flex;align-items:center;min-width:0;overflow:hidden;grid-column:1;padding-left:60px;}
  .bar-song{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px;overflow:hidden;}
  .bar-song .pst{font-size:.88rem;font-weight:600;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
  .bar-song .psa{font-size:.73rem;color:var(--text-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
  @media(max-width:970px){.bar-cover-wrap{display:none;}.bar-left{padding-left:0;}}
  @media(max-width:870px){.bar-left{display:none;}}

  .bar-ctrls{display:flex;align-items:center;gap:16px;flex-shrink:0;grid-column:2;justify-self:center;}
  .bar-btn{background:transparent;border:none;border-radius:999px;cursor:pointer;color:var(--text-disabled);padding:8px;display:flex;align-items:center;justify-content:center;transition:color .15s,background-color .2s ease;font-size:2rem;line-height:1;width:56px;height:56px;}
  .bar-btn:hover{
    background:var(--solid-on-card);
  }
  .bar-btn:disabled{opacity:.3;pointer-events:none;}
  .bar-btn svg{width:1em;height:1em;fill:currentColor;}

  .bar-acts{flex:1;min-width:0;display:flex;align-items:center;justify-content:flex-end;gap:16px;grid-column:3;}
  .mode-toggle>svg:not(.mode-icon){display:none !important;}
  .mode-icon{width:1em;height:1em;fill:currentColor;}
  .mode-icon[hidden]{display:none !important;}
  @media(max-width:1100px){#bar .bar-vol,#bar #pmb,#bar #pvs,.bar-vol-slider{display:none !important;}}
  @media(max-width:870px){
    .bar-acts{display:flex;gap:8px;}
    .bar-vol,.bar-acts #pshare{display:none;}
    .bar-acts #pmode{width:40px;height:40px;min-width:40px;padding:0;justify-content:center;gap:0;border-radius:50%;}
    .bar-acts #pmode .mode-label{display:none;}
    .vid-wrap .ov-wrap{display:none;}
  }
  .bar-vol{
    display:flex;
    align-items:center;
    gap:8px;
    margin-right:auto;
  }

  .bar-vol button{
      background:transparent;
      border:none;
      color:var(--text-disabled);
      cursor:pointer;
      padding:8px;
      display:flex;
      align-items:center;
      width:32px;
      height:32px;

      border-radius:999px;

      transition:
        color .2s ease,
        background-color .2s ease;
      font-size:2rem;
      line-height:1;
      justify-content:center;
  }

  .bar-vol button:hover{
    background:var(--solid-on-card);
  }

  .bar-vol button svg{
      width:1em;
      height:1em;
      fill:currentColor;
  }

  .bar-vol-slider{
      width:80px;
      opacity:0;
      transition:opacity .2s;
      pointer-events:none;
      display:flex;
      align-items:center;
      height:34px; /* gleiche Höhe wie der Button */
  }

  .bar-vol:hover .bar-vol-slider,
  .bar-vol-slider:hover{
      opacity:1;
      pointer-events:auto;
  }
  .bar-vol-slider input{
    --percent:100%;

    appearance:none;
    -webkit-appearance:none;

    width:80px;
    background:transparent;
    display:block;
    margin:0;
  }
  .bar-vol-slider input::-webkit-slider-runnable-track,
  #pvs::-webkit-slider-runnable-track{
    height:4px;
    border-radius:999px;

    background:
        linear-gradient(
            to right,
            var(--text-disabled) 0 var(--percent),
            var(--solid-on-card) var(--percent) 100%
        );
  }
  .bar-vol-slider input::-webkit-slider-thumb,
  #pvs::-webkit-slider-thumb{
    -webkit-appearance:none;

    width:20px;
    height:20px;

    margin-top:-8px;

    border:none;
    border-radius:50%;

    background:var(--text-disabled);

    box-shadow:var(--low);

    cursor:pointer;
  }
  .bar-vol-slider input::-moz-range-track,
  #pvs::-moz-range-track{
    height:4px;
    border-radius:999px;

    background:
        linear-gradient(
            to right,
            var(--text-disabled) 0 var(--percent),
            var(--solid-on-card) var(--percent) 100%
        );
}

  .bar-vol-slider input::-moz-range-thumb,
  #pvs::-moz-range-thumb{
    width:20px;
    height:20px;

    border:none;
    border-radius:50%;

    background:var(--text-disabled);

    box-shadow:var(--low);

    cursor:pointer;
  }
  #pvs{
    width:120px;
  }
  .bar-share{display:flex;align-items:center;gap:6px;padding:8px 14px;border-radius:999px;background:var(--solid-on-card);color:var(--text-muted);border:none;cursor:pointer;font-family:inherit;font-size:.75rem;font-weight:700;text-transform:uppercase;letter-spacing:.05rem;transition:all .15s;white-space:nowrap;}
  #pmode{width:92px;min-width:92px;justify-content:center;}
  .bar-share:hover{background:var(--gray-600);color:var(--text);}
  .bar-share:disabled{opacity:.35;cursor:not-allowed;}
  .bar-share svg{width:14px;height:14px;fill:currentColor;}
