/* Bella5 Call Intelligence console */
:root {
    --ci-bg: #f4f4f5;
    --ci-surface: #ffffff;
    --ci-border: #e4e4e7;
    --ci-border-soft: #f0f0f2;
    --ci-ink: #18181b;
    --ci-muted: #71717a;
    --ci-accent: #2563eb;
    --ci-rail: #0f0f10;
    --ci-nav-w: 15.5rem;
    --ci-rail-w: 3.25rem;
    --ci-assistant-w: 22.5rem;
    --ci-radius: 0.75rem;
    --ci-font: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
        sans-serif;
    --ci-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --ci-shadow-md: 0 4px 24px rgba(15, 23, 42, 0.06);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

.ci-body {
    margin: 0;
    font-family: var(--ci-font);
    font-size: 0.875rem;
    line-height: 1.45;
    color: var(--ci-ink);
    background: var(--ci-bg);
    -webkit-font-smoothing: antialiased;
}

.ci-app {
    display: grid;
    grid-template-columns: var(--ci-nav-w) minmax(0, 1fr);
    min-height: 100dvh;
    max-height: 100dvh;
    height: 100dvh;
    overflow: hidden;
}

.ci-app > .ci-nav,
.ci-app > .ci-main {
    min-height: 0;
}

.ci-rail {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 0;
    background: var(--ci-rail);
    border-right: 1px solid #27272a;
}

.ci-rail__logo {
    display: flex;
    width: 2rem;
    height: 2rem;
    margin-bottom: 0.5rem;
    border-radius: 0.5rem;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    text-decoration: none;
}

.ci-rail__logo-mark {
    margin: auto;
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 50%;
    background: #fff;
}

.ci-rail__nav {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex: 1;
}

.ci-rail__foot {
    margin-top: auto;
}

.ci-rail__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.5rem;
    color: #a1a1aa;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.ci-rail__btn:hover,
.ci-rail__btn.is-active {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.ci-nav {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100dvh;
    max-height: 100dvh;
    background: var(--ci-surface);
    border-right: 1px solid var(--ci-border);
    overflow: hidden;
}

.ci-nav__workspace {
    padding: 1rem 0.85rem 0.85rem;
    border-bottom: 1px solid var(--ci-border-soft);
    background: linear-gradient(180deg, #fafafa 0%, var(--ci-surface) 100%);
}

.ci-nav__back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--ci-muted);
    text-decoration: none;
    margin-bottom: 0.85rem;
    transition: color 0.15s ease;
}

.ci-nav__back i {
    font-size: 0.65rem;
    opacity: 0.85;
}

.ci-nav__back:hover {
    color: var(--ci-ink);
}

.ci-nav__agent-card {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 0.7rem;
    border-radius: 0.65rem;
    border: 1px solid var(--ci-border-soft);
    background: var(--ci-surface);
    box-shadow: var(--ci-shadow-sm);
}

.ci-nav__agent-copy {
    min-width: 0;
}

.ci-nav__agent-icon {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 0.65rem;
    background: linear-gradient(145deg, #dbeafe, #c7d2fe 45%, #ede9fe);
    font-size: 0.6875rem;
    font-weight: 800;
    color: #3730a3;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.ci-nav__agent-copy strong {
    display: block;
    font-size: 0.9375rem;
    letter-spacing: -0.02em;
}

.ci-nav__agent-copy > span {
    display: block;
    font-size: 0.75rem;
    color: var(--ci-muted);
}

.ci-nav__pin {
    margin: 0.65rem 0 0;
    font-size: 0.6875rem;
    color: var(--ci-muted);
}

.ci-nav__pin code {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ci-ink);
    background: var(--ci-border-soft);
    padding: 0.1rem 0.35rem;
    border-radius: 0.35rem;
}

.ci-nav__sections {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.75rem 0.65rem 1rem;
    -webkit-overflow-scrolling: touch;
}

.ci-nav__label {
    margin: 0.85rem 0.35rem 0.35rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #a1a1aa;
}

.ci-nav__label:first-child {
    margin-top: 0;
}

.ci-nav__link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.55rem;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    color: #52525b;
    text-decoration: none;
}

button.ci-nav__link {
    width: 100%;
    border: 0;
    background: transparent;
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.ci-nav__link i {
    width: 1rem;
    text-align: center;
    font-size: 0.75rem;
    color: #a1a1aa;
}

.ci-nav__link:hover {
    background: var(--ci-border-soft);
    color: var(--ci-ink);
}

.ci-nav__link.is-active {
    background: #f4f4f5;
    color: var(--ci-ink);
    font-weight: 600;
}

.ci-nav__link.is-active i {
    color: var(--ci-accent);
}

.ci-nav__link--soon {
    opacity: 0.72;
}

.ci-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    background: var(--ci-bg);
}

.ci-topbar {
    box-shadow: var(--ci-shadow-sm);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 1rem;
    background: var(--ci-surface);
    border-bottom: 1px solid var(--ci-border);
}

.ci-topbar__menu {
    display: none;
    border: 0;
    background: transparent;
    padding: 0.35rem;
    border-radius: 0.35rem;
    color: var(--ci-muted);
}

.ci-topbar__left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.ci-topbar__crumb {
    font-size: 0.8125rem;
    white-space: nowrap;
}

.ci-topbar__crumb strong {
    font-weight: 600;
}

.ci-topbar__sep {
    color: #d4d4d8;
    margin: 0 0.25rem;
}

.ci-topbar__status {
    flex-shrink: 0;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.ci-topbar__status--live {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.ci-topbar__status--warn {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}

.ci-topbar__search {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    max-width: 28rem;
    margin-inline: auto;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--ci-border);
    background: #fafafa;
    color: var(--ci-muted);
}

.ci-topbar__search input {
    flex: 1;
    border: 0;
    background: transparent;
    font: inherit;
    color: var(--ci-ink);
    min-width: 0;
}

.ci-topbar__search input:focus {
    outline: none;
}

.ci-topbar__search kbd {
    font-size: 0.6875rem;
    padding: 0.15rem 0.35rem;
    border-radius: 0.35rem;
    border: 1px solid var(--ci-border);
    background: #fff;
    color: #a1a1aa;
}

.ci-topbar__actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.ci-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
}

.ci-btn--ghost {
    background: #fff;
    border-color: var(--ci-border);
    color: var(--ci-ink);
}

.ci-btn--ghost:hover {
    background: #fafafa;
}

.ci-btn--dark {
    background: #18181b;
    color: #fff;
}

.ci-btn--dark:hover {
    background: #27272a;
}

.ci-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--ci-assistant-w);
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.ci-workspace > .ci-assistant {
    height: 100%;
}

.ci-workspace.is-orch-collapsed {
    grid-template-columns: minmax(0, 1fr) 2.75rem;
}

.ci-orchestrator-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    height: 100%;
    padding: 0.85rem 0.35rem;
    border: 0;
    border-left: 1px solid var(--ci-border);
    background: linear-gradient(180deg, #fafafa 0%, #fff 40%);
    color: #475569;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.ci-orchestrator-tab:hover {
    background: #f4f4f5;
    color: #0f172a;
}

.ci-orchestrator-tab__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    background: #18181b;
    color: #fff;
    font-size: 0.875rem;
}

