.voice-style-select { display: flex; align-items: center; gap: 8px; }
.voice-style-select select { flex: 1; min-width: 0; }
#voice-style-controls [hidden], #voice-provider-control[hidden] { display: none !important; }
#voice-style-create summary { cursor: pointer; font-weight: 600; padding: 10px 0; }
#voice-style-create textarea, #voice-style-create input { width: 100%; box-sizing: border-box; }
#voice-style-cost { font-size: 12px; margin: 8px 0; }
#voice-style-candidates h4 { margin: 12px 0 8px; font-size: 14px; }
.voice-style-candidate { display: flex; align-items: center; border: 1px solid #b9ccc5; border-radius: 8px; margin-bottom: 8px; min-height: 60px; overflow: hidden; }
.voice-style-choice { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding: 12px; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.voice-style-choice span { overflow-wrap: anywhere; flex: 1; }
.voice-style-choice > svg { flex-shrink: 0; width: 18px; height: 18px; }
.voice-style-choice > svg:last-child { color: #087f68; }
.voice-style-choice[aria-pressed="false"] > svg:last-child { visibility: hidden; }
.voice-style-candidate:has(.voice-style-choice[aria-pressed="true"]) { background: #eaf5f0; border-color: #087f68; }
.voice-performance { margin: 0 0 14px; font-size: 13px; }
.voice-performance-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-bottom: 12px; }
.voice-performance-grid label { min-width: 0; }
.voice-performance-grid select { width: 100%; margin-top: 6px; }
.voice-library-item { border-bottom: 1px solid #dce5e0; padding: 18px 0; }
.voice-library-item:first-child { padding-top: 0; }
.voice-library-item h3 { font-size: 17px; margin: 0; overflow-wrap: anywhere; flex:1; min-width:0; }
.voice-library-item .section-heading { margin-bottom: 8px; gap: 12px; }
.voice-library-actions { display:flex; align-items:center; gap:8px; flex-shrink:0; }
.voice-library-empty {display:flex;flex-direction:column;align-items:center;gap:16px;padding:32px 0;text-align:center}
.voice-library-empty p {margin:0}
.voice-library-create {max-width:100%;white-space:normal}
.voice-identity-play {width:100%;margin:4px 0 12px}
.voice-delete-loading {cursor:progress!important;opacity:1!important}
.voice-delete-loading > svg {animation:voice-preview-spin .85s linear infinite}
@media(prefers-reduced-motion:reduce) {.voice-delete-loading > svg {animation:none}}
.voice-base-open {width:100%;white-space:normal;overflow-wrap:anywhere;box-sizing:border-box;margin-bottom:12px}
.voice-library-item .section-heading {flex-wrap:wrap}
.voice-library-name-heading {display:flex;align-items:center;gap:6px;flex:1;min-width:0}
.voice-library-avatar{display:block;flex:0 0 56px;width:56px;height:56px;margin-right:6px}
@media(max-width:480px){.voice-library-avatar{flex-basis:44px;width:44px;height:44px;margin-right:2px}.voice-library-item h3{font-size:15px}}
.voice-library-name-form {display:grid;grid-template-columns:minmax(0,1fr) 32px 32px;gap:4px;flex:1;min-width:0;margin:0}
.voice-library-description {font-size:14px;line-height:1.6;margin:8px 0 14px;overflow-wrap:anywhere;white-space:pre-wrap;color:#52665d}
#voice-studio-dialog .voice-library-name-form input {width:100%;min-width:0;box-sizing:border-box}
.voice-library-name-form .icon-button {width:32px;height:36px;padding:6px}
@media(max-width:480px) {.voice-library-name-heading:has(.voice-library-name-form:not([hidden])) {flex-basis:100%}}
.voice-edited-preview {width:100%;margin:0 0 12px}
.voice-edited-preview[aria-busy="true"] svg {animation:voice-preview-spin .85s linear infinite}
.voice-library-item audio {width:100%;height:40px;display:block;margin:0 0 14px}
.voice-library-collapse {display:flex;align-items:center;justify-content:center;width:100%;margin-top:14px;padding:7px 0;border:0;border-top:1px solid #dce5e0;background:transparent;color:#087f68}
.voice-library-collapse svg {width:16px;height:16px}
@media(prefers-reduced-motion:reduce) {.voice-edited-preview[aria-busy="true"] svg {animation:none}}
.voice-base-dialog {width:min(660px,calc(100% - 24px));max-height:calc(100dvh - 24px);padding:20px;border:1px solid #b9ccc5;border-radius:8px;color:#263c35;background:white;box-sizing:border-box}
.voice-base-dialog[open] {display:flex;flex-direction:column}
.voice-base-dialog::backdrop {background:#0008}
.voice-base-dialog > .section-heading {flex-shrink:0}
.voice-base-dialog > [role="status"]:empty {display:none}
.voice-base-play {width:36px;height:36px;min-height:36px;flex-basis:36px;padding:8px;box-sizing:border-box}
.voice-base-play[aria-busy="true"] {opacity:1;color:#087f68;cursor:progress}
.voice-base-play[aria-busy="true"] svg {animation:voice-preview-spin .85s linear infinite}
@keyframes voice-preview-spin {to {transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce) {.voice-base-play[aria-busy="true"] svg {animation:none}}
.voice-base-list {min-height:0;overflow-y:auto;overscroll-behavior:contain}
.voice-base-item {display:flex;align-items:center;gap:10px;border-bottom:1px solid #dce5e0;padding:8px 0;min-height:140px;box-sizing:border-box}
.voice-base-select {display:grid;grid-template-columns:minmax(0,1fr);justify-content:stretch;justify-items:stretch;align-content:start;align-self:stretch;gap:5px;flex:1;min-width:0;text-align:left;padding:12px;border:1px solid transparent;border-radius:4px;background:white;color:inherit;cursor:pointer;overflow-wrap:anywhere}
.voice-base-select span {font-size:13px;line-height:1.5}
.voice-base-select[aria-pressed="true"] {background:#eaf5f0;border-color:#087f68}
.voice-base-item > .icon-button {flex-shrink:0}
.voice-base-favorite[aria-pressed="true"] {color:#9a6d00;background:#fff6d6}
.voice-base-favorite[aria-pressed="true"] svg {fill:currentColor}
.voice-library-item ul { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 5px; font-size: 13px; color: #65776f; }
.voice-style-candidate:has(.voice-style-choice:hover), .voice-style-candidate:focus-within { background: #eaf5f0; border-color: #087f68; }
.voice-style-play { flex-shrink: 0; margin: 8px; }
.voice-style-play[aria-busy="true"] svg {animation:voice-preview-spin .85s linear infinite}
@media(prefers-reduced-motion:reduce) {.voice-style-play[aria-busy="true"] svg {animation:none}}
#voice-studio-dialog { width: min(560px, calc(100% - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; box-sizing: border-box; padding: 24px; border: 1px solid #b9ccc5; border-radius: 8px; background: white; color: #263c35; }
#voice-studio-dialog::backdrop { background: #0008; }
#voice-studio-dialog [hidden] { display: none !important; }
#voice-studio-dialog input, #voice-studio-dialog select, #voice-studio-dialog textarea { max-width: 100%; }
#voice-studio-dialog label { display: block; margin-top: 12px; }
#voice-studio-library .voice-style-candidate { justify-content: space-between; padding: 8px 12px; gap: 12px; }
#voice-studio-library span { overflow-wrap: anywhere; min-width: 0; }
#voice-create-dialog { width: min(560px, calc(100% - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; box-sizing: border-box; padding: 24px; border: 1px solid #b9ccc5; border-radius: 8px; background: white; color: #263c35; }
#voice-create-dialog::backdrop { background: #0008; }
.voice-create-option { width: 100%; display: flex; align-items: center; gap: 14px; padding: 20px 16px; margin-top: 12px; text-align: left; border: 1px solid #b9ccc5; border-radius: 8px; background: white; color: inherit; cursor: pointer; }
.voice-create-option > span { display: grid; gap: 8px; flex: 1; min-width: 0; }
.voice-create-option strong { font-size: 16px; }
.voice-create-option span span { font-size: 14px; line-height: 1.5; }
.voice-create-option > svg { width: 22px; height: 22px; flex-shrink: 0; color: #087f68; }
.voice-create-option:hover:not(:disabled) { background: #eaf5f0; border-color: #087f68; }
.voice-create-option:disabled { opacity: .55; cursor: default; }
#voice-create-dialog { width: min(760px, calc(100% - 32px)); display: none; grid-template-columns: 1fr 1fr; gap: 16px; }
#voice-create-dialog[open] { display: grid; }
#voice-create-dialog .section-heading { grid-column: 1 / -1; }
#voice-create-dialog .voice-create-option { margin: 0; min-height: 200px; flex-direction: column; text-align: center; justify-content: center; }
#voice-create-dialog .voice-create-option > span { flex: 0; }
#voice-create-dialog .voice-create-option > svg:last-child:not(:first-child) { display: none; }
#voice-studio-dialog.voice-design-open { width: min(920px, calc(100% - 32px)); height: min(680px, calc(100dvh - 32px)); overflow: hidden; }
#voice-studio-dialog.voice-design-open[open] { display: flex; flex-direction: column; }
#voice-studio-dialog.voice-design-open > .section-heading { flex-shrink: 0; }
.voice-design-open .voice-design-layout { flex: 1; min-height: 0; }
.voice-design-form { min-height: 0; min-width: 0; overflow-y: auto; }
.voice-design-results #voice-style-candidates { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; padding: 3px; }
.voice-design-layout { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 24px; }
#voice-studio-dialog:not(.voice-design-open) .voice-design-layout { display: none; }
#voice-style-create > summary { display: none; }
#voice-style-create textarea { min-height: 240px; resize: vertical; padding: 12px; }
#voice-style-create input { min-height: 42px; padding: 10px 12px; }
#voice-style-create label { font-weight: 600; margin-bottom: 8px; }
.voice-design-results { display: flex; flex-direction: column; border: 1px solid #dce5e0; border-radius: 8px; padding: 16px; min-height: 0; min-width: 0; overflow: hidden; }
#voice-description-suggestions { display:flex;flex-wrap:wrap;gap:6px;margin-top:10px;max-height:100px;overflow-y:auto; }
.voice-description-suggestion { background:#f1f6f3;border:1px solid #dce5e0;color:#34634f;border-radius:6px;padding:7px 9px;font-size:12px;text-align:left;justify-content:flex-start;overflow-wrap:anywhere;max-width:100%; }
.voice-design-actions { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.voice-design-actions button { font-size: 13px; }
.voice-design-empty { display: flex; min-height: 300px; align-items: center; justify-content: center; flex-direction: column; gap: 20px; color: #65776f; text-align: center; font-size: 14px; }
.voice-design-empty svg { width: 40px; height: 40px; }
@media (max-width: 640px) {
    #voice-create-dialog { grid-template-columns: 1fr; padding: 18px; }
    #voice-create-dialog .voice-create-option { min-height: 150px; }
    .voice-design-layout { grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(0,1fr) minmax(0,1fr); gap: 16px; }
    #voice-studio-dialog { padding: 18px; }
    #voice-style-create textarea { min-height: 150px; }
    .voice-design-results { min-height: 0; }
    .voice-design-empty { min-height: 130px; }
}
