/* Music stays a single clear control until the listener opens it. */
.study-music { position: relative; flex: 0 0 86px; }
.music-launcher { position: relative; display: flex; align-items: center; justify-content: center; gap: 6px; width: 86px; min-height: 44px; padding: 0 10px; overflow: hidden; border: 1px solid #dce5e8; border-radius: 9px; background: #f8fbfc; color: #244951; font: 600 13px/1.2 var(--sans); cursor: pointer; }
.music-launcher__icon { font-size: 18px; }
.music-launcher__dot { display: none; width: 5px; height: 5px; border-radius: 50%; background: #087f7b; }
.music-launcher:hover, .music-launcher[aria-expanded="true"] { border-color: #7babb7; background: #edf6fa; }
.study-music.is-playing .music-launcher { border-color: #75b1ae; background: #e9f7f3; color: #145c59; }
.study-music.is-playing .music-launcher__dot { display: block; }
.study-music.is-playing .music-launcher::after { content: ""; position: absolute; inset: -20% auto -20% -65%; width: 45%; background: linear-gradient(105deg, transparent, rgba(255,255,255,.85), transparent); transform: translateX(0) skewX(-14deg); animation: music-sheen 4s ease-in-out infinite; pointer-events: none; }
.music-fx { display: none; position: absolute; inset: 0; pointer-events: none; }
.study-music.is-playing .music-fx { display: block; }
.music-fx > span { position: absolute; top: 10px; color: #27847f; font: 700 16px/1 var(--sans); opacity: 0; animation: music-note 3s ease-out infinite; }
.music-fx > span:nth-child(1) { left: -5px; --note-drift: -9px; }
.music-fx > span:nth-child(2) { right: -6px; --note-drift: 9px; animation-delay: 1s; color: #637ea6; }
.music-fx > span:nth-child(3) { left: 52px; --note-drift: 4px; animation-delay: 2s; }
@keyframes music-sheen { 0%, 45% { transform: translateX(0) skewX(-14deg); } 75%, 100% { transform: translateX(460%) skewX(-14deg); } }
@keyframes music-note { 0% { opacity: 0; transform: translate(0, 0) rotate(-8deg); } 20% { opacity: .85; } 100% { opacity: 0; transform: translate(var(--note-drift), -26px) rotate(10deg); } }
.music-panel { position: absolute; z-index: 2; top: calc(100% + 14px); right: 0; width: 360px; max-height: calc(100dvh - 104px); overflow: auto; padding: 20px; border: 1px solid #c9dce5; border-radius: 18px; background: #fff; color: #244951; box-shadow: 0 18px 50px rgba(23,50,67,.18); font: 500 14px/1.5 var(--sans); }
.music-panel[hidden], .music-panel [hidden] { display: none; }
.music-panel__heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.music-panel h2 { margin: 0; font: 800 22px/1.2 "Nunito", var(--sans); }
.music-close { display: grid; place-items: center; width: 44px; min-height: 44px; margin: -8px -8px -8px 0; border: 0; border-radius: 9px; background: transparent; color: #244951; font-size: 24px; cursor: pointer; }
.music-close:hover { background: #edf6fa; }
.music-track-label { display: block; margin-bottom: 6px; font-weight: 600; }
.music-panel select { display: block; width: 100%; min-height: 44px; padding: 8px 10px; border: 1px solid #c9dce5; border-radius: 9px; background: #f8fbfc; color: #244951; font: inherit; }
.music-status { min-height: 21px; margin: 10px 0 14px; color: #526975; font-size: 12px; }
.music-transport { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 16px; }
.music-transport button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 44px; min-height: 44px; padding: 0 12px; border: 1px solid #c9dce5; border-radius: 10px; background: #f8fbfc; color: #244951; font: 700 14px/1.2 var(--sans); cursor: pointer; }
.music-transport button:hover { border-color: #75b1ae; background: #edf6fa; }
.music-transport .music-play { min-width: 110px; border-color: #75b1ae; background: #e9f7f3; }
.music-panel input[type="range"] { accent-color: #168a84; cursor: pointer; }
.music-seek { width: 100%; height: 24px; margin: 0; }
.music-time { display: flex; justify-content: space-between; color: #526975; font: 500 11px/1.5 var(--mono); }
.music-volume { display: flex; align-items: center; gap: 16px; margin-top: 16px; }
.music-volume input { width: 100%; min-width: 0; height: 24px; }
.music-credit { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid #e1ebef; color: #526975; font-size: 11px; line-height: 1.6; }
.music-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.topbar-social-overflow { display: none; position: relative; flex: 0 0 60px; }
.topbar-social-overflow summary { position: relative; display: flex; align-items: center; justify-content: center; gap: 5px; min-height: 44px; border: 1px solid #dce5e8; border-radius: 9px; background: #f8fbfc; color: #244951; font: 600 13px/1.2 var(--sans); cursor: pointer; list-style: none; }
.topbar-social-overflow summary::-webkit-details-marker { display: none; }
.topbar-social-overflow summary::after { content: "⌄"; font-size: 16px; }
.topbar-social-overflow[open] summary { border-color: #7babb7; }
.topbar-social-overflow nav { position: absolute; top: calc(100% + 8px); right: 0; display: grid; width: 156px; padding: 8px; border: 1px solid #c9dce5; border-radius: 12px; background: #fff; box-shadow: 0 12px 32px rgba(23,50,67,.14); }
.topbar-social-overflow a { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 0 8px; color: #244951; font: 600 13px/1.2 var(--sans); text-decoration: none; }
.topbar-social-overflow a:hover { background: #edf6fa; border-radius: 7px; }
@media (max-width: 800px) {
  .site-header--quiet .topbar-social { display: none; }
  .topbar-social-overflow { display: block; }
  .music-panel { position: fixed; inset: 120px 16px auto; width: auto; max-height: calc(100dvh - 144px); }
}
@media (prefers-reduced-motion: reduce) {
  .study-music.is-playing .music-launcher::after { animation: none; }
  .study-music.is-playing .music-fx > span { animation: none; }
  .study-music.is-playing .music-fx > span:first-child { opacity: .8; transform: translate(-4px, -12px); }
}