.ci-orchestrator-tab__label {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 0.625rem;
    font-weight: 650;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ci-architect__collapse {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    margin-left: 0.35rem;
    padding: 0;
    border: 0;
    border-radius: 0.45rem;
    background: transparent;
    color: #64748b;
    cursor: pointer;
}

.ci-architect__collapse:hover {
    background: #f4f4f5;
    color: #0f172a;
}

.ci-workspace__primary {
    overflow-y: auto;
    padding: 1rem 1.25rem 2rem;
}

.ci-panel {
    background: var(--ci-surface);
    border: 1px solid var(--ci-border);
    border-radius: var(--ci-radius);
    padding: 1.15rem 1.25rem 1.35rem;
    margin-bottom: 1rem;
}

.ci-panel--flat {
    background: transparent;
    border: none;
    padding-inline: 0;
}

.ci-panel__head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.ci-panel__title {
    margin: 0;
    font-size: 1.375rem;
    font-weight: 650;
    letter-spacing: -0.03em;
}

.ci-panel__title--sm {
    font-size: 1.0625rem;
    margin-bottom: 0.75rem;
}

.ci-panel__sub {
    margin: 0.25rem 0 0;
    font-size: 0.8125rem;
    color: var(--ci-muted);
}

.ci-badge {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 600;
    vertical-align: middle;
    background: #dcfce7;
    color: #15803d;
}

.ci-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

.ci-tag {
    font-size: 0.75rem;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    background: #f4f4f5;
    color: #52525b;
}

.ci-tag--add {
    border: 1px dashed var(--ci-border);
    background: #fff;
    cursor: pointer;
    font: inherit;
    color: var(--ci-muted);
}

.ci-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.65rem;
    margin-bottom: 1.15rem;
}

.ci-metric {
    padding: 0.75rem 0.85rem;
    border-radius: 0.65rem;
    border: 1px solid var(--ci-border-soft);
    background: #fafafa;
}

.ci-metric__label {
    display: block;
    font-size: 0.6875rem;
    color: var(--ci-muted);
    margin-bottom: 0.25rem;
}

.ci-metric__value {
    display: block;
    font-size: 1.25rem;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.ci-metric__delta {
    font-size: 0.6875rem;
    color: var(--ci-muted);
}

.ci-metric__delta--up {
    color: #15803d;
}

.ci-metric__delta--warn {
    color: #b45309;
}

.ci-editor-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(16rem, 0.85fr);
    gap: 1rem;
    align-items: start;
}

.ci-field label {
    font-size: 0.8125rem;
    font-weight: 600;
}

.ci-field__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.45rem;
}

.ci-textarea {
    width: 100%;
    resize: vertical;
    min-height: 6rem;
    padding: 0.75rem 0.85rem;
    border-radius: 0.65rem;
    border: 1px solid var(--ci-border);
    font: inherit;
    line-height: 1.55;
    color: var(--ci-ink);
    background: #fafafa;
}

.ci-textarea:focus {
    outline: 2px solid rgba(37, 99, 235, 0.25);
    border-color: #93c5fd;
    background: #fff;
}

.ci-textarea--sm {
    min-height: 4rem;
}

.ci-field__hint {
    margin: 0.45rem 0 0;
    font-size: 0.6875rem;
    color: var(--ci-muted);
}

.ci-field__hint code {
    font-size: 0.75rem;
    background: #f4f4f5;
    padding: 0.05rem 0.25rem;
    border-radius: 0.25rem;
}

.ci-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: 0.65rem;
    font-size: 0.75rem;
    color: var(--ci-muted);
    cursor: pointer;
}

.ci-switch input {
    accent-color: var(--ci-accent);
}

.ci-stack {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.ci-field--compact {
    padding: 0.85rem;
    border: 1px solid var(--ci-border);
    border-radius: 0.65rem;
    background: #fafafa;
}

.ci-card {
    border: 1px solid var(--ci-border);
    border-radius: 0.65rem;
    padding: 0.65rem 0.75rem;
    background: #fff;
}

.ci-card__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ci-muted);
    margin-bottom: 0.45rem;
}

.ci-link {
    border: 0;
    background: none;
    font: inherit;
    font-size: 0.6875rem;
    color: var(--ci-accent);
    cursor: pointer;
}

.ci-card__row {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.ci-card__row strong {
    display: block;
    font-size: 0.8125rem;
}

.ci-card__row span {
    display: block;
    font-size: 0.6875rem;
    color: var(--ci-muted);
}

.ci-card__avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f4f4f5;
    color: #52525b;
    flex-shrink: 0;
}

.ci-card__avatar--model {
    background: #eff6ff;
    color: #2563eb;
}

.ci-card__flag {
    font-size: 1.25rem;
}

.ci-pill {
    margin-left: auto;
    font-size: 0.6875rem;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: #f4f4f5;
    color: #52525b;
}

.ci-muted {
    color: #a1a1aa;
    margin-left: auto;
}

.ci-icon-btn {
    border: 0;
    background: transparent;
    color: var(--ci-muted);
    padding: 0.35rem;
    border-radius: 0.35rem;
    cursor: pointer;
}

.ci-icon-btn:hover {
    background: #f4f4f5;
    color: var(--ci-ink);
}

.ci-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--ci-border);
    border-radius: var(--ci-radius);
    background: var(--ci-surface);
}

.ci-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.ci-table th,
.ci-table td {
    padding: 0.65rem 0.85rem;
    text-align: left;
    border-bottom: 1px solid var(--ci-border-soft);
}

.ci-table th {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ci-muted);
    background: #fafafa;
}

.ci-table tr:last-child td {
    border-bottom: 0;
}

.ci-sentiment {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
}

.ci-sentiment--pos {
    background: #dcfce7;
    color: #15803d;
}

.ci-sentiment--neu {
    background: #f4f4f5;
    color: #52525b;
}

.ci-sentiment--warn {
    background: #ffedd5;
    color: #c2410c;
}

.ci-assistant {
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--ci-border);
    background: var(--ci-surface);
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
}

.ci-assistant.ci-architect {
    background: linear-gradient(180deg, #fafafa 0%, #fff 12rem);
    box-shadow: -8px 0 32px rgba(15, 23, 42, 0.04);
}

.ci-assistant__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0.85rem;
    border-bottom: 1px solid var(--ci-border-soft);
    font-weight: 600;
    font-size: 0.8125rem;
}

.ci-assistant__tools {
    display: flex;
    gap: 0.15rem;
}

.ci-assistant__thread {
    flex: 1;
    overflow-y: auto;
    padding: 0.85rem;
}

.ci-assistant__note {
    margin: 0 0 0.65rem;
    font-size: 0.8125rem;
    color: #52525b;
    line-height: 1.5;
}

.ci-assistant__note--sandbox {
    margin: 0.75rem 0 0;
    padding: 0.65rem 0.75rem;
    border-radius: 0.55rem;
    border: 1px solid var(--ci-border-soft);
    background: #f8fafc;
    font-size: 0.75rem;
}

.ci-assistant__note--sandbox strong {
    font-weight: 650;
    color: #334155;
}

.ci-assistant__note--sandbox code {
    font-size: 0.6875rem;
}

.ci-assistant__head-title {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.ci-assistant__head-title small {
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--ci-muted);
}

.ci-guide-card {
    margin: 0 0 0.85rem;
    padding: 0.75rem 0.8rem;
    border-radius: 0.65rem;
    border: 1px solid var(--ci-border-soft);
    background: #fafafa;
}

.ci-guide-card[hidden] {
    display: none !important;
}

.ci-guide-card__kicker {
    margin: 0 0 0.35rem;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #6366f1;
}

.ci-guide-card__title {
    margin: 0 0 0.45rem;
    font-size: 0.875rem;
    font-weight: 650;
    letter-spacing: -0.02em;
    color: var(--ci-ink);
}

