/* Added controls stay absent from desktop and the collapsed swipe bar. */
#yz-portal .yz-nav > :is(.yzlib-head,.yzlib-group,.yzlib-empty){display:none}
/* yourZone Bibliothek 20261108 – nur Darstellung.
   Die Knöpfe der bestehenden Navigation bleiben unverändert (gleiche Elemente, gleiche Klick-Logik).
   Gruppen und Favoriten entstehen nur über CSS-Reihenfolge (order) – der Watch-Scroll findet weiter alle Bereiche. */

@media (max-width: 850px) {
  /* Glasblatt: genug Deckkraft, damit nichts von der Seite durchschimmert (vorher: weiße Wochentag-Kacheln) */
  html[data-yz-theme] #yz-portal .yz-nav[data-yz-library=open],
  html[data-yz-theme] #yz-portal.yz-coach-workspace .yz-nav[data-yz-library=open] {
    --yzlib-h: min(60dvh, 520px);
    box-sizing: border-box !important; height: var(--yzlib-h) !important; max-height: var(--yzlib-h) !important;
    grid-auto-rows: min-content; align-content: start;
    padding: 0 12px 16px !important; gap: 4px 6px !important;
    border-radius: 26px !important;
    background: rgba(18, 24, 26, 0.92) !important;
    backdrop-filter: blur(30px) saturate(1.25) !important; -webkit-backdrop-filter: blur(30px) saturate(1.25) !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    box-shadow: 0 -12px 50px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.10) !important;
    scrollbar-width: none; overscroll-behavior: contain; scroll-padding-top: 132px;
    overflow-x: hidden !important; overflow-y: auto !important;
  }
  html[data-yz-theme=light] #yz-portal .yz-nav[data-yz-library=open],
  html[data-yz-theme=light] #yz-portal.yz-coach-workspace .yz-nav[data-yz-library=open] {
    background: rgba(247, 251, 251, 0.94) !important;
    border-color: rgba(21, 45, 46, 0.14) !important;
    box-shadow: 0 -12px 44px rgba(16, 35, 39, 0.16), inset 0 1px 0 #fff !important;
  }
  html[data-yz-theme] #yz-portal .yz-nav[data-yz-library=open]::-webkit-scrollbar { display: none; }

  /* Kopf: Titel, Suche, Anpassen – klebt oben im Blatt */
  html[data-yz-theme] #yz-portal .yz-nav .yzlib-head { display: none; }
  html[data-yz-theme] #yz-portal .yz-nav[data-yz-library=open] .yzlib-head {
    display: flex; flex-direction: column; gap: 12px; order: -10000; grid-column: 1 / -1; min-width: 0;
    position: sticky; top: 0; z-index: 3; margin: 0 0 4px; padding: 16px 4px 12px;
    background: inherit; border-radius: 26px 26px 0 0;
  }
  .yzlib-titlerow { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
  .yzlib-eyebrow { display: block; font: 700 10px/1.4 Manrope, sans-serif; letter-spacing: 0.16em; text-transform: uppercase; color: #59bfc1; }
  html[data-yz-theme=light] .yzlib-eyebrow { color: #2a8587; }
  .yzlib-title { display: block; margin-top: 2px; font: 600 30px/0.95 'Barlow Condensed', Manrope, sans-serif; color: var(--glass-ink, #f4f7f8); letter-spacing: 0.005em; }
  html[data-yz-theme] #yz-portal .yz-nav[data-yz-library] button.yzlib-edit {
    flex: none; width: auto !important; min-width: 0 !important; height: 36px !important; min-height: 36px !important;
    padding: 0 14px !important; border-radius: 18px !important; font: 700 12px/1 Manrope, sans-serif !important;
    border: 1px solid var(--glass-line, #ffffff32) !important; background: transparent !important; color: var(--glass-ink, #f4f7f8) !important;
    display: inline-flex !important; align-items: center; justify-content: center; gap: 0 !important;
  }
  html[data-yz-theme] #yz-portal .yz-nav[data-yz-library] button.yzlib-edit[aria-pressed=true] { background: #59bfc1 !important; border-color: #59bfc1 !important; color: #10292b !important; -webkit-text-fill-color: #10292b !important; }
  .yzlib-search { position: relative; display: block; }
  .yzlib-search::before { content: ''; position: absolute; left: 15px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); background: currentColor; color: var(--glass-muted, #bac8cc); pointer-events: none;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='M16 16l4 4'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='M16 16l4 4'/%3E%3C/svg%3E") center / contain no-repeat; }
  html[data-yz-theme] #yz-portal .yz-nav .yzlib-search input {
    width: 100% !important; height: 48px !important; min-height: 48px !important; margin: 0 !important; padding: 0 14px 0 40px !important;
    border-radius: 22px !important; border: 1px solid var(--glass-line, #ffffff32) !important;
    background: rgba(255, 255, 255, 0.06) !important; font: 500 16px/22px Manrope, sans-serif !important;
  }
  html[data-yz-theme=light] #yz-portal .yz-nav .yzlib-search input { background: rgba(16, 35, 39, 0.05) !important; }
  .yzlib-hint { margin: 0; font: 500 12px/1.5 Manrope, sans-serif; color: var(--glass-muted, #bac8cc); }
  html[data-yz-theme] #yz-portal .yz-nav[data-yz-library=open] .yzlib-empty { display:block; order: 9000; grid-column: 1 / -1; margin: 8px 0; text-align: center; font: 500 14px/1.5 Manrope, sans-serif; color: var(--glass-muted, #bac8cc); }

  /* Gruppenköpfe (aufklappbar). Absichtlich OHNE svg – der Watch-Scroll nimmt nur Knöpfe mit Symbol. */
  html[data-yz-theme] #yz-portal .yz-nav .yzlib-group { display: none !important; }
  html[data-yz-theme] #yz-portal .yz-nav[data-yz-library=open] .yzlib-group {
    display: flex !important; grid-column: 1 / -1; align-items: center; gap: 10px;
    width: 100% !important; min-height: 48px !important; height: auto !important; margin: 10px 0 2px !important; padding: 0 4px 0 6px !important;
    border: 0 !important; border-top: 1px solid var(--glass-line, #ffffff32) !important; border-radius: 0 !important;
    background: transparent !important; text-align: left; flex-direction: row !important; justify-content: flex-start !important;
    font: 600 20px/1 'Barlow Condensed', Manrope, sans-serif !important; letter-spacing: 0.01em; color: var(--glass-ink, #f4f7f8) !important;
  }
  html[data-yz-theme] #yz-portal .yz-nav[data-yz-library=open] .yzlib-group.is-first { border-top: 0 !important; margin-top: 0 !important; }
  html[data-yz-theme] #yz-portal .yz-nav[data-yz-library=open] button.yzlib-group[hidden] { display: none !important; }
  .yzlib-group b { flex: 1; font: inherit; }
  .yzlib-count { min-width: 26px; height: 22px; padding: 0 8px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center;
    font: 700 11.5px/1 Manrope, sans-serif; background: rgba(255, 255, 255, 0.08); color: var(--glass-muted, #bac8cc); }
  html[data-yz-theme=light] .yzlib-count { background: rgba(16, 35, 39, 0.07); }
  .yzlib-chev { width: 32px; height: 32px; position: relative; flex: none; }
  .yzlib-chev::before { content: ''; position: absolute; left: 12px; top: 9px; width: 8px; height: 8px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform 0.25s, top 0.25s; color: var(--glass-muted, #bac8cc); }
  .yzlib-group[aria-expanded=true] .yzlib-chev::before { transform: rotate(-135deg); top: 13px; color: #59bfc1; }
  .yzlib-group--fav .yzlib-chev { display: none; }

  /* Reihenfolge nur im geöffneten Blatt – die Wisch-Leiste unten bleibt wie bisher */
  html[data-yz-theme] #yz-portal .yz-nav[data-yz-library=open] button[data-yzlib-item] { order: var(--yzlib-order, 0) !important; }
  /* Kacheln: einheitlich, Symbol in weicher Fläche, aktiver Bereich gefüllt */
  html[data-yz-theme] #yz-portal .yz-nav[data-yz-library=open] button[data-yzlib-item] {
    position: relative; min-height: 98px !important; padding: 12px 4px 10px !important; gap: 9px !important;
    border-radius: 18px !important; border: 1px solid transparent !important; background: transparent !important; box-shadow: none !important;
    grid-template-rows: 46px auto !important; font: 600 12px/1.25 Manrope, sans-serif !important;
  }
  html[data-yz-theme] #yz-portal .yz-nav[data-yz-library=open] button[data-yzlib-item] > svg[data-yz-symbol] {
    box-sizing: border-box; width: 46px !important; height: 46px !important; flex: 0 0 46px !important; padding: 11px;
    border-radius: 15px; background: rgba(89, 191, 193, 0.15) !important; color: #59bfc1 !important;
  }
  html[data-yz-theme=light] #yz-portal .yz-nav[data-yz-library=open] button[data-yzlib-item] > svg[data-yz-symbol] { background: rgba(89, 191, 193, 0.18) !important; color: #1f777b !important; }
  html[data-yz-theme] #yz-portal .yz-nav[data-yz-library=open] button[data-yzlib-item]:is(.active,[aria-current=page]) { background: rgba(89, 191, 193, 0.10) !important; border-color: rgba(89, 191, 193, 0.35) !important; }
  html[data-yz-theme] #yz-portal .yz-nav[data-yz-library=open] button[data-yzlib-fav] > svg[data-yz-symbol] { background: #59bfc1 !important; color: #0f2a2c !important; }
  html[data-yz-theme] #yz-portal .yz-nav[data-yz-library=open] button[data-yzlib-item] > span {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 100%;
  }
  /* Favoriten-Gruppe: Kreise statt Quadrate */
  html[data-yz-theme] #yz-portal .yz-nav[data-yz-library=open] button[data-yzlib-fav] > svg[data-yz-symbol] { border-radius: 50%; box-shadow: 0 6px 18px rgba(89, 191, 193, 0.25); }

  /* Anpassen: Stern auf jeder Kachel (gezeichnet, kein Zeichen) */
  html[data-yz-theme] #yz-portal .yz-nav[data-yz-library=open][data-yzlib-editing] button[data-yzlib-item]::after {
    content: ''; position: absolute; top: 6px; right: 8px; width: 24px; height: 24px; border-radius: 12px;
    background: rgba(18, 24, 26, 0.9) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2393a1a4' stroke-width='1.8' stroke-linejoin='round'%3E%3Cpath d='M12 4l2.4 5 5.4.7-4 3.7 1 5.3L12 16.1 7.2 18.7l1-5.3-4-3.7 5.4-.7z'/%3E%3C/svg%3E") center / 15px no-repeat;
    border: 1px solid rgba(255, 255, 255, 0.16);
  }
  html[data-yz-theme] #yz-portal .yz-nav[data-yz-library=open][data-yzlib-editing] button[data-yzlib-fav]::after {
    background: #59bfc1 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%230f2a2c' stroke='%230f2a2c' stroke-width='1.6' stroke-linejoin='round'%3E%3Cpath d='M12 4l2.4 5 5.4.7-4 3.7 1 5.3L12 16.1 7.2 18.7l1-5.3-4-3.7 5.4-.7z'/%3E%3C/svg%3E") center / 15px no-repeat;
    border-color: #59bfc1;
  }
  html[data-yz-theme=light] #yz-portal .yz-nav[data-yz-library=open][data-yzlib-editing] button[data-yzlib-item]:not([data-yzlib-fav])::after { background-color: #fff; border-color: rgba(21, 45, 46, 0.18); }

  /* Zugeklappt / nicht gefunden: optisch weg, aber NICHT display:none – der Watch-Scroll prüft display. */
  html[data-yz-theme] #yz-portal .yz-nav[data-yz-library=open] button[data-yzlib-hide] {
    position: absolute !important; width: 1px !important; height: 1px !important; min-height: 0 !important; padding: 0 !important; margin: 0 !important;
    overflow: hidden !important; clip-path: inset(50%) !important; opacity: 0 !important; pointer-events: none !important; visibility: hidden !important; border: 0 !important;
  }

  /* Runder Knopf (Watch-Scroll) sitzt bei offener Bibliothek ÜBER dem Blatt statt darin */
  html[data-yz-theme]:has(#yz-portal .yz-nav[data-yz-library=open]) #yz-quick-access {
    --quick-bottom: calc(114px + env(safe-area-inset-bottom, 0px) + min(60dvh, 520px)) !important;
  }
}

@media (prefers-reduced-motion: reduce) { .yzlib-chev::before { transition: none; } }

@media (max-width:850px){#yz-portal .yz-nav[data-yz-library=open] :is(.yzlib-edit,.yzlib-group):focus-visible{outline:2px solid #59bfc1!important;outline-offset:2px}#yz-portal .yz-nav[data-yz-library=open] .yzlib-search input{color:var(--glass-ink,#f4f7f8)!important}}
