/* One visual language for saved literature across desktop, mobile and cards.
   All icons reference the SAME SVG; real navigation and list handlers remain intact. */
:root{--merkmappe-icon:url("merkmappe.svg?v=20260921-1")}

/* The heading and desktop navigation use normal text plus the new pictogram. */
#appNav #favoritesNav,
#appNav .navbtn[href$="#merkliste"]{gap:8px}
#appNav #favoritesNav::before,
#appNav .navbtn[href$="#merkliste"]::before,
#favoritesViewHeader>.programme-heading h2::before,
#favoritesViewHeader>.bookmark-overview .programme-heading h2::before,
#favoritesViewHeader>h2::before{
  content:"";
  display:inline-block;
  vertical-align:-3px;
  width:20px;
  height:20px;
  flex:none;
  margin-right:0;
  background-color:currentColor;
  -webkit-mask:var(--merkmappe-icon) center/contain no-repeat;
  mask:var(--merkmappe-icon) center/contain no-repeat;
}
#favoritesViewHeader>.programme-heading h2::before,
#favoritesViewHeader>.bookmark-overview .programme-heading h2::before,
#favoritesViewHeader>h2::before{margin-right:9px;vertical-align:-2px}

/* Keep V4's existing navigation, click handlers, active tab and tab dimensions.
   Replace only the old two-books pictogram with the shared sheet icon. */
.v4-bottom-nav .v4-tab[data-destination="lists"] svg{display:none!important}
.v4-bottom-nav .v4-tab[data-destination="lists"]::before{
  content:"";
  display:block;
  flex:none;
  width:21px;
  height:21px;
  background-color:currentColor;
  -webkit-mask:var(--merkmappe-icon) center/contain no-repeat;
  mask:var(--merkmappe-icon) center/contain no-repeat;
}

/* Reuse the same pictogram in the actual favourite button. The !important
   image reset is intentional: V4 formerly paints a different bookmark via a
   highly specific background-image rule, also in its pressed state. */
#results>.result .result-toggle-row .favorite-btn{gap:6px}
#results>.result .result-toggle-row .favorite-btn::before{
  content:"";
  display:inline-block;
  flex:none;
  width:19px;
  height:21px;
  background-image:none!important;
  background-color:currentColor!important;
  -webkit-mask:var(--merkmappe-icon) center/contain no-repeat;
  mask:var(--merkmappe-icon) center/contain no-repeat;
}
#results>.result .result-toggle-row .favorite-btn[aria-pressed="true"]::before{
  background-image:none!important;
}
/* Root cause of the misalignment: the icon-only mobile button is 28px wide,
   but its former 26px icon PLUS a 6px flex gap exceeded that width. The
   invisible legacy label was still a flex item and moved/clipped the artwork.
   Keep both action buttons in their existing identical boxes, remove only the
   favorite's gap and match the stand's visible SVG height (Merkmappe art spans
   17/24 units, stand art 18.8/24). */
body[data-design-variant="v4"] #results>.result .result-toggle-row .favorite-btn{
  gap:0!important;
}
body[data-design-variant="v4"] #results>.result .result-toggle-row .favorite-btn::before{
  width:25px!important;
  height:25px!important;
  flex:0 0 25px!important;
  margin:0!important;
  background-image:none!important;
  background-color:currentColor!important;
  -webkit-mask:var(--merkmappe-icon) center/contain no-repeat!important;
  mask:var(--merkmappe-icon) center/contain no-repeat!important;
}
@media(max-width:700px){
  body[data-design-variant="v4"] #results>.result .result-toggle-row .favorite-btn::before{
    width:22px!important;
    height:22px!important;
    flex-basis:22px!important;
  }
}
/* Both controls already share the same right inset and button dimensions in
   V4. Center the icon without modifying either button's geometry or handlers. */
body[data-design-variant="v4"] #results>.result .result-toggle-row .favorite-btn,
body[data-design-variant="v4"] #results>.result .result-toggle-row .programme-add-btn{
  align-items:center!important;
  justify-content:center!important;
}
/* The existing module still supplies accessible, up-to-date aria-label and
   aria-pressed attributes. Hide only its legacy star glyph and print clean
   fallback button labels in original V1–V3, where text is visible. */
body:not([data-design-variant="v4"]) #results>.result .result-toggle-row .favorite-btn{font-size:0!important}
body:not([data-design-variant="v4"]) #results>.result .result-toggle-row .favorite-btn::after{
  content:"Merken";
  font-size:13px;
  line-height:1.3;
}
body:not([data-design-variant="v4"]) #results>.result .result-toggle-row .favorite-btn[aria-pressed="true"]::after{content:"Gemerkt"}
body:not([data-design-variant="v4"]) #results>.result .result-toggle-row .favorite-btn[aria-pressed="true"]{
  color:#754285;
  background:#f8e9f3;
}

/* Static bookmark dialog internals. Markup/behaviour stays in merklisten-v2.js. */
.merklisten-check{display:flex;align-items:center;gap:12px;margin:9px 0;padding:9px;border:1px solid #dde3ed;border-radius:8px}
.merklisten-check input{width:19px;height:19px;flex:none}
.merklisten-buttons{display:flex;gap:8px;flex-wrap:wrap;margin-top:14px}
.merklisten-manage{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
.merklisten-manage select{min-width:180px;flex:1}

/* Static search bookmark action base. Higher-specificity V4/V5 rules still own the production icon tile. */
.result-toggle-row .favorite-btn{position:static!important;display:inline-flex!important;align-items:center;justify-content:center;flex:0 0 auto!important;width:auto!important;max-width:100%;height:36px;padding:0 12px;margin:0!important;white-space:nowrap;font-size:13px}
@media(max-width:700px){.result-toggle-row .favorite-btn{height:36px;padding:0 10px;font-size:12px}}

/* Static bookmark overview presentation. Markup/behaviour remains in merklisten-overview.js. */
.bookmark-original-controls[hidden]{display:none!important}
.bookmark-overview .programme-heading{margin-bottom:4px}
.bookmark-overview .programme-card button{cursor:pointer}
.bookmark-overview .bookmark-list-actions{display:flex;gap:8px;flex-wrap:wrap;margin:13px 0 5px}
.bookmark-overview .bookmark-list-actions button{flex:0 1 auto}
.bookmark-overview .bookmark-back{margin:0 0 12px}
@media(max-width:700px){.bookmark-overview .bookmark-list-actions button{flex:1 1 130px}}

