/* ── audiobook.css ─────────────────────────────────────────────────────────── */

@keyframes abGradient {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes abPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}
@keyframes abSpin { to { transform: rotate(360deg); } }
@keyframes abIndeterminate {
  0%   { margin-left: -40%; }
  100% { margin-left: 100%; }
}
@keyframes abFadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes abSlideDown {
  from { opacity: 0; max-height: 0; }
  to   { opacity: 1; max-height: 800px; }
}

/* ── Overlay ── */
#abOverlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 9999999999999998;
  backdrop-filter: blur(6px);
}

/* ── Modal ── */
#abModal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 99999999999999999;
  width: min(96vw, 680px);
  height: min(92vh, 860px);
  background: #0e0e14;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 16px;
  box-shadow: 0 0 80px rgba(141,2,129,0.3), 0 0 160px rgba(103,58,183,0.12);
  color: white;
  font-family: Arial, sans-serif;
  flex-direction: column;
  overflow: hidden;
}

#abModal * {
  z-index: auto;
}

/* ── Login ── */
#abLogin {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 40px 24px;
}
#abLoginBox {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 300px;
  align-items: stretch;
}
#abLoginBox h2 {
  font-size: 16px;
  margin: 0 0 8px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: white;
}
#abLoginForm, #abRegisterForm {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#abLoginBox input {
  padding: 10px 13px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.09);
  background: rgba(255,255,255,0.04);
  color: white;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
#abLoginBox input:focus   { border-color: rgba(180,79,232,0.5); }
#abLoginBox input::placeholder { color: rgba(255,255,255,0.22); }
#abLoginBtn, #abRegisterBtn {
  padding: 11px;
  border-radius: 8px;
  border: 1px solid rgba(180,79,232,0.4);
  background: linear-gradient(135deg,#1e0035,#0e0018);
  color: white;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}
#abLoginBtn:hover, #abRegisterBtn:hover {
  border-color: #b44fe8;
  box-shadow: 0 0 10px rgba(180,79,232,0.25);
}
#abLoginError {
  font-size: 12px;
  color: #ff6b6b;
  text-align: center;
  min-height: 14px;
}
.ab-switch-mode {
  font-size: 11px;
  color: rgba(255,255,255,0.3);
  margin: 2px 0 0;
  text-align: center;
}
.ab-switch-mode span { color: #b44fe8; cursor: pointer; text-decoration: underline; }
.ab-switch-mode span:hover { color: white; }

/* ── Workstation ── */
#abWorkstation {
  display: none;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* ── Header ── */
#abHeader {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  flex-shrink: 0;
  background: rgba(255,255,255,0.02);
}
#abHeaderTitle {
  font-size: 13px;
  font-weight: bold;
  flex: 1;
  color: #b44fe8;
  display: flex;
  align-items: center;
  gap: 7px;
}
#abUserLabel { font-size: 11px; color: rgba(255,255,255,0.28); }
#abLogoutBtn, #abCloseBtn {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.3);
  font-size: 13px;
  cursor: pointer;
  padding: 5px 6px;
  border-radius: 5px;
  transition: color 0.2s, background 0.2s;
}
#abLogoutBtn:hover { color: #ff6b6b; }
#abCloseBtn:hover  { color: white; background: rgba(255,255,255,0.06); }

/* ── Tab bar ── */
#abTabBar {
  display: flex;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  flex-shrink: 0;
}
.ab-tab {
  flex: 1;
  padding: 10px 8px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: rgba(255,255,255,0.3);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: color 0.2s, border-color 0.2s;
}
.ab-tab:hover  { color: rgba(255,255,255,0.6); }
.ab-tab.active { color: #b44fe8; border-bottom-color: #b44fe8; }

/* ── Tab panels ── */
.ab-tab-panel {
  display: none;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  position: relative;
}
.ab-tab-panel.active { display: flex; }

/* ═══════════════════════════════════════════
   PROJECTS TAB
═══════════════════════════════════════════ */

/* ── Projects list view ── */
#abProjectsView {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}
#abProjectsHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  flex-shrink: 0;
}
#abProjectsCount {
  font-size: 11px;
  color: rgba(255,255,255,0.3);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