.ci-guide-card__body {
    margin: 0;
    font-size: 0.75rem;
    line-height: 1.55;
    color: #52525b;
}

.ci-guide-card__api {
    display: block;
    margin-top: 0.5rem;
    padding: 0.45rem 0.55rem;
    border-radius: 0.45rem;
    background: #fff;
    border: 1px solid var(--ci-border);
    font-size: 0.6875rem;
    color: #4338ca;
    word-break: break-all;
}

.ci-guide-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.55rem;
}

.ci-guide-card__link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    border: 1px solid var(--ci-border);
    background: #fff;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--ci-ink);
    text-decoration: none;
    cursor: pointer;
}

.ci-guide-card__link:hover {
    background: #f4f4f5;
}

.ci-panel__sdk-note {
    margin: 0 0 1rem;
    padding: 0.65rem 0.75rem;
    border-radius: 0.55rem;
    border: 1px solid #e0e7ff;
    background: #eef2ff;
    font-size: 0.75rem;
    line-height: 1.5;
    color: #3730a3;
}

.ci-panel__sdk-note code {
    font-size: 0.6875rem;
    background: rgba(255, 255, 255, 0.7);
    padding: 0.05rem 0.25rem;
    border-radius: 0.25rem;
}

.ci-assistant__bubble {
    margin: 0.85rem 0;
    padding: 0.65rem 0.75rem;
    border-radius: 0.65rem;
    background: #f4f4f5;
    font-size: 0.75rem;
    color: var(--ci-muted);
}

.ci-assistant__stage {
    margin-top: 1rem;
    padding: 0.85rem;
    border-radius: 0.65rem;
    border: 1px solid var(--ci-border);
    font-size: 0.75rem;
    color: #52525b;
}

.ci-assistant__stage p {
    margin: 0 0 0.45rem;
}

.ci-assistant__stage-actions {
    display: flex;
    gap: 0.35rem;
    margin-top: 0.65rem;
}

.ci-assistant__composer {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.65rem 0.85rem;
    border-top: 1px solid var(--ci-border-soft);
}

.ci-assistant__composer input {
    flex: 1;
    border: 0;
    font: inherit;
    font-size: 0.8125rem;
    min-width: 0;
}

.ci-assistant__composer input:focus {
    outline: none;
}

.ci-preview {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.ci-preview[hidden] {
    display: none !important;
}

.ci-preview__backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    padding: 0;
    cursor: pointer;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(3px);
}

.ci-preview__panel {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(100%, 26rem);
    max-height: min(92dvh, 44rem);
    border-radius: 1rem;
    border: 1px solid var(--ci-border);
    background: #fff;
    box-shadow: 0 28px 80px -24px rgba(15, 23, 42, 0.35);
    overflow: hidden;
}

.ci-preview__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 0.85rem;
    border-bottom: 1px solid var(--ci-border-soft);
    background: #fafafa;
}

.ci-preview__toolbar-text {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.ci-preview__label {
    font-family: var(--ci-font);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--ci-ink);
}

.ci-preview__agent {
    font-size: 0.6875rem;
    color: var(--ci-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 18rem;
}

.ci-preview__stage {
    flex: 1;
    min-height: 24rem;
    padding: 0.5rem 0.65rem 0.85rem;
    overflow: auto;
    background: #fff;
}

.ci-preview__stage elevenlabs-convai {
    display: block;
    width: 100%;
    min-height: 22rem;
}

body.ci-preview-open {
    overflow: hidden;
}

body.ci-orchestrator-open {
    overflow: hidden;
}

/* Orchestrator — Bella5 voice builder */
.ci-orchestrator {
    position: fixed;
    inset: 0;
    z-index: 210;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.ci-orchestrator[hidden] {
    display: none !important;
}

.ci-orchestrator__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    cursor: pointer;
}

.ci-orchestrator__panel {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(100%, 56rem);
    max-height: min(92dvh, 40rem);
    border-radius: 1rem;
    border: 1px solid var(--ci-border);
    background: #fff;
    box-shadow: 0 32px 90px -28px rgba(15, 23, 42, 0.4);
    overflow: hidden;
}

.ci-orchestrator__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.1rem 0.75rem;
    border-bottom: 1px solid var(--ci-border-soft);
}

.ci-orchestrator__eyebrow {
    margin: 0;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ci-muted);
}

.ci-orchestrator__head h2 {
    margin: 0.15rem 0 0;
    font-size: 1.125rem;
    font-weight: 650;
}

.ci-orchestrator__sync {
    margin: 0.35rem 0 0;
    font-size: 0.75rem;
    color: var(--ci-muted);
    max-width: 28rem;
}

.ci-orchestrator__sync.is-ok {
    color: #15803d;
}

.ci-orchestrator__sync.is-error {
    color: #b91c1c;
}

.ci-orchestrator__tabs {
    display: flex;
    gap: 0.25rem;
    padding: 0 1rem;
    border-bottom: 1px solid var(--ci-border-soft);
}

.ci-orchestrator__tabs button {
    border: 0;
    background: transparent;
    font: inherit;
    font-size: 0.8125rem;
    padding: 0.65rem 0.75rem;
    cursor: pointer;
    color: var(--ci-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.ci-orchestrator__tabs button.is-active {
    color: var(--ci-ink);
    font-weight: 600;
    border-bottom-color: var(--ci-ink);
}

.ci-orchestrator__body {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 1rem 1.1rem 1.1rem;
}

.ci-orchestrator__col--knowledge {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 18rem;
}

.ci-orchestrator__agent-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(14rem, 18rem);
    gap: 1.25rem;
    align-items: start;
}

.ci-orchestrator__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.ci-agent-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    margin: 0 0 1.1rem;
    font-size: 0.8125rem;
}

.ci-agent-meta div {
    padding: 0.65rem 0.75rem;
    border-radius: 0.55rem;
    border: 1px solid var(--ci-border-soft);
    background: #fafafa;
}

.ci-agent-meta dt {
    margin: 0 0 0.2rem;
    font-size: 0.6875rem;
    color: var(--ci-muted);
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.ci-agent-meta dd {
    margin: 0;
    font-weight: 600;
    letter-spacing: -0.01em;
    word-break: break-all;
}

.ci-orchestrator__embed-label {
    margin: 0 0 0.4rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ci-muted);
}

.ci-orchestrator__embed {
    display: none;
}

.ci-orchestrator__embed-wrap elevenlabs-convai,
.ci-sandbox-live__embed elevenlabs-convai {
    display: none !important;
}

/* Keep ConvAI audio engine off-screen (never fullscreen in CI sidebar) */
.ci-voice-sandbox__engine elevenlabs-convai {
    display: block !important;
    position: fixed !important;
    width: 1px !important;
    height: 1px !important;
    left: -9999px !important;
    top: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    overflow: hidden !important;
    z-index: -1 !important;
}

.ci-sandbox-live,
.ci-sandbox-live__embed {
    display: none !important;
}

.ci-architect__sandbox {
    position: relative;
    overflow: hidden;
    max-width: 100%;
}

/* Voice Architect sidebar */
.ci-architect__head {
    padding: 0.85rem 0.9rem;
}

.ci-architect__brand {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
}

.ci-architect__orb {
    box-shadow: 0 4px 12px rgba(20, 80, 140, 0.22);
}

.ci-liquid-sphere {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    vertical-align: middle;
    isolation: isolate;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.55),
        inset 0 -8px 16px rgba(99, 102, 241, 0.06);
}

