/* DeKvsW Manifest Audio Player v2.1 - clean reader-first UI */
body.dekvsw-audio-v2-active .dekvsw-manifest-player,
body.dekvsw-audio-v2-active .wp-block-dekvsw-manifest-player,
body.dekvsw-audio-v2-active [data-dekvsw-manifest-player],
body.dekvsw-audio-v2-active figure.wp-block-dekvsw-manifest-player,
body.dekvsw-audio-v2-active .dekvsw-player-card,
body.dekvsw-audio-v2-active .dekvsw-player-floating,
body.dekvsw-audio-v2-active .dekvsw-audio-diagnostics,
body.dekvsw-audio-v2-active .dekvsw-audio-diagnostics-log {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  max-height: 0 !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}

.dekvsw-audio-v2-button,
.dekvsw-audio-v2-mini,
.dekvsw-audio-v2-full {
  font-family: inherit;
  box-sizing: border-box;
}

.dekvsw-audio-v2-button {
  position: fixed;
  left: 12px;
  top: calc(var(--wp-admin--admin-bar--height, 0px) + 82px);
  z-index: 999999;
  min-width: 46px;
  min-height: 46px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(18,20,25,.94);
  color: #fff;
  box-shadow: 0 12px 32px rgba(0,0,0,.34);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 13px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform .16s ease, opacity .16s ease, width .2s ease;
}
.dekvsw-audio-v2-button:hover,
.dekvsw-audio-v2-button:focus-visible { transform: translateY(-1px); outline: 2px solid rgba(255,255,255,.34); outline-offset: 2px; }
.dekvsw-audio-v2-button .dekvsw-v2-label { white-space: nowrap; font-size: 13px; font-weight: 700; }
.dekvsw-audio-v2-button.is-compact .dekvsw-v2-label { display: none; }
.dekvsw-audio-v2-button.is-playing { display:none; }

.dekvsw-audio-v2-mini {
  position: fixed;
  left: 12px;
  top: calc(var(--wp-admin--admin-bar--height, 0px) + 82px);
  z-index: 999999;
  display: none;
  align-items: center;
  gap: 9px;
  max-width: min(92vw, 420px);
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(18,20,25,.96);
  color: #fff;
  box-shadow: 0 14px 34px rgba(0,0,0,.38);
  padding: 8px 10px;
}
.dekvsw-audio-v2-mini.is-visible { display: flex; }
.dekvsw-audio-v2-mini button { 
  border: 0; background: rgba(255,255,255,.12); color:#fff; border-radius: 999px; min-width: 36px; min-height: 36px; cursor:pointer;
}
.dekvsw-audio-v2-mini .dekvsw-v2-time { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 13px; min-width: 45px; }
.dekvsw-audio-v2-mini .dekvsw-v2-now { font-size: 12px; line-height: 1.25; max-width: 210px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .94; }
.dekvsw-audio-v2-mini .dekvsw-v2-expand { font-size: 16px; }