#abProjectList {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ── Project row ── */
.ab-project-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  animation: abFadeIn 0.2s ease;
  position: relative;
}
.ab-project-row:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.1);
}
.ab-project-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg,#2a0045,#1a0030);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: #b44fe8;
  flex-shrink: 0;
}
.ab-project-info { flex: 1; overflow: hidden; }
.ab-project-title {
  font-size: 13px;
  color: #ffe033;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: bold;
}
.ab-project-desc {
  font-size: 10px;
  color: rgba(255,255,255,0.5);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ab-project-meta {
  font-size: 10px;
  color: rgba(255,255,255,0.25);
  margin-top: 2px;
  display: flex;
  gap: 10px;
}
.ab-project-count {
  background: rgba(180,79,232,0.15);
  border: 1px solid rgba(180,79,232,0.25);
  color: #c87aff;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  flex-shrink: 0;
}
.ab-three-dots {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.25);
  font-size: 15px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 5px;
  flex-shrink: 0;
  transition: color 0.15s, background 0.15s;
  line-height: 1;
}
.ab-three-dots:hover {
  color: white;
  background: rgba(255,255,255,0.08);
}

/* ── Three-dot popup menu ── */
#abDotMenu {
  display: none;
  flex-direction: column;
  position: absolute;
  z-index: 99999999999999999999999999999999999999999999;
  background: #1a1025;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  overflow: visible;
  min-width: 130px;
}
#abDotMenu button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.75);
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}
#abDotMenu button:hover { background: rgba(255,255,255,0.07); color: white; }
#abDotDelete { color: rgba(255,107,107,0.7) !important; }
#abDotDelete:hover { color: #ff6b6b !important; background: rgba(255,107,107,0.08) !important; }

/* ── Project detail view ── */
#abProjectDetailView {
  display: none;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}
#abDetailHeader {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  flex-shrink: 0;
}
#abDetailTitle {
  flex: 1;
  font-size: 14px;
  font-weight: bold;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#abDetailCount {
  font-size: 11px;
  color: rgba(255,255,255,0.3);
  flex-shrink: 0;
}
#abAudioItemsList {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── Audio item row (accordion) ── */
.ab-audio-item {
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255,255,255,0.02);
  animation: abFadeIn 0.2s ease;
  transition: border-color 0.15s;
}
.ab-audio-item:hover { border-color: rgba(255,255,255,0.1); }
.ab-audio-item.open  { border-color: rgba(180,79,232,0.3); background: rgba(180,79,232,0.04); }

/* Collapsed row */
.ab-item-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  user-select: none;
}

/* 1:1 image thumb */
.ab-item-img {
  width: 44px;
  height: 44px;
  border-radius: 7px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
}
.ab-item-img-placeholder {
  width: 44px;
  height: 44px;
  border-radius: 7px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: rgba(255,255,255,0.2);
  flex-shrink: 0;
}

.ab-item-info {
  flex: 1;
  overflow: hidden;
}
.ab-item-name {
  font-size: 13px;
  color: rgba(255,255,255,0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}
.ab-item-preview {
  font-size: 11px;
  color: rgba(255,255,255,0.3);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ab-item-voice {
  font-size: 10px;
  color: #ffd84a;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ab-item-voice.none {
  color: #ffd84a;
}
.ab-item-datetime {
  font-size: 10px;
  color: rgba(255,255,255,0.2);
  margin-top: 3px;
}

.ab-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.ab-item-play-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.12);
  background: transparent;
  color: rgba(255,255,255,0.5);
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  flex-shrink: 0;
}
.ab-item-play-btn:hover, .ab-item-play-btn.playing {
  background: rgba(76,255,145,0.12);
  border-color: #4cff91;
  color: #4cff91;
}
.ab-item-play-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