.ci-liquid-sphere video {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.ci-liquid-sphere__glass {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    vertical-align: top;
}

.ci-liquid-sphere--xs {
    width: 1.65rem;
    height: 1.65rem;
}

.ci-liquid-sphere--sm {
    width: 2rem;
    height: 2rem;
}

.ci-liquid-sphere--md {
    width: 4.5rem;
    height: 4.5rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
}

.ci-architect__publish {
    border-radius: 999px;
    padding-inline: 0.85rem;
}

.ci-architect .ci-btn--xs {
    padding: 0.35rem 0.65rem;
    font-size: 0.6875rem;
}

.ci-architect__tabs {
    display: flex;
    gap: 0.25rem;
    padding: 0 0.65rem 0;
    margin: 0 0.65rem;
    border-bottom: 1px solid var(--ci-border-soft);
}

.ci-architect__tab {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    margin: 0;
    padding: 0.55rem 0.35rem;
    border: 0;
    border-bottom: 2px solid transparent;
    background: none;
    font: inherit;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--ci-muted);
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.ci-architect__tab i {
    font-size: 0.7rem;
    opacity: 0.75;
}

.ci-architect__tab:hover {
    color: var(--ci-ink);
}

.ci-architect__tab.is-active {
    color: #14508c;
    border-bottom-color: #14508c;
}

.ci-architect__tab.is-active i {
    opacity: 1;
}

.ci-architect__status {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0.5rem 0.85rem 0;
    padding: 0.4rem 0.55rem;
    font-size: 0.6875rem;
    color: #475569;
    border-radius: 0.45rem;
    background: #f8fafc;
    border: 1px solid var(--ci-border-soft);
}

.ci-architect__status-dot {
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 50%;
    background: #22c55e;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.25);
}

.ci-architect__status--hint {
    color: #92400e;
    background: #fffbeb;
    border-color: #fde68a;
}

.ci-architect__status--error {
    color: #991b1b;
    background: #fef2f2;
    border-color: #fecaca;
}

.ci-architect__status--error .ci-architect__status-dot {
    background: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25);
}

.ci-panel__sync--error {
    color: #991b1b;
    background: #fef2f2;
    border-color: #fecaca;
}

.ci-orchestrator-hub {
    flex-shrink: 0;
    margin: 0 0.65rem 0.65rem;
    padding: 0.65rem 0.75rem;
    border-radius: 0.65rem;
    border: 1px solid var(--ci-border-soft);
    background: linear-gradient(180deg, #fafafa 0%, #fff 100%);
}

.ci-orchestrator-hub__title {
    margin: 0 0 0.25rem;
    font-size: 0.6875rem;
    font-weight: 650;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #475569;
}

.ci-orchestrator-hub__sub {
    margin: 0 0 0.5rem;
    font-size: 0.6875rem;
    line-height: 1.45;
    color: #64748b;
}

.ci-orchestrator-hub__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.ci-orchestrator-hub__meta > span {
    font-size: 0.625rem;
    font-weight: 600;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
}

.ci-orchestrator-hub__test {
    margin-left: auto;
    padding: 0.2rem 0.5rem;
    border: 0;
    border-radius: 999px;
    background: #18181b;
    color: #fff;
    font: inherit;
    font-size: 0.625rem;
    font-weight: 650;
    cursor: pointer;
}

.ci-orchestrator-hub__test:hover {
    background: #27272a;
}

.ci-sandbox-kicker {
    margin: 0 0.65rem 0.65rem;
    padding: 0.55rem 0.65rem;
    font-size: 0.6875rem;
    line-height: 1.45;
    color: #64748b;
    border-radius: 0.55rem;
    background: #f8fafc;
    border: 1px solid var(--ci-border-soft);
}

.ci-sandbox-kicker strong {
    color: #334155;
}

.ci-sandbox-kicker__link {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    font-weight: 650;
    color: #2563eb;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.ci-architect__chat {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.ci-architect__thread {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-bottom: 0.5rem;
}

.ci-architect__msg {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    max-width: 100%;
}

.ci-architect__msg-body {
    min-width: 0;
    flex: 1;
    padding: 0.6rem 0.75rem;
    border-radius: 0.75rem;
    font-size: 0.8125rem;
    line-height: 1.55;
    box-shadow: var(--ci-shadow-sm);
}

.ci-architect__msg--architect .ci-architect__msg-body {
    background: #fff;
    border: 1px solid var(--ci-border-soft);
    color: #334155;
}

.ci-architect__msg--you {
    flex-direction: row-reverse;
}

.ci-architect__msg--you .ci-architect__msg-body {
    background: linear-gradient(135deg, #eef2ff, #e0e7ff);
    border: 1px solid #c7d2fe;
    color: #1e293b;
    max-width: 92%;
}

.ci-architect__msg--system .ci-architect__msg-body {
    background: transparent;
    border: none;
    box-shadow: none;
    color: #64748b;
    font-size: 0.6875rem;
    padding: 0.25rem 0.5rem;
    text-align: center;
    width: 100%;
}

.ci-architect__msg-avatar {
    margin-top: 0.35rem;
    box-shadow: 0 2px 8px rgba(20, 80, 140, 0.18);
}

.ci-architect__msg-role {
    display: block;
    margin-bottom: 0.2rem;
    font-size: 0.625rem;
    font-weight: 650;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #94a3b8;
}

.ci-architect__msg p {
    margin: 0;
    white-space: pre-wrap;
}

.ci-architect__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.55rem;
}

.ci-architect__chip {
    padding: 0.3rem 0.55rem;
    border-radius: 999px;
    border: 1px solid var(--ci-border);
    background: #fafafa;
    font: inherit;
    font-size: 0.625rem;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
    transition: background 0.12s ease, border-color 0.12s ease, transform 0.12s ease;
}

.ci-architect__chip:hover {
    background: #fff;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.ci-architect__chip.is-on {
    border-color: #14508c;
    background: rgba(20, 80, 140, 0.08);
    color: #14508c;
}

.ci-architect__composer {
    width: 100%;
    flex-shrink: 0;
    padding: 0.5rem 0.65rem 0.75rem;
    border-top: 1px solid var(--ci-border-soft);
    background: linear-gradient(180deg, transparent, rgba(250, 250, 250, 0.98));
    box-sizing: border-box;
}

.ci-architect__voice-banner {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0 0 0.4rem;
    font-size: 0.625rem;
    font-weight: 600;
    color: #059669;
}

.ci-architect__voice-pulse {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: #22c55e;
    animation: ci-voice-pulse 1.2s ease-in-out infinite;
}

@keyframes ci-voice-pulse {
    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.45;
        transform: scale(0.85);
    }
}

.ci-architect__voice-interim,
.ci-architect__upload-note {
    margin: 0 0 0.35rem;
    font-size: 0.625rem;
    color: var(--ci-muted);
    line-height: 1.35;
}

.ci-architect__composer-field {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    width: 100%;
    min-width: 0;
    padding: 0.3rem 0.3rem 0.3rem 0.45rem;
    border-radius: 0.75rem;
    border: 1px solid var(--ci-border);
    background: #fff;
    box-shadow: var(--ci-shadow-md);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    box-sizing: border-box;
}

.ci-architect__composer-icon {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 1.85rem;
    height: 1.85rem;
    border: 0;
    border-radius: 0.5rem;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease;
}

.ci-architect__composer-icon:hover:not(:disabled) {
    background: #f4f4f5;
    color: var(--ci-ink);
}

.ci-architect__composer-icon.is-active,
.ci-architect__composer-icon.is-live {
    background: #18181b;
    color: #fff;
}