.dekvsw-audio-v2-full {
  position: fixed;
  left: 50%;
  top: calc(var(--wp-admin--admin-bar--height, 0px) + var(--dekvsw-v2-full-top, 64px));
  transform: translateX(-50%);
  z-index: 1000000;
  width: min(92vw, 760px);
  max-height: calc(100dvh - var(--wp-admin--admin-bar--height, 0px) - var(--dekvsw-v2-full-top, 64px) - 12px);
  display: none;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  border-radius: 22px;
  background: rgba(16,18,24,.985);
  color: #fff;
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 24px 70px rgba(0,0,0,.48);
  padding: 16px;
}
.dekvsw-audio-v2-full.is-open { display:block; }
.dekvsw-audio-v2-head { display:flex; align-items:center; justify-content:space-between; gap: 12px; margin-bottom: 12px; }
.dekvsw-audio-v2-title { font-weight: 800; font-size: 16px; line-height: 1.25; }
.dekvsw-audio-v2-close { border:0; border-radius:999px; width:36px; height:36px; background:rgba(255,255,255,.12); color:#fff; cursor:pointer; }
.dekvsw-audio-v2-wave { height: 74px; border-radius: 16px; background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.035)); margin: 10px 0; position:relative; overflow:hidden; }
.dekvsw-audio-v2-wave canvas { width:100%; height:100%; display:block; }
.dekvsw-audio-v2-progress { height: 6px; border-radius: 999px; background: rgba(255,255,255,.12); overflow:hidden; margin: 10px 0 14px; cursor:pointer; }
.dekvsw-audio-v2-progress-bar { height: 100%; width:0; background: rgba(255,255,255,.78); }
.dekvsw-audio-v2-controls { display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-bottom: 14px; }
.dekvsw-audio-v2-controls button { border:0; border-radius:999px; background:rgba(255,255,255,.12); color:#fff; min-height:36px; padding:0 13px; cursor:pointer; }
.dekvsw-audio-v2-cue { border-radius: 16px; background: rgba(255,255,255,.08); padding: 12px; margin: 12px 0; line-height:1.45; }
.dekvsw-audio-v2-cue small { display:block; opacity:.7; margin-bottom:4px; }
.dekvsw-audio-v2-cues { display:none; border-top:1px solid rgba(255,255,255,.12); padding-top:12px; margin-top:12px; }
.dekvsw-audio-v2-cues.is-open { display:block; }
.dekvsw-audio-v2-cues h3 { font-size:14px; margin:0 0 8px; }
.dekvsw-audio-v2-cue-list { display:grid; gap:7px; max-height: min(42dvh, 360px); overflow:auto; overscroll-behavior:contain; padding-right:2px; }
.dekvsw-audio-v2-cue-item { display:flex; gap:8px; align-items:flex-start; justify-content:flex-start; text-align:left; border:1px solid rgba(255,255,255,.12); background:rgba(255,255,255,.055); color:#fff; border-radius:12px; padding:9px 10px; cursor:pointer; line-height:1.3; }
.dekvsw-audio-v2-cue-item.is-active { background: rgba(255,255,255,.16); }
.dekvsw-audio-v2-cue-time { opacity:.72; font-variant-numeric:tabular-nums; min-width:52px; }
.dekvsw-audio-v2-empty { opacity:.72; padding:8px 0; }
.dekvsw-audio-v2-chapters { border-top:1px solid rgba(255,255,255,.12); padding-top: 12px; margin-top: 12px; }
.dekvsw-audio-v2-chapters h3 { font-size: 14px; margin:0 0 8px; }
.dekvsw-audio-v2-chapter-list { display:grid; gap:7px; max-height:min(44dvh, 420px); overflow:auto; overscroll-behavior:contain; padding-right:2px; }
.dekvsw-audio-v2-chapter { display:flex; gap: 8px; align-items:center; justify-content:flex-start; text-align:left; border:1px solid rgba(255,255,255,.12); background:rgba(255,255,255,.055); color:#fff; border-radius:12px; padding: 9px 10px; cursor:pointer; }
.dekvsw-audio-v2-chapter.is-active { background: rgba(255,255,255,.16); }
.dekvsw-audio-v2-chapter-time { opacity:.72; font-variant-numeric:tabular-nums; min-width: 52px; }
.dekvsw-audio-v2-debug { font-size:11px; opacity:.72; margin-top:8px; }
@media (max-width: 520px) {
  .dekvsw-audio-v2-button,
  .dekvsw-audio-v2-mini { top: calc(var(--wp-admin--admin-bar--height, 0px) + 68px); left: 10px; }
  .dekvsw-audio-v2-mini .dekvsw-v2-now { max-width: 145px; }
  .dekvsw-audio-v2-full { width: calc(100vw - 18px); max-height: calc(100dvh - var(--wp-admin--admin-bar--height, 0px) - var(--dekvsw-v2-full-top, 56px) - 10px); border-radius: 16px; padding: 12px; }
}

/* v1.9.2.6 - Cue button visibility and no chapter fallback in active cue box */
.dekvsw-audio-v2-list-head h3 {
  font-size: 14px;
  margin: 0 0 8px;
}
.dekvsw-audio-v2-full.is-cue-mode .dekvsw-audio-v2-cue {
  display: none !important;
}
.dekvsw-audio-v2-full.is-cue-mode .dekvsw-audio-v2-chapters {
  display: none !important;
}
.dekvsw-audio-v2-full:not(.is-cue-mode) .dekvsw-audio-v2-cues {
  display: none !important;
}
.dekvsw-audio-v2-full:not(.is-cue-mode) .dekvsw-audio-v2-chapters {
  display: block !important;
}
.dekvsw-audio-v2-cue {
  min-height: 78px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  font-weight: 800;
}
.dekvsw-audio-v2-cue-prefix {
  display: block;
  align-self: flex-start;
  text-align: left;
  font-size: 1.8rem;
  line-height: 1;
  opacity: .9;
  margin-bottom: 4px;
}
.dekvsw-audio-v2-cue-text {
  display: block;
  width: 100%;
  text-align: center;
  font-weight: 800;
  line-height: 1.45;
}
.dekvsw-audio-v2-controls .dekvsw-v2-cues-toggle.is-active {
  background: rgba(255,255,255,.22);
  color: #fff;
  font-weight: 800;
}
.dekvsw-audio-v2-chapter,
.dekvsw-audio-v2-cue-item {
  color: rgba(255,255,255,.58);
  font-weight: 500;
  transition: background .18s ease, color .18s ease, transform .18s ease, opacity .18s ease;
}
.dekvsw-audio-v2-chapter.is-active,
.dekvsw-audio-v2-cue-item.is-active {
  color: #fff;
  font-weight: 800;
  background: rgba(255,255,255,.18);
  border-color: rgba(255,255,255,.32);
  transform: scale(1.01);
}
.dekvsw-audio-v2-chapter:not(.is-active),
.dekvsw-audio-v2-cue-item:not(.is-active) {
  opacity: .72;
}
.dekvsw-audio-v2-chapter.is-active .dekvsw-audio-v2-chapter-time,
.dekvsw-audio-v2-cue-item.is-active .dekvsw-audio-v2-cue-time {
  opacity: .95;
  font-weight: 800;
}


/* v1.9.2.6 - stable active/preview states for chapter/cue lists */
.dekvsw-audio-v2-chapter:focus,
.dekvsw-audio-v2-chapter:focus-visible,
.dekvsw-audio-v2-chapter:active,
.dekvsw-audio-v2-cue-item:focus,
.dekvsw-audio-v2-cue-item:focus-visible,
.dekvsw-audio-v2-cue-item:active {
  color: #fff !important;
  outline: 1px solid rgba(105, 198, 255, .72) !important;
  outline-offset: 0 !important;
  background: rgba(255,255,255,.12) !important;
  -webkit-tap-highlight-color: transparent;
}
.dekvsw-audio-v2-chapter.is-scrub-preview,
.dekvsw-audio-v2-cue-item.is-scrub-preview {
  color: #fff !important;
  font-weight: 800 !important;
  background: rgba(255,255,255,.20) !important;
  border-color: rgba(105, 198, 255, .78) !important;
  opacity: 1 !important;
}
.dekvsw-audio-v2-chapter.is-active,
.dekvsw-audio-v2-cue-item.is-active {
  color: #fff !important;
  font-weight: 800 !important;
  background: rgba(255,255,255,.19) !important;
  border-color: rgba(255,255,255,.38) !important;
  opacity: 1 !important;
}
.dekvsw-audio-v2-chapter.is-active span,
.dekvsw-audio-v2-cue-item.is-active span,
.dekvsw-audio-v2-chapter.is-scrub-preview span,
.dekvsw-audio-v2-cue-item.is-scrub-preview span {
  color: #fff !important;
}
.dekvsw-audio-v2-chapter:not(.is-active):not(.is-scrub-preview),
.dekvsw-audio-v2-cue-item:not(.is-active):not(.is-scrub-preview) {
  color: rgba(255,255,255,.62) !important;
  font-weight: 500 !important;
  background: rgba(255,255,255,.055) !important;
  opacity: .74 !important;
}
.dekvsw-audio-v2-cue-list,
.dekvsw-audio-v2-chapter-list {
  scroll-behavior: auto;
}


/* v1.9.2.6 - hard visibility for Cue toggle and clean active cue box */
.dekvsw-audio-v2-controls .dekvsw-v2-cues-toggle,
.dekvsw-audio-v2-full .dekvsw-v2-cues-toggle {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  visibility: visible !important;
  opacity: 1 !important;
  min-width: 74px !important;
  flex: 0 0 auto !important;
  white-space: nowrap !important;
}
.dekvsw-audio-v2-cue:not(.has-active-cue) .dekvsw-audio-v2-cue-text {
  min-height: 1.45em;
}
.dekvsw-audio-v2-cue-text {
  color: #fff !important;
  font-weight: 800 !important;
}
.dekvsw-audio-v2-full.is-cue-mode .dekvsw-audio-v2-cue {
  display: none !important;
}
@media (max-width: 520px) {
  .dekvsw-audio-v2-controls {
    gap: 7px !important;
  }
  .dekvsw-audio-v2-controls button.dekvsw-v2-cues-toggle {
    min-width: 70px !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
}


/* v1.9.3.0 — UX Refresh: dark mode, page-wide mini overlay, stable graphic controls */
:root {
  --dekvsw-v2-bg: rgba(17, 19, 24, .94);
  --dekvsw-v2-bg-strong: rgba(13, 15, 20, .985);
  --dekvsw-v2-button: rgba(48, 51, 58, .94);
  --dekvsw-v2-button-hover: rgba(66, 70, 79, .98);
  --dekvsw-v2-border: rgba(180, 190, 205, .18);
  --dekvsw-v2-border-strong: rgba(205, 216, 230, .26);
  --dekvsw-v2-text: #f3f4f6;
  --dekvsw-v2-muted: #9ca3af;
  --dekvsw-v2-glow: rgba(80, 180, 255, .18);
}

.dekvsw-v2-icon-svg {
  width: 1.15em;
  height: 1.15em;
  display: block;
  color: currentColor;
}

.dekvsw-v2-graphic-btn,
.dekvsw-audio-v2-mini button,
.dekvsw-audio-v2-close,
.dekvsw-audio-v2-controls button.dekvsw-v2-graphic-btn {
  width: 44px !important;
  min-width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 999px !important;
  border: 1px solid var(--dekvsw-v2-border) !important;
  background: linear-gradient(180deg, rgba(68,72,80,.86), rgba(37,40,46,.94)) !important;
  color: var(--dekvsw-v2-text) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 8px 22px rgba(0,0,0,.34) !important;
  flex: 0 0 44px !important;
}

.dekvsw-v2-graphic-btn:hover,
.dekvsw-v2-graphic-btn:focus-visible,
.dekvsw-audio-v2-mini button:hover,
.dekvsw-audio-v2-close:hover,
.dekvsw-audio-v2-controls button.dekvsw-v2-graphic-btn:hover {
  background: linear-gradient(180deg, rgba(83,88,98,.94), rgba(46,50,58,.98)) !important;
  border-color: var(--dekvsw-v2-border-strong) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.10), 0 0 0 1px rgba(83,180,255,.14), 0 10px 28px rgba(0,0,0,.42) !important;
  outline: none !important;
}

.dekvsw-v2-pill-btn,
.dekvsw-audio-v2-controls button.dekvsw-v2-pill-btn {
  height: 44px !important;
  min-height: 44px !important;
  padding: 0 16px !important;
  border-radius: 999px !important;
  border: 1px solid var(--dekvsw-v2-border) !important;
  background: linear-gradient(180deg, rgba(68,72,80,.86), rgba(37,40,46,.94)) !important;
  color: var(--dekvsw-v2-text) !important;
  font-weight: 700 !important;
  flex: 0 0 auto !important;
}

.dekvsw-audio-v2-button {
  background: var(--dekvsw-v2-bg) !important;
  border-color: var(--dekvsw-v2-border) !important;
  color: var(--dekvsw-v2-text) !important;
}

.dekvsw-audio-v2-button .dekvsw-v2-control-icon {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(68,72,80,.86), rgba(37,40,46,.94));
  border: 1px solid var(--dekvsw-v2-border);
}

.dekvsw-audio-v2-mini {
  left: 12px !important;
  right: 12px !important;
  top: calc(var(--wp-admin--admin-bar--height, 0px) + var(--dekvsw-v2-mini-top, 76px)) !important;
  width: auto !important;
  max-width: none !important;
  border-radius: 18px !important;
  background: linear-gradient(180deg, rgba(24,26,32,.96), rgba(16,18,24,.96)) !important;
  border: 1px solid var(--dekvsw-v2-border) !important;
  color: var(--dekvsw-v2-text) !important;
  box-shadow: 0 10px 32px rgba(0,0,0,.44), 0 0 28px var(--dekvsw-v2-glow) !important;
  padding: 8px 10px !important;
  grid-template-columns: 44px minmax(48px, 70px) 1fr 44px !important;
  align-items: center !important;
  column-gap: 10px !important;
}
.dekvsw-audio-v2-mini.is-visible { display: grid !important; }
.dekvsw-audio-v2-mini .dekvsw-v2-time {
  min-width: 0 !important;
  text-align: center;
  font-size: 15px !important;
  color: var(--dekvsw-v2-text);
}
.dekvsw-audio-v2-mini .dekvsw-v2-now {
  max-width: none !important;
  min-width: 0;
  font-size: 14px !important;
  color: var(--dekvsw-v2-text);
  opacity: .92;
}
.dekvsw-audio-v2-mini .dekvsw-v2-expand { justify-self: end; }

.dekvsw-audio-v2-full {
  background: linear-gradient(180deg, rgba(18,20,26,.985), rgba(11,13,18,.985)) !important;
  color: var(--dekvsw-v2-text) !important;
  border-color: var(--dekvsw-v2-border) !important;
}
.dekvsw-audio-v2-head {
  position: sticky;
  top: -16px;
  z-index: 2;
  padding: 0 0 10px;
  background: linear-gradient(180deg, rgba(18,20,26,.99), rgba(18,20,26,.84));
}
.dekvsw-audio-v2-title { color: var(--dekvsw-v2-text); }
.dekvsw-audio-v2-controls {
  display: grid !important;
  grid-template-columns: 62px 44px minmax(92px, 1fr) 62px minmax(72px, auto) !important;
  align-items: center !important;
  gap: 8px !important;
}
.dekvsw-audio-v2-controls .dekvsw-v2-fulltime {
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--dekvsw-v2-text);
  white-space: nowrap;
}
.dekvsw-audio-v2-progress-bar { background: rgba(238,242,246,.86) !important; }
.dekvsw-audio-v2-cue,
.dekvsw-audio-v2-cue-item,
.dekvsw-audio-v2-chapter {
  background: rgba(42,45,52,.76) !important;
  border-color: rgba(180,190,205,.14) !important;
  color: var(--dekvsw-v2-muted) !important;
}
.dekvsw-audio-v2-cue-item.is-active,
.dekvsw-audio-v2-chapter.is-active {
  background: rgba(78,84,94,.88) !important;
  color: var(--dekvsw-v2-text) !important;
  font-weight: 800 !important;
  border-color: rgba(224,231,240,.28) !important;
}

@media (max-width: 520px) {
  .dekvsw-audio-v2-mini {
    left: 8px !important;
    right: 8px !important;
    top: calc(var(--wp-admin--admin-bar--height, 0px) + var(--dekvsw-v2-mini-top-mobile, 62px)) !important;
    grid-template-columns: 44px 54px minmax(0, 1fr) 44px !important;
    border-radius: 16px !important;
  }
  .dekvsw-audio-v2-controls {
    grid-template-columns: 54px 44px minmax(82px, 1fr) 54px 70px !important;
    gap: 6px !important;
  }
  .dekvsw-v2-pill-btn,
  .dekvsw-audio-v2-controls button.dekvsw-v2-pill-btn { padding: 0 10px !important; }
}

/* v1.9.3.1 - admin configurable placement for button, mini overlay and max overlay. */
.dekvsw-audio-v2-mini {
  box-sizing: border-box;
}
.dekvsw-audio-v2-mini[style*="right"] {
  justify-content: space-between;
}
.dekvsw-audio-v2-full {
  top: calc(var(--wp-admin--admin-bar--height, 0px) + var(--dekvsw-v2-admin-extra, 10px) + var(--dekvsw-v2-full-top, 64px));
  max-height: calc(100dvh - var(--wp-admin--admin-bar--height, 0px) - var(--dekvsw-v2-admin-extra, 10px) - var(--dekvsw-v2-full-top, 64px) - 12px);
}
.dekvsw-audio-v2-full.is-center-position {
  top: 50dvh;
  transform: translate(-50%, -50%);
  max-height: calc(100dvh - var(--wp-admin--admin-bar--height, 0px) - 24px);
}
@media (max-width: 720px) {
  .dekvsw-audio-v2-mini {
    min-height: 50px;
  }
  .dekvsw-audio-v2-full {
    max-height: calc(100dvh - var(--wp-admin--admin-bar--height, 0px) - var(--dekvsw-v2-admin-extra, 10px) - var(--dekvsw-v2-full-top, 56px) - 10px);
  }
}