/* Expanded accordion content */
.ab-item-expanded {
  display: none;
  flex-direction: column;
  gap: 12px;
  padding: 0 12px 14px;
  border-top: 1px solid rgba(255,255,255,0.05);
  animation: abSlideDown 0.2s ease;
}
.ab-audio-item.open .ab-item-expanded { display: flex; }

.ab-expanded-image {
  width: 100%;
  max-height: 200px;
  object-fit: contain;
  border-radius: 8px;
  margin-top: 10px;
  border: 1px solid rgba(255,255,255,0.08);
}
.ab-expanded-text {
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}
.ab-expanded-edit-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ab-expanded-edit-section input,
.ab-expanded-edit-section textarea {
  width: 100%;
  padding: 9px 12px;
  border-radius: 7px;
  border: 1px solid rgba(255,255,255,0.09);
  background: rgba(255,255,255,0.04);
  color: white;
  font-size: 13px;
  font-family: Arial, sans-serif;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s;
}
.ab-expanded-edit-section input:focus,
.ab-expanded-edit-section textarea:focus { border-color: rgba(180,79,232,0.45); }
.ab-expanded-edit-section input::placeholder,
.ab-expanded-edit-section textarea::placeholder { color: rgba(255,255,255,0.2); }
.ab-expanded-edit-section textarea {
  min-height: 90px;
  max-height: 200px;
  resize: vertical;
  line-height: 1.6;
}
.ab-expanded-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.ab-expanded-actions select {
  flex: 1;
  min-width: 130px;
  padding: 8px 10px;
  border-radius: 7px;
  border: 1px solid rgba(255,255,255,0.09);
  background: rgba(255,255,255,0.04);
  color: white;
  font-size: 12px;
  outline: none;
  cursor: pointer;
  text-align: center;
  text-align-last: center;
}
.ab-voice-select-item {
  text-align: center;
  text-align-last: center;
}
.ab-expanded-actions select option { background: #1a0030; }
.ab-item-audio-player {
  width: 100%;
  height: 32px;
  border-radius: 6px;
}
.ab-thinking {
  text-align: center;
  color: rgba(255,255,255,0.35);
  font-size: 12px;
  padding: 10px 0;
  animation: abPulse 1.5s ease-in-out infinite;
}

/* ── New project form overlay ── */
#abNewProjectForm {
  position: absolute;
  inset: 0;
  background: rgba(14,14,20,0.96);
  z-index: 10;
  display: none;
  align-items: center;
  justify-content: center;
}
#abNewProjectFormInner {
  background: #18101f;
  border: 1px solid rgba(180,79,232,0.25);
  border-radius: 12px;
  padding: 22px 20px;
  width: min(90%,300px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#abNewProjectFormInner h3 { font-size: 14px; margin: 0; color: white; }
#abNewProjectTitle {
  padding: 10px 13px;
  border-radius: 7px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  color: white;
  font-size: 13px;
  outline: none;
  box-sizing: border-box;
  width: 100%;
}
#abNewProjectTitle::placeholder { color: rgba(255,255,255,0.22); }
#abNewProjectTitle:focus { border-color: rgba(180,79,232,0.5); }
#abNewProjectFormActions { display: flex; gap: 8px; justify-content: flex-end; }

/* ── Project drop zone ── */
#abProjectDropZone {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 8px 12px 4px;
  padding: 10px 14px;
  border: 1px dashed rgba(255,255,255,0.1);
  border-radius: 8px;
  cursor: pointer;
  color: rgba(255,255,255,0.25);
  font-size: 12px;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
  flex-shrink: 0;
}
#abProjectDropZone:hover, #abProjectDropZone.dragover {
  border-color: rgba(180,79,232,0.45);
  background: rgba(180,79,232,0.04);
  color: rgba(255,255,255,0.55);
}
#abProjectDropZone i { font-size: 14px; }

#abProjectVoiceSelect {
  margin: 8px 12px 6px;
  width: calc(100% - 24px);
  padding: 9px 12px;
  border-radius: 7px;
  border: 1px solid rgba(255,255,255,0.09);
  background: rgba(255,255,255,0.04);
  color: white;
  font-size: 13px;
  outline: none;
  cursor: pointer;
  box-sizing: border-box;
  flex-shrink: 0;
  text-align: center;
  text-align-last: center;
}
#abProjectVoiceSelect option { background: #1a0030; }

