.personal-library { max-width: 1040px; padding-bottom: 64px; }
.personal-library .lead { max-width: 650px; }
.personal-library [data-personal-status]:empty { display: none; }
.personal-library .voice-section-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 24px; }
.personal-library .voice-section-heading h2 { font-size: 1.5rem; margin: 0 0 6px; }
.personal-library .voice-section-heading p { margin: 0; }
.personal-library .voice-section-heading .button { margin: 0; flex-shrink: 0; }
.voice-count { font-size: .85rem; vertical-align: middle; padding: 3px 9px; border-radius: 20px; background: #edf2f7; color: var(--muted); }
.personal-library .voice-library-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; padding: 0; margin: 0; list-style: none; line-height: 1.5; }
.voice-library-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; min-width: 0; }
.voice-identity { display: grid; justify-items: start; gap: 8px; min-width: 0; }
.voice-identity strong { overflow-wrap: anywhere; font-size: 1rem; }
.voice-state { padding: 2px 8px; border-radius: 20px; background: #fff3dc; color: #795410; font-size: .75rem; }
.voice-state[data-state="ready"] { background: #eaf5ee; color: #286241; }
.voice-state[data-state="failed"], .voice-state[data-state="unavailable"] { background: #fceeee; color: #923a3a; }
.voice-remove { flex-shrink: 0; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font: inherit; font-size: .8rem; padding: 8px; cursor: pointer; }
.voice-remove:hover { background: #fceeee; color: #923a3a; }
.voice-remove:focus-visible { outline: 3px solid #d48818; outline-offset: 2px; }
.voice-empty { grid-column: 1 / -1; color: var(--muted); padding: 20px 0; }
.personal-library .voice-enrollment { margin: 0 0 24px; scroll-margin-top: 24px; }
.voice-enrollment > summary { cursor: pointer; font-size: 1.35rem; font-weight: 700; }
.voice-enrollment summary span { display: block; margin: 6px 0 0 20px; color: var(--muted); font-size: .85rem; font-weight: 400; }
.voice-enrollment-content { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 8px; }
.voice-ingestion-note { font-size: .9rem; line-height: 1.6; }
.voice-enrollment-form { margin-top: 24px; }
.voice-field { margin-bottom: 24px; }
.voice-field > label { display: block; margin-bottom: 8px; font-size: .95rem; font-weight: 600; }
.personal-library .voice-field input { display: block; width: 100%; max-width: 100%; box-sizing: border-box; padding: 12px; margin: 0; border: 1px solid #a7bad1; border-radius: 8px; background: white; color: var(--ink); font: inherit; }
.personal-library .voice-field input[type="file"] { background: #f7f9fc; font-size: .9rem; }
.voice-field .small { margin: 8px 0 0; line-height: 1.6; }
.voice-excerpt { padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.voice-excerpt > summary { cursor: pointer; font-size: .95rem; font-weight: 600; }
.voice-excerpt-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; margin-top: 24px; }
.voice-excerpt-fields .voice-field { margin-bottom: 0; }
.voice-consents { border: 0; padding: 0; margin: 28px 0; min-width: 0; }
.voice-consents legend { padding: 0; margin-bottom: 14px; font-weight: 600; }
.voice-consents label { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; font-size: .9rem; font-weight: 400; line-height: 1.6; cursor: pointer; }
.personal-library .voice-consents input { width: 18px; height: 18px; flex-shrink: 0; margin: 4px 0 0; }
.voice-save-actions { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.personal-library .voice-save-actions .button { margin: 0; }
.voice-save-actions p { margin: 0; font-size: .9rem; }
.voice-save-actions p:empty { display: none; }
.voice-next-steps { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; padding: 0 4px; font-size: .9rem; }
.voice-next-steps p { margin: 0; color: var(--muted); }
.voice-next-steps a { font-weight: 600; }
@media (max-width: 650px) {
  .personal-library .panel { padding: 22px; }
  .personal-library .voice-library-list { grid-template-columns: 1fr; }
  .personal-library .voice-section-heading { align-items: flex-start; gap: 12px; }
  .personal-library .voice-section-heading .button { padding: 8px 12px; font-size: .8rem; }
  .voice-excerpt-fields { grid-template-columns: 1fr; }
  .voice-next-steps { gap: 14px 20px; }
  .voice-next-steps p { flex-basis: 100%; }
}

.voice-row-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.voice-listen { border: 1px solid var(--line); border-radius: 8px; background: #f5f8fc; color: var(--blue-deep); font: inherit; font-size: .85rem; padding: 8px 12px; cursor: pointer; }
.voice-listen:disabled { opacity: .55; cursor: default; }
.voice-sample-player { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 12px; }
.voice-sample-player audio, .voice-recorder audio { width: 100%; margin: 12px 0; }
.voice-sample-player p { margin: 8px 0; font-size: .9rem; }
.voice-input-options, .voice-record-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 16px 0; }
.personal-library .voice-input-options .button, .personal-library .voice-record-actions .button { margin: 0; }
.voice-input-options [aria-pressed="true"] { background: var(--blue); color: white; }
.voice-recorder { padding: 4px 0 12px; }
.voice-recorder [role="status"] { font-size: .9rem; }
.voice-record-dialog { width: calc(100vw - 32px); max-width: 1000px; height: calc(100dvh - 32px); max-height: 100dvh; padding: 0; box-sizing: border-box; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); }
.voice-record-dialog::backdrop { background: #102238bb; }
.voice-record-dialog-body { display: flex; flex-direction: column; gap: 16px; padding: 28px; box-sizing: border-box; height: 100%; }
.voice-record-heading { display: flex; justify-content: space-between; gap: 20px; align-items: center; }
.personal-library .voice-record-heading h2 { margin: 0; font-size: 1.5rem; }
.voice-record-heading output { white-space: nowrap; font-variant-numeric: tabular-nums; color: #963833; font-weight: 700; }
.voice-reading-passage { flex: 1; overflow: auto; min-height: 80px; font-size: clamp(1.25rem, 3vw, 1.8rem); line-height: 1.8; white-space: pre-wrap; padding: 12px 4px; }
.voice-record-dialog-body > p { margin: 0; }
.voice-record-dialog .voice-record-actions { margin: 0; padding-top: 12px; border-top: 1px solid var(--line); }
@media (max-width: 650px) { .voice-library-row { gap: 8px; padding: 14px; } .voice-row-actions { gap: 0; } .voice-record-dialog-body { padding: 20px; } }

.voice-prompt-preview { padding: 12px 0; }
.voice-prompt-preview summary { cursor: pointer; font-weight: 600; font-size: .95rem; }
.voice-prompt-preview p { max-height: 15rem; overflow: auto; padding: 12px; border: 1px solid var(--line); border-radius: 8px; line-height: 1.8; }
