/* A meglévő .settings panel, .icon-btn és téma-változók kiegészítése. */
.audio-panel { right: 105px; width: 290px; }
.audio-panel-heading, .audio-main, .audio-volume { display:flex; align-items:center; gap:10px; }
.audio-panel-heading { justify-content:space-between; margin-bottom:18px; align-items:flex-start; }
.audio-panel-heading .icon-btn { width:26px; height:26px; }
.audio-track-title { min-width:0; flex:1; color:var(--text); font-size:17px; line-height:1.35; font-weight:650; overflow-wrap:anywhere; }
.audio-main { gap:10px; }
.audio-play { flex:0 0 36px; width:36px; height:36px; display:inline-flex; align-items:center; justify-content:center; padding:0; border:1px solid var(--border); background:var(--surface-2); border-radius:10px; color:var(--text); }
/* SVG lejátszás/szünet jel (a karakteres ▶ / Ⅱ talpas betűvel jelent meg). A háromszög optikailag kicsit jobbra kerül. */
.audio-play .audio-play-icon { width:18px; height:18px; display:block; }
.audio-play[data-icon="play"] .audio-play-icon { transform:translateX(1px); }
.audio-play:disabled { opacity:.45; cursor:default; }
.audio-panel input[type=range], .audio-view input[type=range] { min-width:0; accent-color:var(--accent); cursor:pointer; }
.audio-main input[type=range] { flex:1; }
.audio-time { white-space:nowrap; font-size:11px; font-variant-numeric:tabular-nums; color:var(--muted); }
.audio-volume { border-top:1px solid var(--border); margin-top:14px; padding-top:13px; font-size:12px; color:var(--muted); }
.audio-volume[hidden] { display:none; }
.audio-volume input { flex:1; }
.audio-message { font-size:12px; color:var(--muted); margin-top:8px; }
.audio-message:empty { display:none; }
#btn-audio .audio-equalizer { display:none; height:19px; align-items:center; gap:3px; }
#btn-audio .audio-equalizer i { width:2px; height:9px; background:currentColor; border-radius:2px; animation:audio-bars 1.65s ease-in-out infinite alternate; }
#btn-audio .audio-equalizer i:nth-child(2) { height:15px; animation-delay:-.6s; }
#btn-audio .audio-equalizer i:nth-child(3) { height:6px; animation-delay:-1.1s; }
#btn-audio.audio-playing .audio-equalizer { display:flex; }
#btn-audio.audio-playing svg { display:none; }
@keyframes audio-bars { from { transform:scaleY(.45); } to { transform:scaleY(1.1); } }
@media (prefers-reduced-motion:reduce) { #btn-audio .audio-equalizer i { animation:none; } }
@media (max-width:720px), (max-height:500px) {
 .audio-panel { top:calc(52px + env(safe-area-inset-top) + 8px); right:8px; width:min(290px,calc(100vw - 16px)); }
}

#btn-audio[hidden] { display:none; }

/* Zene nélküli fejezetekben sem a gomb, sem a helye nem látszik. */
.audio-trigger { position:relative; display:inline-flex; align-items:center; }
.audio-trigger[hidden], #btn-audio[hidden] { display:none !important; }
/* Rövid, hangsúlyos, de a témaszínekkel harmonizáló fejezetértesítés. */
.audio-hint { position:absolute; z-index:110; top:calc(100% + 14px); right:-35px;
  width:max-content; max-width:min(300px,calc(100vw - 24px)); padding:12px 15px;
  background:var(--surface-2); color:var(--text); border:2px solid var(--accent);
  border-radius:12px; box-shadow:0 9px 28px rgba(0,0,0,.22), 0 0 0 4px var(--accent-soft);
  font-size:13px; font-weight:600; line-height:1.45; text-align:left; pointer-events:none;
  animation:audio-hint-enter .28s ease-out both; }
.audio-hint-icon { display:inline-block; margin-right:6px; font-size:17px; color:var(--accent); vertical-align:-1px; }
.audio-hint::before { content:""; position:absolute; top:-7px; right:47px;
  width:10px; height:10px; background:var(--surface-2); border-top:2px solid var(--accent);
  border-left:2px solid var(--accent); transform:rotate(45deg); }
.audio-hint[hidden] { display:none; }
@keyframes audio-hint-enter { from { opacity:0; transform:translateY(-5px) scale(.97); } to { opacity:1; transform:translateY(0) scale(1); } }
@media (prefers-reduced-motion:reduce) { .audio-hint { animation:none; } }
@media (max-width:720px) { .audio-hint { right:-65px; } .audio-hint::before { right:77px; } }

/* A ténylegesen szóló zene jelzése a fejlécben.
   A szín az equalizer-csíkokra is érvényes (currentColor). */
:root[data-theme="light"] #btn-audio.audio-playing,
:root[data-theme="papyrus"] #btn-audio.audio-playing {
  color: #c04040;
}
:root[data-theme="dark"] #btn-audio.audio-playing {
  color: #ffe65c;
}
/* A nyitott panel vagy az egérmutató ne írja felül a lejátszás jelzőszínét. */
:root[data-theme="light"] #btn-audio.audio-playing:hover,
:root[data-theme="light"] #btn-audio.audio-playing[aria-expanded="true"],
:root[data-theme="papyrus"] #btn-audio.audio-playing:hover,
:root[data-theme="papyrus"] #btn-audio.audio-playing[aria-expanded="true"] {
  color: #c04040;
}
:root[data-theme="dark"] #btn-audio.audio-playing:hover,
:root[data-theme="dark"] #btn-audio.audio-playing[aria-expanded="true"] {
  color: #ffe65c;
}

/* Második kezelőfelület (az (i) ablak zene-blokkja, ReaderAudio.createView). */
.audio-view { display:grid; gap:10px; }
.audio-view-title { color:var(--text); font-size:16px; font-weight:650; line-height:1.35; overflow-wrap:anywhere; }
.audio-view .audio-volume { margin-top:2px; padding-top:10px; }
.audio-view.is-playing .audio-view-title::before { content:"♫ "; color:var(--accent); }