#abProjectExtractProgress {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 0 12px 4px;
  flex-shrink: 0;
}

/* ── Concatenate result ── */
#abConcatResult { display: flex; flex-direction: column; gap: 10px; }
#abConcatPlayer audio { width: 100%; height: 32px; }

/* ═══════════════════════════════════════════
   EXTRACT TAB
═══════════════════════════════════════════ */
#abTabExtract { padding: 14px; gap: 12px; overflow-y: auto; }
#abExtractProjectPicker {
  display: flex;
  align-items: center;
  gap: 10px;
}
#abExtractProjectPicker label {
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  white-space: nowrap;
}
#abExtractProjectSelect {
  flex: 1;
  padding: 9px 12px;
  border-radius: 7px;
  border: 1px solid rgba(255,255,255,0.09);
  background: rgba(255,255,255,0.04);
  color: white;
  font-size: 13px;
  outline: none;
  cursor: pointer;
  text-align: center;
  text-align-last: center;
}
#abExtractProjectSelect option { background: #1a0030; }
#abDropZone {
  border: 2px dashed rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 26px 20px;
  text-align: center;
  cursor: pointer;
  color: rgba(255,255,255,0.28);
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
#abDropZone:hover, #abDropZone.dragover {
  border-color: rgba(180,79,232,0.5);
  background: rgba(180,79,232,0.04);
  color: rgba(255,255,255,0.6);
}
#abDropZone i { font-size: 26px; margin-bottom: 7px; display: block; }
#abDropZone p { margin: 0; font-size: 13px; }
#abImageList { display: flex; flex-direction: column; gap: 7px; }
.ab-image-row {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 8px;
  padding: 9px 12px;
  animation: abFadeIn 0.2s ease;
}
.ab-image-header { display: flex; align-items: center; gap: 9px; margin-bottom: 7px; }
.ab-image-thumb {
  width: 32px; height: 32px;
  border-radius: 5px;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.ab-image-name { font-size: 12px; color: rgba(255,255,255,0.55); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ab-image-status { font-size: 11px; font-weight: bold; flex-shrink: 0; }
.ab-image-status.loading { color: #f0c040; }
.ab-image-status.done    { color: #4cff91; }
.ab-image-status.error   { color: #ff6b6b; }
.ab-progress-track { height: 3px; background: rgba(255,255,255,0.05); border-radius: 999px; overflow: hidden; }
.ab-progress-bar { height: 100%; width: 0%; border-radius: 999px; background: linear-gradient(90deg,#8d0281,#673AB7); }
.ab-progress-bar.indeterminate { width: 40%; animation: abIndeterminate 1.2s ease-in-out infinite; }
.ab-progress-bar.complete { width: 100%; background: linear-gradient(90deg,#00c97a,#4cff91); animation: none; }
.ab-progress-bar.errored  { width: 100%; background: #ff6b6b; animation: none; }
#abExtractedSection { display: flex; flex-direction: column; gap: 10px; }
#abExtractedSection label { font-size: 11px; color: rgba(255,255,255,0.3); text-transform: uppercase; letter-spacing: 0.07em; }
#abExtractedText {
  width: 100%;
  min-height: 110px;
  max-height: 200px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  color: white;
  font-size: 13px;
  font-family: Arial, sans-serif;
  resize: vertical;
  outline: none;
  line-height: 1.6;
  box-sizing: border-box;
}
#abExtractActions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
#abItemNameInput {
  flex: 1;
  min-width: 130px;
  padding: 9px 12px;
  border-radius: 7px;
  border: 1px solid rgba(255,255,255,0.09);
  background: rgba(255,255,255,0.04);
  color: white;
  font-size: 13px;
  outline: none;
  box-sizing: border-box;
}
#abItemNameInput::placeholder { color: rgba(255,255,255,0.22); }
#abItemNameInput:focus { border-color: rgba(180,79,232,0.45); }

/* ── Shared buttons ── */
.ab-btn {
  padding: 8px 13px;
  border-radius: 7px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.75);
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
  text-decoration: none;
}
.ab-btn:hover { background: rgba(255,255,255,0.09); border-color: rgba(255,255,255,0.25); color: white; }
.ab-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.ab-btn-primary { border-color: rgba(180,79,232,0.4); background: rgba(180,79,232,0.1); color: #c87aff; }
.ab-btn-primary:hover { background: rgba(180,79,232,0.2); border-color: #b44fe8; color: white; }
.ab-btn-success { border-color: rgba(76,255,145,0.35); background: rgba(76,255,145,0.07); color: #4cff91; }
.ab-btn-success:hover { background: rgba(76,255,145,0.14); border-color: #4cff91; color: white; }
.ab-btn-danger  { border-color: rgba(255,107,107,0.3); color: rgba(255,107,107,0.65); background: transparent; }
.ab-btn-danger:hover { background: rgba(255,107,107,0.08); border-color: #ff6b6b; color: #ff6b6b; }
.ab-btn i.fa-spin { animation: abSpin 0.8s linear infinite; }

/* ── Scrollbars ── */
#abProjectList::-webkit-scrollbar,
#abAudioItemsList::-webkit-scrollbar,
#abTabExtract::-webkit-scrollbar { width: 3px; }
#abProjectList::-webkit-scrollbar-track,
#abAudioItemsList::-webkit-scrollbar-track,
#abTabExtract::-webkit-scrollbar-track { background: transparent; }
#abProjectList::-webkit-scrollbar-thumb,
#abAudioItemsList::-webkit-scrollbar-thumb,
#abTabExtract::-webkit-scrollbar-thumb { background: rgba(180,79,232,0.25); border-radius: 999px; }

/* ── Edit modals (project + audiobook) ── */
#abEditProjectOverlay, #abEditBookOverlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 9999999999999999998;
  backdrop-filter: blur(4px);
}
#abEditProjectModal, #abEditBookModal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999999999999999999;
  width: min(94vw, 480px);
  background: #13101c;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  box-shadow: 0 0 60px rgba(141,2,129,0.3);
  color: white;
  font-family: Arial, sans-serif;
  flex-direction: column;
  overflow: hidden;
  animation: abFadeIn 0.18s ease;
}
#abEditProjectHeader, #abEditBookHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  font-size: 14px;
  font-weight: bold;
  color: #ffe033;
}
#abEditProjectClose, #abEditBookClose {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.4);
  font-size: 15px;
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 4px;
  transition: color 0.2s;
}
#abEditProjectClose:hover, #abEditBookClose:hover { color: white; }
#abEditProjectBody, #abEditBookBody {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
}
#abEditProjectBody label, #abEditBookBody label {
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
#abEditProjectTitle, #abEditBookTitle {
  width: 100%;
  padding: 10px 13px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  color: white;
  font-size: 13px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s;
}
#abEditProjectTitle:focus, #abEditBookTitle:focus { border-color: rgba(180,79,232,0.5); }
#abEditProjectTitle::placeholder, #abEditBookTitle::placeholder { color: rgba(255,255,255,0.22); }
#abEditProjectDesc, #abEditBookText {
  width: 100%;
  min-height: 100px;
  padding: 10px 13px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  color: white;
  font-size: 13px;
  font-family: Arial, sans-serif;
  outline: none;
  resize: vertical;
  box-sizing: border-box;
  line-height: 1.6;
  transition: border-color 0.2s;
}
#abEditProjectDesc:focus, #abEditBookText:focus { border-color: rgba(180,79,232,0.5); }
#abEditProjectActions, #abEditBookActions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 4px;
}

/* ── Book icon trigger ── */
#audiobookTrigger { color: #b44fe8; transition: color 0.2s, transform 0.2s; }
#audiobookTrigger:hover { color: white; transform: scale(1.15); }