.ci-architect__composer-icon--call.is-live {
    background: #059669;
}

.ci-architect__composer-icon:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.ci-architect__composer-field:focus-within {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12), var(--ci-shadow-md);
}

.ci-architect__composer-field input {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    border: 0;
    background: transparent;
    font: inherit;
    font-size: 0.8125rem;
}

.ci-architect__composer-field input::placeholder {
    color: #a1a1aa;
}

.ci-architect__send {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.85rem;
    height: 1.85rem;
    flex-shrink: 0;
    border: 0;
    border-radius: 50%;
    background: #18181b;
    color: #fff;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.12s ease;
}

.ci-architect__send:hover:not(:disabled) {
    background: #27272a;
    transform: scale(1.04);
}

.ci-architect__send:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.ci-panel__sync {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0 0 0.85rem;
    padding: 0.45rem 0.65rem;
    font-size: 0.75rem;
    color: #166534;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 0.5rem;
}

.ci-panel__sync i {
    color: #22c55e;
}

.ci-architect__controls {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ci-input {
    width: 100%;
    padding: 0.45rem 0.55rem;
    border: 1px solid var(--ci-border);
    border-radius: 0.45rem;
    font: inherit;
    font-size: 0.8125rem;
    background: #fff;
}

.ci-llm-select {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.ci-llm-select__hint {
    margin: 0;
    font-size: 0.625rem;
    color: #94a3b8;
    line-height: 1.35;
}

.ci-architect__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}

.ci-architect__fieldset {
    margin: 0;
    padding: 0.65rem 0 0;
    border: 0;
    border-top: 1px solid var(--ci-border-soft);
}

.ci-architect__fieldset legend {
    padding: 0;
    font-size: 0.6875rem;
    font-weight: 650;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #94a3b8;
}

.ci-architect__check {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0.35rem 0;
    font-size: 0.8125rem;
    color: #334155;
}

.ci-architect__rule {
    margin: 0.35rem 0;
    padding: 0.45rem 0.55rem;
    border-radius: 0.45rem;
    background: #fafafa;
    font-size: 0.75rem;
}

.ci-architect__rule p {
    margin: 0.25rem 0 0;
    color: #64748b;
}

.ci-architect__kb {
    margin: 0.5rem 0 0;
    padding: 0;
    list-style: none;
    font-size: 0.75rem;
}

.ci-architect__kb li {
    padding: 0.35rem 0;
    border-bottom: 1px solid var(--ci-border-soft);
}

.ci-architect__sandbox-label {
    margin: 0 0 0.65rem;
    font-size: 0.6875rem;
    font-weight: 650;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #94a3b8;
}

.ci-sandbox-stage {
    margin-bottom: 0.5rem;
}

.ci-sandbox-modal {
    position: relative;
    padding: 1.15rem 1rem 1rem;
    border-radius: 0.85rem;
    border: 1px solid var(--ci-border-soft);
    background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
    text-align: center;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
}

.ci-sandbox-modal__title {
    margin: 0 0 0.65rem;
    font-size: 0.6875rem;
    font-weight: 650;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
}

.ci-sandbox-modal__live {
    margin: 0 0 0.35rem;
    font-size: 0.625rem;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #15803d;
}

.ci-sandbox-modal__status {
    margin: 0 0 0.35rem;
    font-size: 0.6875rem;
    font-weight: 600;
    color: #14508c;
}

.ci-sandbox-modal__close {
    position: absolute;
    top: 0.45rem;
    right: 0.55rem;
    width: 1.5rem;
    height: 1.5rem;
    border: 0;
    border-radius: 0.35rem;
    background: #f4f4f5;
    font-size: 0.875rem;
    line-height: 1;
    color: #94a3b8;
    cursor: default;
    pointer-events: none;
}

.ci-sandbox-orb {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 0.75rem;
}

.ci-sandbox-orb .ci-liquid-sphere--md,
.ci-voice-sandbox__orb .ci-liquid-sphere--md {
    width: 4.5rem;
    height: 4.5rem;
}

.ci-sandbox-modal__action {
    margin: 0 0 0.25rem;
    font-weight: 650;
    font-size: 0.9375rem;
    letter-spacing: -0.02em;
    color: #0f172a;
}

.ci-sandbox-modal__character {
    margin: 0 0 0.45rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #475569;
}

.ci-sandbox-modal__tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem;
    list-style: none;
    margin: 0 0 0.35rem;
    padding: 0;
}

.ci-sandbox-modal__tags li {
    font-size: 0.625rem;
    font-weight: 600;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
}

.ci-sandbox-modal__meta {
    margin: 0 0 0.5rem;
    font-size: 0.6875rem;
    color: #94a3b8;
}

.ci-sandbox-modal__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: center;
    margin-top: 0.65rem;
}

.ci-sandbox-flags {
    list-style: none;
    margin: 0.85rem 0 0;
    padding: 0.55rem 0.6rem;
    border-radius: 0.55rem;
    background: #fff;
    border: 1px solid var(--ci-border-soft);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    text-align: left;
    font-size: 0.6875rem;
}

.ci-sandbox-flags li {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.5rem;
}

.ci-sandbox-flags__k {
    flex-shrink: 0;
    font-size: 0.5625rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #94a3b8;
    min-width: 4.5rem;
}

.ci-sandbox-flags__v {
    color: #334155;
    line-height: 1.35;
    word-break: break-word;
}

.ci-voice-sandbox {
    margin-top: 0.75rem;
    padding: 0.75rem;
    border: 1px solid var(--ci-border-soft);
    border-radius: 0.65rem;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}

.ci-voice-sandbox__secure {
    margin: 0 0 0.65rem;
    font-size: 0.625rem;
    color: var(--ci-muted);
    line-height: 1.4;
}

.ci-voice-sandbox--controls-only {
    margin-top: 0.65rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--ci-border-soft);
}

.ci-voice-sandbox--controls-only .ci-voice-sandbox__toolbar {
    justify-content: center;
}

.ci-voice-sandbox__stage {
    text-align: center;
    padding: 0.5rem 0 0.75rem;
}

.ci-voice-sandbox__orb {
    display: flex;
    justify-content: center;
    margin: 0 auto 0.5rem;
}

.ci-voice-sandbox__name {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
}

.ci-voice-sandbox__status {
    margin: 0.25rem 0 0;
    font-size: 0.75rem;
    color: var(--ci-muted);
}

.ci-voice-sandbox__status.is-live {
    color: #059669;
    font-weight: 600;
}

.ci-voice-sandbox__attach {
    margin: 0.35rem 0 0;
    font-size: 0.6875rem;
    color: #334155;
}

.ci-voice-sandbox__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 0.15rem;
    padding: 0.45rem 0.55rem;
    border-radius: 999px;
    background: #f4f6f8;
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.ci-voice-sandbox__ctrl {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: #fff;
    color: #334155;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.ci-voice-sandbox__ctrl:hover:not(:disabled) {
    color: #0f172a;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
}

.ci-voice-sandbox__ctrl:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.ci-voice-sandbox__ctrl.is-active {
    background: #e8f1ff;
    color: #14508c;
    box-shadow: none;
}

.ci-voice-sandbox__ctrl--primary {
    background: #059669;
    color: #fff;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.35);
}

.ci-voice-sandbox__ctrl--primary:hover:not(:disabled) {
    background: #047857;
    color: #fff;
}

.ci-voice-sandbox__ctrl--end {
    color: #b91c1c;
}

.ci-voice-sandbox__ctrl--end:hover:not(:disabled) {
    background: #fef2f2;
    color: #991b1b;
}

