/* ─────────────────────────────────────────────────────────────────
   ADMIN — Listening editor styles.
   God-only surface; lives inside the .adm-* admin chrome and adopts
   its visual tokens. Loaded globally; selectors all prefixed .al-*.
   ───────────────────────────────────────────────────────────── */

.al-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .82rem;
  font-weight: 600;
  color: var(--adm-fg-soft, #6B5E4A);
  text-decoration: none;
  margin-bottom: .55rem;
  transition: color .15s;
}
.al-back:hover { color: var(--adm-fg, #1F1812); }

.al-loading {
  padding: 3rem 1rem;
  text-align: center;
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--adm-fg-soft, #6B5E4A);
}

/* ── Buttons ── */
.al-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 8px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .88rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .12s, background-color .12s, border-color .12s, color .12s;
  white-space: nowrap;
}
.al-btn.is-primary {
  background: #B57A2E;
  color: #FBF4E2;
  border-color: #B57A2E;
}
.al-btn.is-primary:hover:not(:disabled) {
  background: #A06823;
  transform: translateY(-1px);
}
.al-btn.is-primary:disabled { opacity: .5; cursor: not-allowed; }
.al-btn.is-ghost {
  background: transparent;
  color: var(--adm-fg, #1F1812);
  border-color: rgba(31, 24, 18, .14);
}
.al-btn.is-ghost:hover { background: rgba(31, 24, 18, .04); }
.al-btn.is-danger {
  background: rgba(194, 74, 43, .08);
  color: #8C3520;
  border-color: rgba(194, 74, 43, .35);
}
.al-btn.is-danger:hover { background: rgba(194, 74, 43, .14); }

/* ── List view ── */
.al-list {
  display: flex;
  flex-direction: column;
  gap: .7rem;
}
.al-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.2rem;
  background: #FFFFFF;
  border: 1px solid rgba(31, 24, 18, .10);
  border-radius: 10px;
  color: var(--adm-fg, #1F1812);
  text-decoration: none;
  transition: transform .12s, box-shadow .12s, border-color .12s;
}
.al-list-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px -10px rgba(31, 24, 18, .25);
  border-color: rgba(31, 24, 18, .18);
}
.al-list-item-l { flex: 1 1 auto; min-width: 0; }
.al-list-item-r {
  flex: 0 0 auto;
  color: var(--adm-fg-soft, #6B5E4A);
}
.al-list-item-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: .4rem;
}
.al-list-item-title {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 500;
  color: #1F1812;
  margin-bottom: 4px;
}
.al-list-item-meta {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .82rem;
  color: var(--adm-fg-soft, #6B5E4A);
}

/* Pills */
.al-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  border-radius: 999px;
  background: rgba(31, 24, 18, .06);
  color: #4A3F33;
  border: 1px solid rgba(31, 24, 18, .10);
}
.al-pill-kind    { background: rgba(181, 122, 46, .12); color: #6E4716; border-color: rgba(181, 122, 46, .30); }
.al-pill-section { background: rgba(92, 138, 106, .14); color: #2E5B3F; border-color: rgba(92, 138, 106, .35); }
.al-pill-level   { background: rgba(59, 106, 138, .14); color: #1F4D6B; border-color: rgba(59, 106, 138, .35); }
.al-audio-pending    { background: rgba(31, 24, 18, .06);  color: #4A3F33;  border-color: rgba(31, 24, 18, .12); }
.al-audio-generating { background: rgba(217, 162, 104, .14); color: #8C6A3A;  border-color: rgba(217, 162, 104, .35); animation: al-pulse 1.6s ease-in-out infinite; }
.al-audio-ready      { background: rgba(46, 125, 91, .14); color: #1E5A40;  border-color: rgba(46, 125, 91, .35); }
.al-audio-failed     { background: rgba(194, 74, 43, .10); color: #8C3520;  border-color: rgba(194, 74, 43, .35); }
@keyframes al-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: .55; }
}

/* ── Editor ── */
.al-editor {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  max-width: 920px;
}
.al-panel {
  padding: 1.4rem 1.5rem 1.5rem;
  background: #FFFFFF;
  border: 1px solid rgba(31, 24, 18, .10);
  border-radius: 12px;
}
.al-panel-danger {
  background: rgba(194, 74, 43, .03);
  border-color: rgba(194, 74, 43, .25);
}
.al-panel-h {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 500;
  color: #1F1812;
  margin: 0 0 .35rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.al-panel-h-meta {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .78rem;
  font-weight: 600;
  color: var(--adm-fg-soft, #6B5E4A);
  letter-spacing: .03em;
}
.al-panel-help {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .88rem;
  line-height: 1.5;
  color: var(--adm-fg-soft, #6B5E4A);
  margin: 0 0 1rem;
}
.al-panel-help code {
  background: rgba(31, 24, 18, .07);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: 'Source Code Pro', monospace;
  font-size: .85em;
}

/* ── Form ── */
.al-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.al-field { display: flex; flex-direction: column; gap: 5px; }
.al-field-full { grid-column: 1 / -1; }
.al-label {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--adm-fg-soft, #6B5E4A);
}
.al-help {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .76rem;
  color: var(--adm-fg-soft, #6B5E4A);
}
.al-input {
  width: 100%;
  padding: 8px 12px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .92rem;
  color: #1F1812;
  background: #FFFFFF;
  border: 1px solid rgba(31, 24, 18, .18);
  border-radius: 6px;
  transition: border-color .15s, box-shadow .15s;
}
.al-input:focus {
  outline: none;
  border-color: #B57A2E;
  box-shadow: 0 0 0 3px rgba(181, 122, 46, .18);
}
textarea.al-input { font-family: 'Source Serif 4', Georgia, serif; line-height: 1.5; }

/* ── Script lines ── */
.al-script {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  margin-bottom: 1rem;
}
.al-empty-inline {
  padding: 1rem;
  text-align: center;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .9rem;
  color: var(--adm-fg-soft, #6B5E4A);
  background: rgba(31, 24, 18, .03);
  border-radius: 8px;
}
.al-line {
  display: flex;
  gap: 8px;
  padding: 10px;
  background: rgba(31, 24, 18, .025);
  border: 1px solid rgba(31, 24, 18, .08);
  border-radius: 8px;
}
.al-line-l {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.al-line-up, .al-line-down {
  width: 22px; height: 22px;
  border-radius: 4px;
  border: 1px solid rgba(31, 24, 18, .14);
  background: #FFFFFF;
  color: var(--adm-fg-soft, #6B5E4A);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .8rem;
  cursor: pointer;
}
.al-line-up:hover, .al-line-down:hover { background: rgba(31, 24, 18, .05); color: #1F1812; }
.al-line-body { flex: 1 1 auto; display: flex; flex-direction: column; gap: 6px; }
.al-line-top {
  display: flex;
  align-items: center;
  gap: 8px;
}
.al-line-speaker { flex: 1 1 auto; max-width: 350px; }
.al-line-num {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--adm-fg-soft, #6B5E4A);
}
.al-line-del {
  margin-left: auto;
  width: 28px; height: 28px;
  border-radius: 6px;
  border: 1px solid rgba(194, 74, 43, .25);
  background: rgba(194, 74, 43, .05);
  color: #8C3520;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.al-line-del:hover { background: rgba(194, 74, 43, .14); }
.al-line-text {
  width: 100%;
  padding: 8px 12px;
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: .96rem;
  line-height: 1.5;
  color: #1F1812;
  background: #FFFFFF;
  border: 1px solid rgba(31, 24, 18, .14);
  border-radius: 6px;
  resize: vertical;
}
.al-line-text:focus {
  outline: none;
  border-color: #B57A2E;
  box-shadow: 0 0 0 3px rgba(181, 122, 46, .15);
}
.al-script-actions { display: flex; gap: 8px; }

/* ── Questions ── */
.al-questions {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  margin-bottom: 1rem;
}
.al-question {
  padding: 14px;
  background: rgba(31, 24, 18, .025);
  border: 1px solid rgba(31, 24, 18, .08);
  border-radius: 8px;
}
.al-question-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: .7rem;
}
.al-question-num {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #B57A2E;
}
.al-question-type { max-width: 300px; }

/* ── Audio panel ── */
.al-audio-state {
  padding: 1rem 1.2rem;
  border-radius: 8px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .92rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}
.al-audio-state.is-pending {
  background: rgba(31, 24, 18, .04);
  border: 1px solid rgba(31, 24, 18, .10);
  color: #4A3F33;
}
.al-audio-state.is-generating {
  background: rgba(217, 162, 104, .10);
  border: 1px solid rgba(217, 162, 104, .35);
  color: #6E4716;
  animation: al-pulse 1.8s ease-in-out infinite;
}
.al-audio-state.is-ready {
  background: rgba(46, 125, 91, .10);
  border: 1px solid rgba(46, 125, 91, .30);
  color: #1E5A40;
}
.al-audio-state.is-failed {
  background: rgba(194, 74, 43, .07);
  border: 1px solid rgba(194, 74, 43, .30);
  color: #8C3520;
}
.al-audio-state code {
  background: rgba(31, 24, 18, .08);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: 'Source Code Pro', monospace;
  font-size: .82em;
}
.al-audio-player { margin-bottom: 1rem; }
.al-audio-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── Responsive ── */
@media (max-width: 720px) {
  .al-form-grid { grid-template-columns: 1fr; }
  .al-line { flex-direction: column; }
  .al-line-l { flex-direction: row; }
  .al-line-up, .al-line-down { width: 32px; }
}
