.voice-roster { border-top: 1px solid var(--color-border); padding-top: 24px; margin-top: 24px; }
.voice-roster .agent-slot-section-title { gap: 16px; flex-wrap: wrap; }
.voice-muted, .voice-field-hint { color: var(--color-muted); font-size: 13px; line-height: 1.6; }
.voice-muted { margin: 5px 0 0; }
.voice-roster-row { width: 100%; display: flex; align-items: center; gap: 18px; padding: 18px 20px; border: 0; border-bottom: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-ink); text-align: left; cursor: pointer; }
.voice-roster-row:hover { background: var(--color-surface-muted); }
.voice-roster-row > svg { width: 17px; height: 17px; color: var(--color-muted); }
.voice-row-copy { display: grid; gap: 5px; flex: 1; min-width: 0; }
.voice-row-copy strong { overflow-wrap: anywhere; }
.voice-row-copy > span { font-size: 12px; color: var(--color-muted); }
.voice-agent-page { max-width: 1180px; margin: 0 auto; padding: 24px; }
.voice-agent-header { display: flex; align-items: center; gap: 20px; margin-bottom: 24px; }
.voice-agent-header > div { flex: 1; min-width: 0; }
.voice-agent-header h1 { font-size: 24px; margin: 4px 0 0; overflow-wrap: anywhere; }
.voice-kicker { color: var(--color-muted); font-size: 12px; }
.voice-agent-shell { display: grid; grid-template-columns: 220px minmax(0,1fr); border: 1px solid var(--color-border); border-radius: 16px; background: var(--color-surface); overflow: hidden; }
.voice-setup-nav { display: flex; flex-direction: column; gap: 6px; padding: 20px 12px; border-right: 1px solid var(--color-border); background: var(--color-surface-muted); }
.voice-setup-nav button { display: flex; gap: 10px; align-items: center; text-align: left; padding: 12px; border: 0; border-radius: 8px; background: transparent; color: var(--color-muted); cursor: pointer; font-size: 13px; font-weight: 600; }
.voice-setup-nav button.is-active { color: var(--color-navy); background: var(--shell-bg-active); }
.voice-setup-nav svg, .voice-agent-page .button svg, .voice-roster .button svg { width: 17px; height: 17px; flex-shrink: 0; }
.voice-setup-content { padding: 28px 32px; min-height: 560px; }
.voice-setup-content fieldset { padding: 0; margin: 0; border: 0; min-width: 0; }
.voice-setup-content h2 { margin: 0 0 4px; font-size: 19px; }
.voice-setup-content section > .voice-muted { margin-bottom: 24px; }
.voice-field { display: grid; gap: 9px; margin: 20px 0; font-size: 13px; font-weight: 600; }
.voice-field input, .voice-field textarea, .voice-picker-trigger, .voice-picker-popover input { width: 100%; padding: 12px 14px; border: 1px solid var(--color-border); border-radius: 8px; background: var(--color-surface); color: var(--color-ink); font: inherit; font-weight: 400; line-height: 1.6; }
.voice-field textarea { resize: vertical; }
.voice-field :is(input,textarea):focus, .voice-picker-trigger:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.voice-field-hint { margin-top: -12px; font-size: 12px; }
.voice-enabled { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 0; border-top: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border); }
.voice-enabled strong { font-size: 13px; }.voice-enabled small { display: block; margin-top: 6px; color: var(--color-muted); }
.voice-enabled input { appearance: none; width: 44px; height: 25px; border-radius: 20px; background: #cbd5e1; position: relative; cursor: pointer; flex-shrink: 0; }
.voice-enabled input:before { content: ''; position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; background: white; border-radius: 50%; transition: transform .15s; }
.voice-enabled input:checked { background: #4fb991; }.voice-enabled input:checked:before { transform: translateX(19px); }
.voice-setup-note { display: flex; gap: 9px; color: var(--color-muted); font-size: 12px; line-height: 1.6; margin-top: 22px; }.voice-setup-note svg { width: 16px; flex-shrink: 0; }
.voice-agent-footer { grid-column: 1/-1; display: flex; justify-content: space-between; gap: 20px; align-items: center; padding: 16px 24px; border-top: 1px solid var(--color-border); }
.voice-agent-footer > div { display: flex; align-items: center; gap: 16px; min-width: 0; }.voice-agent-footer [role=status] { font-size: 12px; color: var(--color-muted); overflow-wrap: anywhere; }
.voice-delete { color: #ae3d3d; }.voice-error, .voice-agent-footer .voice-error { color: #ae3d3d; }
.voice-access-note { padding: 12px 16px; background: var(--color-surface-muted); font-size: 13px; border-radius: 8px; line-height: 1.6; }
.voice-picker { position: relative; }.voice-picker-trigger { display: flex; align-items: center; justify-content: space-between; cursor: pointer; }.voice-picker-trigger svg { width: 16px; height: 16px; }
.voice-picker-popover { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 6px); background: var(--color-surface); border: 1px solid var(--color-border); box-shadow: var(--shadow-tight); border-radius: 10px; padding: 10px; }
.voice-picker-options { max-height: 220px; overflow: auto; margin-top: 6px; }.voice-picker-options button { display: block; width: 100%; background: transparent; border: 0; border-radius: 6px; padding: 10px; text-align: left; color: var(--color-ink); cursor: pointer; }.voice-picker-options button:hover,.voice-picker-options button[aria-pressed=true] { background: var(--shell-bg-active); }
.voice-prompt textarea { min-height: 390px; font-size: 14px; line-height: 1.8; }.voice-prompt-meta { display: flex; justify-content: space-between; gap: 16px; color: var(--color-muted); font-size: 11px; margin: -8px 0 22px; }.voice-prompt-meta > span:last-child { white-space: nowrap; }
.voice-agent-page [hidden], .voice-roster [hidden] { display: none !important; }
html[data-dashboard-theme="dark"] :is(.voice-agent-page,.voice-roster) { --color-surface:#202428; --color-surface-muted:#191d21; --color-ink:#e7e9eb; --color-muted:#a4acb5; --color-border:#373e46; --color-navy:#dbe7f7; --color-accent:#a9c7ee; --shell-bg-active:#303a46; color:var(--color-ink); }
html[data-dashboard-theme="dark"] body:has(.voice-agent-page), html[data-dashboard-theme="dark"] body:has(.voice-agent-page) :is(.main,.content,.workspace) { background:#111214; }
html[data-dashboard-theme="dark"] .voice-agent-page .button-primary { background:#dbe7f7; color:#18202a; border-color:#dbe7f7; }
html[data-dashboard-theme="dark"] .voice-agent-page .button-ghost { color:var(--color-ink); border-color:var(--color-border); background:transparent; }
html[data-dashboard-theme="dark"] .voice-agent-page .voice-delete { color:#f0a9a9; }
@media(max-width:760px) { .voice-agent-page { padding: 12px; }.voice-agent-shell { grid-template-columns: minmax(0,1fr); }.voice-setup-nav { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--color-border); padding: 10px; }.voice-setup-nav button { white-space: nowrap; }.voice-setup-content { padding: 20px; }.voice-agent-header { gap: 10px; }.voice-agent-header h1 { font-size: 19px; }.voice-roster-row { flex-wrap: wrap; gap: 12px; }.voice-agent-footer { padding: 14px; }.voice-prompt-meta { flex-direction: column; gap: 4px; } }
@media(max-width:480px) { .voice-agent-footer { flex-wrap:wrap; gap:12px; }.voice-agent-footer > div { flex:1; flex-wrap:wrap; gap:8px; }.voice-agent-footer .button { white-space:nowrap; }.voice-agent-header > .agent-type-pill { display:none; } }
/* One creation dialog, stable across type selection and every setup view. */
[data-create-modal] .modal-card { width:min(900px,100%); height:min(740px,calc(100dvh - 48px)); max-height:none; }
[data-create-modal] .create-form-shell { display:flex; flex-direction:column; height:100%; min-height:0; padding:0; gap:0; overflow:hidden; }
[data-create-modal] [hidden] { display:none !important; }
.agent-create-heading { display:flex; align-items:center; justify-content:space-between; gap:20px; padding:22px 28px; border-bottom:1px solid var(--color-border); flex-shrink:0; }
.agent-create-heading span { color:var(--color-muted); font-size:12px; }.agent-create-heading h2 { margin:5px 0 0; font-size:22px; }
.agent-create-heading svg { width:18px; height:18px; }
.agent-type-choice { flex:1; overflow:auto; padding:30px; }.agent-type-choice h3 { margin:0 0 8px; font-size:18px; }.agent-type-choice > p { font-size:13px; color:var(--color-muted); margin:0 0 24px; }
[data-create-modal] .create-kind-tabs { display:grid; gap:12px; border:0; margin:0; padding:0; }
[data-create-modal] .create-kind-tab { display:flex; align-items:center; gap:18px; width:100%; min-height:100px; padding:20px; border:1px solid var(--color-border); border-radius:12px; color:var(--color-ink); background:var(--color-surface); text-align:left; }
[data-create-modal] .create-kind-tab:hover { border-color:var(--color-accent); background:var(--color-surface-muted); }
[data-create-modal] .create-kind-tab > svg:first-child { width:25px; height:25px; color:var(--color-accent); flex-shrink:0; }
[data-create-modal] .create-kind-tab > svg:last-child { width:18px; height:18px; margin-left:auto; flex-shrink:0; }
[data-create-modal] .create-kind-tab span { display:grid; gap:7px; }.create-kind-tab strong { font-size:15px; }.create-kind-tab small { font-size:13px; font-weight:400; line-height:1.6; color:var(--color-muted); }
.agent-type-footer { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:18px 28px; border-top:1px solid var(--color-border); }.agent-type-footer span { font-size:12px; color:var(--color-muted); }
[data-create-setup-step], [data-create-voice-step] { flex:1; min-height:0; overflow:hidden; }
[data-create-modal] .create-form { display:flex; flex-direction:column; gap:8px; height:100%; overflow-y:auto; padding:24px 28px 0; }
[data-create-modal] .create-form label { display:block; margin:0 0 8px; font-size:13px; font-weight:600; color:var(--color-ink); }
[data-create-modal] .create-form :is(input:not([type=hidden]),textarea,select) { width:100%; padding:11px 13px; border:1px solid var(--color-border); border-radius:8px; font:inherit; font-size:14px; background:var(--color-surface); color:var(--color-ink); }
[data-create-modal] .create-form textarea { resize:vertical; min-height:90px; }.create-form [data-create-role-controls] { margin-top:10px; }
[data-create-modal] .field-meta { margin:0 0 10px; }.create-form .role-field textarea { min-height:170px; }
[data-create-modal] .create-form .identity-footer { position:sticky; bottom:0; margin: auto -28px 0; padding:16px 28px; background:var(--color-surface); border-top:1px solid var(--color-border); flex-shrink:0; }
[data-create-modal] .create-form .identity-actions { margin-left:auto; }
[data-create-voice-step] .voice-agent-page { height:100%; max-width:none; padding:0; margin:0; }
[data-create-voice-step] .voice-agent-header { display:none; }
[data-create-voice-step] .voice-agent-shell { height:100%; border:0; border-radius:0; grid-template-columns:190px minmax(0,1fr); grid-template-rows:minmax(0,1fr) auto; }
[data-create-voice-step] .voice-setup-content { min-height:0; overflow:auto; padding:24px; }
[data-create-voice-step] .voice-agent-footer { padding:16px 28px; }
[data-create-voice-step] .voice-agent-footer [data-voice-delete] { display:none; }
html[data-dashboard-theme=dark] [data-create-modal] { --color-surface:#202428; --color-surface-muted:#191d21; --color-ink:#e7e9eb; --color-muted:#a4acb5; --color-border:#373e46; --color-accent:#a9c7ee; }
@media(max-width:760px) { [data-create-modal] .modal-card { height:calc(100dvh - 28px); }.agent-create-heading { padding:16px 20px; }.agent-type-choice { padding:20px; }[data-create-voice-step] .voice-agent-shell { grid-template-columns:1fr; grid-template-rows:auto minmax(0,1fr) auto; }[data-create-voice-step] .voice-setup-content { padding:20px; }.agent-type-footer { padding:16px 20px; }.agent-type-footer span { max-width:65%; } }
.voice-initial-form { display:flex; flex-direction:column; height:100%; }.voice-initial-fields { flex:1; overflow:auto; padding:24px 28px; }.voice-initial-fields > p:first-child { margin:0 0 24px; }.voice-initial-footer { display:flex; align-items:center; gap:16px; padding:16px 28px; border-top:1px solid var(--color-border); }.voice-initial-footer [role=status] { flex:1; font-size:12px; color:var(--color-muted); }.voice-initial-footer button { white-space:nowrap; }
.workspace:has(> .voice-agent-page) { max-width:none; width:100%; }.content:has(.voice-agent-page) { max-width:none; width:100%; }.workspace > .voice-agent-page { max-width:none; width:100%; margin:0; padding:0; }.workspace > .voice-agent-page .voice-agent-shell { min-height:calc(100dvh - 210px); }.workspace > .voice-agent-page .voice-setup-content { min-height:0; }
.voice-placeholder { min-height:380px; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; color:var(--color-muted); padding:32px; }.voice-placeholder > span { display:grid; place-items:center; width:56px; height:56px; border-radius:14px; background:var(--color-surface-muted); margin-bottom:18px; }.voice-placeholder svg { width:25px; height:25px; }.voice-placeholder h3 { font-size:16px; margin:0 0 8px; color:var(--color-ink); }.voice-placeholder p { font-size:13px; max-width:360px; line-height:1.7; margin:0; }.voice-setup-nav button { flex-shrink:0; }

.agent-roster-row.voice-agent-roster-row { width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.voice-agent-roster-row .agent-row-actions svg { width: 18px; height: 18px; }

/* Keep every setup footer outside the scrolling fields. */
[data-create-modal] .agent-create-heading h2 { margin:0; }
[data-create-modal] .agent-create-close { display:grid; place-items:center; flex:0 0 36px; width:36px; height:36px; padding:0; border:0; border-radius:8px; background:transparent; color:var(--color-muted); cursor:pointer; transition:background .15s, color .15s; }
[data-create-modal] .agent-create-close:hover { background:var(--color-surface-muted); color:var(--color-ink); }
[data-create-modal] .agent-create-close:focus-visible { outline:2px solid var(--color-accent); outline-offset:3px; }
[data-create-modal] .agent-type-choice h3 { margin-bottom:24px; }
[data-create-modal] .create-form { overflow:hidden; padding:0; margin:0; gap:0; }
[data-create-modal] .create-form-fields { flex:1; min-height:0; overflow-y:auto; padding:24px 28px; display:flex; flex-direction:column; gap:8px; }
[data-create-modal] .create-form .identity-footer { position:static; margin:0; padding:18px 28px; flex-shrink:0; min-height:76px; }
[data-create-modal] .create-form .identity-actions { flex:1; display:flex; justify-content:space-between; margin:0; }
[data-create-modal] .create-form [data-create-helper]:empty { display:none; }
[data-create-modal] .voice-initial-footer { padding:18px 28px; min-height:76px; flex-shrink:0; }
@media(max-width:760px) { [data-create-modal] .create-form-fields { padding:24px 20px; } [data-create-modal] .create-form .identity-footer, [data-create-modal] .voice-initial-footer { padding:18px 20px; } }

/* Voice settings occupy the available application viewport, with independent page actions. */
.content:has(.voice-agent-page) { padding:0; }
.workspace:has(> .voice-agent-page) { min-height:0; }
.workspace > .voice-agent-page, .voice-agent-page { width:100%; height:calc(100dvh - var(--app-header-height, 67px)); max-width:none; margin:0; padding:0; }
.voice-agent-page .voice-agent-shell, .workspace > .voice-agent-page .voice-agent-shell { height:100%; min-height:0; margin:0; border:0; border-radius:0; grid-template-columns:240px minmax(0,1fr); grid-template-rows:minmax(0,1fr); }
.voice-agent-page .voice-setup-nav { min-height:0; overflow-y:auto; padding:0; }
.voice-nav-heading { padding:20px 20px 24px; border-bottom:1px solid var(--color-border); }
.voice-nav-heading .button { margin-bottom:22px; padding:6px 0; }
.voice-nav-heading .voice-kicker { display:block; }
.voice-nav-heading h1 { font-size:18px; line-height:1.4; overflow-wrap:anywhere; margin:7px 0 0; }
.voice-nav-pages { display:flex; flex-direction:column; gap:6px; padding:16px 12px; }
.voice-agent-page .voice-setup-content { min-height:0; overflow-y:auto; padding:32px; }
.voice-page-actions { display:flex; justify-content:flex-end; align-items:center; gap:18px; padding:24px 0 0; margin-top:28px; border-top:1px solid var(--color-border); }
.voice-page-actions [role=status] { flex:1; font-size:12px; color:var(--color-muted); }
.voice-page-actions .voice-error { color:#ae3d3d; }
.voice-agent-page .voice-placeholder { min-height:0; height:calc(100dvh - var(--app-header-height, 67px) - 140px); }
@media(max-width:760px) {
 .voice-agent-page .voice-agent-shell { grid-template-columns:minmax(0,1fr); grid-template-rows:auto minmax(0,1fr); }
 .voice-agent-page .voice-setup-nav { display:block; overflow:visible; border-right:0; }
 .voice-nav-heading { padding:12px 20px; display:grid; grid-template-columns:auto 1fr; column-gap:18px; }
 .voice-nav-heading .button { grid-row:1/3; margin:0; }
 .voice-nav-heading h1 { margin:2px 0 0; font-size:16px; }
 .voice-nav-pages { flex-direction:row; overflow-x:auto; padding:8px 12px; }
 .voice-agent-page .voice-setup-content { padding:24px 20px; }
 .voice-agent-page .voice-placeholder { height:auto; min-height:240px; }
}

.voice-picker-row { display:flex; align-items:center; gap:16px; padding:8px 10px; border-radius:8px; }
.voice-picker-row:hover, .voice-picker-row:has([aria-pressed=true]) { background:var(--shell-bg-active); }
.voice-picker-options .voice-picker-row > [data-select-voice] { flex:1; min-width:0; align-self:stretch; padding:8px 0; background:transparent; font-size:13px; }
.voice-preview-controls { display:flex; gap:12px; flex-shrink:0; }
.voice-preview-control { display:flex; flex-direction:column; align-items:center; gap:4px; }
.voice-preview-control > span { font-size:10px; letter-spacing:.06em; color:var(--color-muted); line-height:1; }
.voice-picker-options [data-voice-preview] { display:grid; place-items:center; width:30px; height:30px; padding:0; border:1px solid var(--color-border); border-radius:7px; background:var(--color-surface); }
.voice-picker-options [data-voice-preview]:hover, .voice-picker-options [data-voice-preview].is-playing { color:var(--color-navy); border-color:var(--color-accent); background:var(--color-surface-muted); }
[data-voice-preview] svg { width:17px; height:17px; }
[data-voice-preview].is-loading { opacity:.5; }
.voice-preview-status { margin:8px 4px 0; font-size:12px; font-weight:400; color:var(--color-muted); }
.voice-preview-status:empty { display:none; }

.voice-setup-content:has([data-voice-panel="instructions"]:not([hidden])) { display:flex; flex-direction:column; overflow:hidden; }
.voice-setup-content:has([data-voice-panel="instructions"]:not([hidden])) > fieldset { flex:1; min-height:0; }
[data-voice-panel="instructions"]:not([hidden]) { display:flex; flex-direction:column; height:100%; min-height:0; }
.voice-instructions-heading { display:flex; align-items:center; justify-content:space-between; gap:24px; flex-shrink:0; }
.voice-instructions-heading h2 { margin:0; }
.voice-instructions-actions { display:flex; align-items:center; gap:16px; }
.voice-instructions-actions > span { color:var(--color-muted); font-size:12px; white-space:nowrap; }
.voice-instructions-actions > .voice-error { color:#ae3d3d; }
.voice-instructions-actions .button { white-space:nowrap; }
[data-voice-panel="instructions"] .voice-prompt { display:flex; flex:1; min-height:0; margin:20px 0 0; }
[data-voice-panel="instructions"] .voice-prompt textarea { flex:1; width:100%; height:100%; min-height:0; resize:none; }
@media(max-width:760px) { .voice-instructions-heading { gap:12px; flex-wrap:wrap; }.voice-instructions-actions { flex-wrap:wrap; gap:10px; }.voice-instructions-heading h2 { font-size:17px; } }