.ci-voice-sandbox__ctrl:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
}

.ci-voice-sandbox__file {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.ci-voice-sandbox__engine {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.ci-workspace__primary:has(#ci-knowledge),
.ci-workspace__primary:has(#ci-agent) {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding-bottom: 0.75rem;
    overflow: hidden;
}

.ci-panel--agent {
    flex: 1;
    min-height: 0;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#ci-agent .ci-panel__head,
#ci-agent .ci-agent-meta,
#ci-agent .ci-panel__sync {
    flex-shrink: 0;
}

#ci-agent .ci-agent-meta {
    margin-bottom: 0.85rem;
}

#ci-agent .ci-editor-grid {
    flex: 1;
    min-height: 0;
    align-items: stretch;
}

#ci-agent .ci-editor-grid .ci-field {
    display: flex;
    flex-direction: column;
    min-height: 0;
    margin: 0;
}

#ci-agent .ci-editor-grid .ci-field > span {
    flex-shrink: 0;
    margin-bottom: 0.45rem;
    font-size: 0.8125rem;
    font-weight: 600;
}

#ci-agent .ci-editor-grid .ci-textarea {
    flex: 1;
    min-height: 5rem;
    resize: none;
}

.ci-panel--kb {
    flex: 1;
    min-height: 0;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ci-kb-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    flex-shrink: 0;
}

.ci-kb-head .ci-panel__sub {
    margin: 0.2rem 0 0;
}

.ci-kb-head__actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ci-kb-count {
    font-size: 0.6875rem;
    font-weight: 650;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    background: #f4f4f5;
    color: #52525b;
}

.ci-panel--kb .ci-panel__sync {
    flex-shrink: 0;
    margin-bottom: 0.65rem;
}

.ci-kb-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.65rem;
    flex-shrink: 0;
}

.ci-kb-toolbar__add {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.ci-kb-action {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.65rem;
    border: 1px solid var(--ci-border);
    border-radius: 0.5rem;
    background: #fff;
    font: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
    transition: background 0.12s ease, border-color 0.12s ease;
}

.ci-kb-action:hover:not(:disabled) {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.ci-kb-action:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ci-kb-search {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-left: auto;
    flex: 1;
    min-width: min(100%, 14rem);
    max-width: 22rem;
}

.ci-kb-search__icon {
    color: #94a3b8;
    font-size: 0.8125rem;
}

.ci-kb-search input {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--ci-border);
    border-radius: 0.5rem;
    padding: 0.4rem 0.55rem;
    font: inherit;
    font-size: 0.8125rem;
}

.ci-btn--sm {
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
}

.ci-btn--danger {
    color: #b91c1c;
}

.ci-kb-split {
    display: grid;
    grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
    gap: 1rem;
    flex: 1;
    min-height: 0;
}

.ci-kb-list-pane {
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
}

.ci-kb-list-pane__label {
    margin: 0 0 0.4rem;
    font-size: 0.625rem;
    font-weight: 650;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ci-muted);
    flex-shrink: 0;
}

.ci-kb-list {
    list-style: none;
    margin: 0;
    padding: 0.35rem;
    border: 1px solid var(--ci-border-soft);
    border-radius: 0.65rem;
    background: #fafafa;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.ci-kb-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    width: 100%;
    padding: 0.55rem 0.6rem;
    margin-bottom: 0.25rem;
    border: 1px solid transparent;
    border-radius: 0.5rem;
    background: #fff;
    cursor: pointer;
    font: inherit;
    font-size: 0.8125rem;
    text-align: left;
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.ci-kb-item:last-child {
    margin-bottom: 0;
}

.ci-kb-item:hover {
    border-color: #e2e8f0;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.ci-kb-item.is-selected {
    border-color: #818cf8;
    background: linear-gradient(180deg, #eef2ff 0%, #fff 100%);
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.12);
}

.ci-kb-item__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.5625rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 0.12rem 0.35rem;
    border-radius: 0.25rem;
}

.ci-kb-item__badge--text {
    background: #e0e7ff;
    color: #3730a3;
}

.ci-kb-item__badge--url {
    background: #dbeafe;
    color: #1d4ed8;
}

.ci-kb-item__badge--file {
    background: #fef3c7;
    color: #92400e;
}

.ci-kb-item__name {
    font-weight: 600;
    color: #0f172a;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ci-kb-item__meta {
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
}

.ci-kb-empty {
    margin: 0;
    padding: 1.25rem 0.75rem;
    text-align: center;
    color: var(--ci-muted);
    font-size: 0.8125rem;
    line-height: 1.45;
}

.ci-kb-editor {
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    border: 1px solid var(--ci-border-soft);
    border-radius: 0.65rem;
    background: #fff;
    overflow: hidden;
}

.ci-kb-editor__placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    padding: 2rem 1.5rem;
    text-align: center;
    color: var(--ci-muted);
    font-size: 0.875rem;
    min-height: 12rem;
}

.ci-kb-editor__placeholder i {
    font-size: 1.75rem;
    opacity: 0.35;
}

.ci-kb-editor__form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    padding: 0.85rem 1rem 1rem;
    gap: 0.65rem;
}

.ci-kb-editor__top {
    flex-shrink: 0;
}

.ci-field--grow {
    flex: 0 0 auto;
}

.ci-kb-editor__url {
    margin: 0.35rem 0 0;
    font-size: 0.75rem;
    color: var(--ci-muted);
    word-break: break-all;
}

.ci-kb-editor__url a {
    color: #2563eb;
}

.ci-kb-editor__content {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.ci-textarea--kb {
    flex: 1;
    min-height: 10rem;
    resize: none;
}

.ci-kb-editor__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    flex-shrink: 0;
    padding-top: 0.25rem;
    border-top: 1px solid var(--ci-border-soft);
}

.ci-kb-editor[hidden],
.ci-kb-empty[hidden] {
    display: none !important;
}

.ci-kb-editor__hint {
    margin: 0;
    font-size: 0.75rem;
}

.ci-kb-search-results {
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid var(--ci-border-soft);
    border-radius: 0.5rem;
    max-height: 8rem;
    overflow: auto;
}

.ci-kb-search-results[hidden] {
    display: none !important;
}

.ci-kb-search-results li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.45rem 0.65rem;
    font-size: 0.8125rem;
    border-bottom: 1px solid var(--ci-border-soft);
}

.ci-recording-item {
    cursor: pointer;
    padding: 0.5rem 0.65rem;
    border-bottom: 1px solid var(--ci-border-soft);
    font-size: 0.8125rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.ci-recording-detail {
    margin-top: 0.75rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    background: #f4f4f5;
    font-size: 0.75rem;
    max-height: 12rem;
    overflow: auto;
}

/* Live agent drilldown */
.ci-drilldown__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    margin: 0 0 1rem;
    font-size: 0.8125rem;
}

.ci-drilldown__grid div {
    padding: 0.55rem 0.65rem;
    border-radius: 0.55rem;
    border: 1px solid var(--ci-border-soft);
    background: #fafafa;
}

.ci-drilldown__grid dt {
    margin: 0 0 0.15rem;
    font-size: 0.625rem;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ci-muted);
}

.ci-drilldown__grid dd {
    margin: 0;
    word-break: break-word;
}

.ci-drilldown__block {
    margin-bottom: 1rem;
}

.ci-drilldown__heading {
    margin: 0 0 0.45rem;
    font-size: 0.8125rem;
    font-weight: 650;
}

.ci-drilldown__list {
    margin: 0;
    padding-left: 1.1rem;
    font-size: 0.8125rem;
    color: #334155;
}

