/* Quiet, touch-sized reading controls shared by phone, tablet and desktop. */
#readerhud { align-items: center; gap: .5rem; }
#readerhud .readpct {
  height: 44px; min-width: 56px; padding-inline: .75rem;
  border: 1px solid var(--border-strong); border-radius: 14px;
  color: var(--ink-1); background: var(--paper-1); box-shadow: 0 4px 18px #0002;
  font: 600 .8125rem/1 var(--font-body); font-variant-numeric: tabular-nums;
}
#readerhud .foldpill {
  position: relative; display: block; padding: 0; border: 0;
  border-radius: 14px; background: transparent; box-shadow: none; filter: none;
  transform: translateY(0); transition: opacity 160ms ease, transform 160ms ease, visibility 0s;
}
#readerhud .foldpill[hidden] { display: none; }
#readerhud .foldpill[data-hidden="true"] {
  opacity: 0; visibility: hidden; filter: none; transform: translateY(6px);
  pointer-events: none; transition: opacity 160ms ease, transform 160ms ease, visibility 0s 160ms;
}
.foldmenu-toggle {
  display: flex; align-items: center; gap: .5rem; min-height: 44px; padding: .625rem .75rem;
  border: 1px solid var(--border-strong); border-radius: 14px;
  background: var(--paper-1); color: var(--ink-1); box-shadow: 0 4px 18px #0002;
  font: 600 .8125rem/1.2 var(--font-body); cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease;
}
.foldmenu-toggle > svg, .fold-menu button > svg { flex: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.foldmenu-toggle .foldmenu-chevron { width: 16px; height: 16px; transition: transform 160ms ease; }
.foldmenu-toggle[aria-expanded="true"] { border-color: var(--text-accent); background: var(--paper-2); }
.foldmenu-toggle[aria-expanded="true"] .foldmenu-chevron { transform: rotate(180deg); }
.fold-menu {
  position: absolute; bottom: calc(100% + .625rem); right: 0;
  width: min(280px, calc(100vw - 2rem)); padding: .5rem;
  border: 1px solid var(--border-strong); border-radius: 16px;
  color: var(--ink-1); background: var(--paper-1); box-shadow: 0 12px 36px #0004;
  animation: fold-menu-enter 160ms ease-out;
}
.fold-menu[hidden] { display: none; }
.fold-menu > p { margin: .375rem .625rem .625rem; color: var(--ink-2); font: 500 .75rem/1.4 var(--font-body); }
.fold-menu button {
  display: flex; align-items: center; gap: .75rem; width: 100%; min-height: 60px;
  padding: .625rem; border: 1px solid transparent; border-radius: 10px;
  background: transparent; color: var(--ink-1); text-align: left; cursor: pointer; box-shadow: none;
}
.fold-menu button strong { display: block; font: 600 .9375rem/1.4 var(--font-body); }
.fold-menu button small { display: block; margin-top: .125rem; color: var(--ink-2); font: 400 .75rem/1.4 var(--font-body); }
.fold-menu button[aria-pressed="true"] { color: var(--text-accent); background: var(--paper-2); }
.fold-menu__check { visibility: hidden; margin-left: auto; }
.fold-menu button[aria-pressed="true"] .fold-menu__check { visibility: visible; }
:is(.fold-menu button, .foldmenu-toggle):focus-visible { outline: 2px solid var(--text-accent); outline-offset: 2px; }
.topbar #tunerbtn { display: inline-flex; align-items: center; justify-content: center; gap: .625rem; min-width: 44px; min-height: 44px; border-radius: 14px; padding-inline: .75rem; }
.vibel-music-icon { flex: none; width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; color: var(--text-accent); transition: transform 180ms ease; }
.vibel-music-icon__dot { fill: currentColor; stroke: none; }
#tunerbtn[aria-expanded="true"] .vibel-music-icon { transform: rotate(-8deg); }
@media (hover: hover) {
  .foldmenu-toggle:hover, .fold-menu button:hover { background: var(--paper-2); }
  #tunerbtn:hover .vibel-music-icon { transform: rotate(-8deg); }
}
@media (max-width: 599px) {
  .music-entry-label { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); }
  .topbar #tunerbtn { width: 44px; padding: 8px; }
  #readerhud { right: max(.75rem, env(safe-area-inset-right)); }
}
@keyframes fold-menu-enter { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  #readerhud .foldpill, #readerhud .foldpill[data-hidden="true"], .foldmenu-toggle, .foldmenu-chevron, .vibel-music-icon { transition: none; transform: none; }
  .fold-menu { animation: none; }
}