.ci-drilldown__mini {
    display: grid;
    gap: 0.45rem;
    margin: 0;
    font-size: 0.8125rem;
}

.ci-drilldown__mini div {
    display: grid;
    grid-template-columns: 6rem minmax(0, 1fr);
    gap: 0.5rem;
}

.ci-drilldown__mini dt {
    margin: 0;
    color: var(--ci-muted);
    font-weight: 600;
}

.ci-drilldown__mini dd {
    margin: 0;
}

.ci-drilldown__swatch {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    margin-right: 0.35rem;
    vertical-align: middle;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.ci-drilldown__truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ci-drilldown__kb {
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid var(--ci-border-soft);
    border-radius: 0.55rem;
    overflow: hidden;
}

.ci-drilldown__kb li {
    padding: 0.5rem 0.65rem;
    border-bottom: 1px solid var(--ci-border-soft);
    font-size: 0.8125rem;
}

.ci-drilldown__kb li:last-child {
    border-bottom: 0;
}

.ci-drilldown__kb strong {
    display: block;
}

.ci-drilldown__kb span {
    font-size: 0.6875rem;
    color: var(--ci-muted);
}

.ci-drilldown__prompt {
    margin-bottom: 0.65rem;
    font-size: 0.8125rem;
}

.ci-drilldown__prompt summary {
    cursor: pointer;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.ci-drilldown__prompt pre {
    margin: 0;
    padding: 0.65rem;
    border-radius: 0.5rem;
    background: #f4f4f5;
    font-size: 0.6875rem;
    white-space: pre-wrap;
    max-height: 12rem;
    overflow: auto;
}

/* Conversations — playback, insights, improve */
.ci-conv__layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.15rem;
    align-items: start;
}

@media (min-width: 1060px) {
    .ci-conv__layout {
        grid-template-columns: minmax(0, 1fr) minmax(17rem, 22rem);
    }
}

.ci-conv__list {
    min-width: 0;
}

.ci-conv__list-empty {
    margin: 0;
    padding: 1.25rem 1rem;
    border: 1px dashed var(--ci-border);
    border-radius: var(--ci-radius);
    font-size: 0.8125rem;
    color: var(--ci-muted);
    line-height: 1.5;
    text-align: center;
    background: #fafafa;
}

.ci-conv__sessions {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.ci-conv__session {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 0.7rem;
    border: 1px solid var(--ci-border-soft);
    border-radius: 0.65rem;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.ci-conv__session:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

.ci-conv__session.is-selected {
    border-color: #818cf8;
    background: linear-gradient(180deg, #eef2ff 0%, #fff 100%);
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.15);
}

.ci-conv__session:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.ci-conv__session-body {
    flex: 1 1 auto;
    min-width: 0;
}

.ci-conv__session-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    margin-bottom: 0.3rem;
}

.ci-conv__session-time {
    font-size: 0.8125rem;
    font-weight: 650;
    color: var(--ci-ink);
    letter-spacing: -0.01em;
    line-height: 1.25;
}

.ci-conv__session-latest {
    flex-shrink: 0;
    font-size: 0.5625rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.1rem 0.35rem;
    border-radius: 0.25rem;
    background: #dbeafe;
    color: #1d4ed8;
}

.ci-conv__session.is-selected .ci-conv__session-latest {
    background: #c7d2fe;
    color: #3730a3;
}

.ci-conv__session-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.45rem;
}

.ci-conv__session-duration {
    font-size: 0.6875rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    padding: 0.1rem 0.4rem;
    border-radius: 0.25rem;
    background: #f1f5f9;
    color: #475569;
}

.ci-conv__session-id {
    font-size: 0.625rem;
    color: #64748b;
    font-family: ui-monospace, monospace;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ci-conv__status {
    font-size: 0.625rem;
    font-weight: 650;
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
    text-transform: lowercase;
    white-space: nowrap;
}

.ci-conv__status--done {
    background: #dcfce7;
    color: #15803d;
}

.ci-conv__status--fail {
    background: #fee2e2;
    color: #b91c1c;
}

.ci-conv__status--live {
    background: #dbeafe;
    color: #1d4ed8;
}

.ci-conv__status--neu {
    background: #f4f4f5;
    color: #52525b;
}

.ci-conv__play {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #18181b;
    color: #fff;
    cursor: pointer;
    transition: transform 0.12s ease, background 0.12s ease;
}

.ci-conv__play:hover {
    background: #27272a;
    transform: scale(1.06);
}

.ci-conv__detail {
    min-width: 0;
    padding: 1rem;
    border: 1px solid var(--ci-border-soft);
    border-radius: var(--ci-radius);
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
    box-shadow: var(--ci-shadow-sm, 0 1px 2px rgba(15, 23, 42, 0.04));
}

@media (min-width: 1060px) {
    .ci-conv__detail {
        position: sticky;
        top: 0.75rem;
        max-height: calc(100dvh - 7rem);
        overflow-y: auto;
    }
}

.ci-conv__error {
    margin: 0 0 1rem;
    padding: 0.75rem 0.85rem;
    border-radius: 0.55rem;
    border: 1px solid #fecaca;
    background: #fef2f2;
    font-size: 0.8125rem;
    color: #991b1b;
}

.ci-conv__error strong {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ci-conv__error p {
    margin: 0;
    line-height: 1.45;
}

.ci-conv__empty {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.5;
}

.ci-conv__detail-head {
    margin-bottom: 1rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--ci-border-soft);
}

.ci-conv__detail-kicker {
    margin: 0 0 0.2rem;
    font-size: 0.625rem;
    font-weight: 650;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ci-muted);
}

.ci-conv__detail-title {
    margin: 0 0 0.35rem;
    font-size: 1rem;
    font-weight: 650;
    letter-spacing: -0.02em;
}

.ci-conv__detail-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 0.75rem;
    color: var(--ci-muted);
}

.ci-conv__player {
    margin-bottom: 1rem;
}

.ci-conv__player-label {
    margin: 0 0 0.35rem;
    font-size: 0.6875rem;
    font-weight: 650;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ci-muted);
}

.ci-conv__audio {
    width: 100%;
    height: 2.25rem;
}

.ci-conv__player-cost {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 0.4rem;
    margin: 0.4rem 0 0;
    font-size: 0.6875rem;
    color: #64748b;
    letter-spacing: -0.01em;
}

.ci-conv__player-cost-total {
    font-weight: 600;
    color: #334155;
}

.ci-conv__player-cost-sep {
    color: #cbd5e1;
    font-weight: 400;
}

.ci-conv__player-cost-split {
    flex-basis: 100%;
    font-size: 0.625rem;
    color: #94a3b8;
}

.ci-conv__section-title {
    margin: 0 0 0.5rem;
    font-size: 0.8125rem;
    font-weight: 650;
    letter-spacing: -0.02em;
}

.ci-conv__insight-bullets {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ci-conv__insight-bullet {
    padding: 0.5rem 0.6rem;
    border-radius: 0.5rem;
    background: #fff;
    border: 1px solid var(--ci-border-soft);
    font-size: 0.75rem;
}

.ci-conv__insight-bullet-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.5rem;
    line-height: 1.4;
}

.ci-conv__insight-bullet-row::before {
    content: "•";
    color: #6366f1;
    font-weight: 700;
    flex-shrink: 0;
}

.ci-conv__insight-bullet-label {
    font-size: 0.625rem;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ci-muted);
    flex-shrink: 0;
}

.ci-conv__insight-bullet-brief {
    flex: 1 1 auto;
    min-width: 0;
    color: #334155;
}

.ci-conv__insight-more {
    margin: 0.35rem 0 0 0.85rem;
    font-size: 0.6875rem;
}

.ci-conv__insight-more summary {
    cursor: pointer;
    color: #2563eb;
    font-weight: 600;
    list-style: none;
    user-select: none;
}

.ci-conv__insight-more summary::-webkit-details-marker {
    display: none;
}

.ci-conv__insight-more summary::before {
    content: "+ ";
    font-weight: 700;
}

.ci-conv__insight-more[open] summary::before {
    content: "− ";
}

.ci-conv__insight-more-body {
    margin: 0.35rem 0 0;
    padding: 0.45rem 0.55rem;
    border-radius: 0.4rem;
    background: #f8fafc;
    color: #475569;
    line-height: 1.5;
    white-space: pre-wrap;
}

.ci-conv__eval-badge {
    display: inline-block;
    margin-right: 0.35rem;
    padding: 0.1rem 0.35rem;
    border-radius: 999px;
    font-size: 0.625rem;
    font-weight: 650;
    text-transform: uppercase;
}

.ci-conv__eval-badge--success {
    background: #dcfce7;
    color: #15803d;
}

.ci-conv__eval-badge--failure {
    background: #fee2e2;
    color: #b91c1c;
}

.ci-conv__eval-badge--unknown {
    background: #f4f4f5;
    color: #52525b;
}

.ci-conv__improve {
    margin-bottom: 1rem;
}

.ci-conv__improve-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ci-conv__improve-item {
    padding: 0.55rem 0.65rem;
    border-radius: 0.55rem;
    background: #fff;
    border: 1px solid var(--ci-border-soft);
    font-size: 0.75rem;
}

.ci-conv__improve-item strong {
    display: block;
    margin-bottom: 0.2rem;
    font-size: 0.8125rem;
}

.ci-conv__improve-item p {
    margin: 0;
    line-height: 1.45;
    color: #475569;
}

.ci-conv__improve-tag {
    display: inline-block;
    margin-bottom: 0.25rem;
    padding: 0.1rem 0.35rem;
    border-radius: 0.25rem;
    font-size: 0.625rem;
    font-weight: 650;
    text-transform: uppercase;
    background: #e0e7ff;
    color: #3730a3;
}

.ci-conv__improve-item--voice .ci-conv__improve-tag {
    background: #fce7f3;
    color: #9d174d;
}

.ci-conv__improve-item--rag .ci-conv__improve-tag {
    background: #fef3c7;
    color: #92400e;
}

.ci-conv__transcript-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 14rem;
    overflow-y: auto;
    font-size: 0.75rem;
}

.ci-conv__turn {
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--ci-border-soft);
}

.ci-conv__turn-meta {
    display: block;
    font-size: 0.625rem;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
    margin-bottom: 0.15rem;
}

.ci-conv__turn--user .ci-conv__turn-meta {
    color: #4338ca;
}

.ci-conv__turn p {
    margin: 0;
    line-height: 1.45;
}

@media (max-width: 720px) {
    .ci-orchestrator__agent-grid,
    .ci-kb-split {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(8rem, 35vh) minmax(0, 1fr);
    }

    .ci-kb-search {
        margin-left: 0;
        max-width: none;
    }
}

.ci-preview__mode {
    border: 0;
    background: transparent;
    font: inherit;
    font-size: 0.75rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    cursor: pointer;
    color: var(--ci-muted);
}

.ci-preview__mode.is-active {
    background: #f4f4f5;
    color: var(--ci-ink);
    font-weight: 600;
}

.ci-switch--sm {
    margin: 0 0.35rem 0 auto;
    font-size: 0.6875rem;
}

.ci-widget {
    width: min(20rem, 88vw);
    border-radius: 1rem;
    border: 1px solid var(--ci-border);
    background: #fff;
    box-shadow: 0 24px 64px -28px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}

.ci-widget__chrome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 0.65rem;
    border-bottom: 1px solid var(--ci-border-soft);
}

.ci-widget__orb {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    background: conic-gradient(from 120deg, #c4b5fd, #93c5fd, #fbcfe8, #c4b5fd);
}

.ci-widget__body {
    padding: 1.25rem 1rem;
    min-height: 8rem;
    font-size: 0.9375rem;
    line-height: 1.5;
}

.ci-widget__input {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.85rem;
    border-top: 1px solid var(--ci-border-soft);
    color: #a1a1aa;
    font-size: 0.8125rem;
}

.ci-widget__call {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border: 0;
    background: #18181b;
    color: #fff;
    cursor: pointer;
}

/* PIN gate */
.ci-access {
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.25rem;
    background: linear-gradient(180deg, #fafafa, #f4f4f5);
}

.ci-access__card {
    width: min(24rem, 100%);
    padding: 2rem 1.75rem;
    border-radius: 1rem;
    border: 1px solid var(--ci-border);
    background: #fff;
    box-shadow: 0 24px 60px -32px rgba(0, 0, 0, 0.12);
}

.ci-access__eyebrow {
    margin: 0 0 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ci-muted);
}

.ci-access__title {
    margin: 0 0 0.35rem;
    font-size: 1.75rem;
    letter-spacing: -0.03em;
}

.ci-access__sub {
    margin: 0 0 1.25rem;
    color: var(--ci-muted);
    font-size: 0.9375rem;
}

.ci-access__label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.ci-access__input {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border-radius: 0.65rem;
    border: 1px solid var(--ci-border);
    font: inherit;
    letter-spacing: 0.2em;
    text-align: center;
}

.ci-access__input:focus {
    outline: 2px solid rgba(37, 99, 235, 0.25);
    border-color: #93c5fd;
}

.ci-access__error {
    margin: 0.35rem 0 0;
    font-size: 0.8125rem;
    color: #dc2626;
}

.ci-access__btn {
    width: 100%;
    margin-top: 1rem;
    padding: 0.7rem 1rem;
    border: 0;
    border-radius: 999px;
    background: #18181b;
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.ci-access__hint {
    margin: 1rem 0 0;
    font-size: 0.8125rem;
    color: var(--ci-muted);
    text-align: center;
}

.ci-access__hint a {
    color: var(--ci-accent);
}

.scroll {
    scrollbar-width: thin;
}

@media (max-width: 1200px) {
    :root {
        --ci-assistant-w: 18rem;
    }

    .ci-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 991px) {
    .ci-app {
        grid-template-columns: minmax(0, 1fr);
    }

    .ci-nav {
        position: fixed;
        z-index: 50;
        left: 0;
        top: 0;
        bottom: 0;
        width: var(--ci-nav-w);
        transform: translateX(-110%);
        transition: transform 0.2s ease;
        box-shadow: 8px 0 32px -12px rgba(0, 0, 0, 0.15);
    }

    .ci-app.ci-nav-open .ci-nav {
        transform: translateX(0);
    }

    .ci-topbar__menu {
        display: inline-flex;
    }

    .ci-workspace {
        grid-template-columns: minmax(0, 1fr);
    }

    .ci-assistant {
        display: none;
    }

    .ci-editor-grid {
        grid-template-columns: 1fr;
    }

    #ci-agent .ci-editor-grid {
        grid-template-rows: minmax(0, 1fr) minmax(5.5rem, auto);
    }

    .ci-topbar__actions .ci-btn--ghost:not(:last-of-type) {
        display: none;
    }
}

@media (max-width: 640px) {
    .ci-topbar__search kbd {
        display: none;
    }

    .ci-topbar__search {
        max-width: none;
    }
}
