/* Guided Setup Container */
.guided-setup-container {
    position: relative;
    width: 100%;
    background: #000;
    color: #fff;
}

/* Intro Scene — overview cards */
.bg-grad-intro {
    justify-content: center;
    align-items: center;
    background: #09090f;
    padding: 80px 24px 200px;
}

/* Voice Scene — push down for spacing from intro */
.bg-grad-1 {
    margin-top: 150px;
}

/* Common Scene Layout */
.setup-scene {
    height: 100vh;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
    box-sizing: border-box;
    /* Use sticky/fixed positioning via GSAP, but default layout: */
    position: relative;
    border-bottom: 1px solid #111;
}

.scene-container {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: space-between;
}

#scene-voice-content,
#scene-knowledge-content {
    width: 100%;
    flex: 1 1 auto;
    display: flex;
}

#scene-voice-content {
    max-width: 1420px;
    margin: 0 auto;
    align-items: center;
}

#scene-knowledge-content {
    max-width: 1460px;
    margin: 0 auto;
    align-items: stretch;
}

.scene-container--knowledge-flow {
    align-items: flex-start;
}

.scene-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem;
    z-index: 60;
    /* Above Orb (z-index 50) to ensure draggable items are clickable */
}

.scene-container--knowledge-flow .scene-panel,
.scene-container--knowledge-flow .knowledge-panel,
.scene-container--knowledge-flow .wf-right-panel {
    justify-content: flex-start;
}

.left-panel {
    align-items: flex-start;
    max-width: 35%;
}

.right-panel {
    align-items: flex-end;
    max-width: 35%;
    text-align: right;
}

/* Combined Knowledge + Workflow scene */
.setup-scene--knowledge-flow {
    height: auto;
    min-height: 100vh;
    padding-top: clamp(48px, 8vh, 96px);
    padding-bottom: clamp(48px, 8vh, 96px);
}

.scene-container--knowledge-flow {
    height: auto;
    min-height: min(760px, calc(100vh - 8rem));
    gap: clamp(48px, 6vw, 120px);
    align-items: flex-start;
    padding-top: clamp(2rem, 4vh, 4rem);
}

.knowledge-panel {
    flex: 0 0 min(31vw, 560px);
    width: min(31vw, 560px);
    max-width: min(31vw, 560px);
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
}

.wf-right-panel.knowledge-workflow-panel {
    flex: 0 0 min(44vw, 760px);
    width: min(44vw, 760px);
    max-width: 760px;
    margin-left: 0;
    margin-right: 0;
    padding: 0;
    gap: 10px;
}

.knowledge-panel-topline {
    margin-bottom: 0.9rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(0, 240, 255, 0.72);
}

.knowledge-panel-note {
    margin: -0.6rem 0 1rem;
    color: #7a7f92;
    font-size: 0.88rem;
    line-height: 1.6;
}

.knowledge-panel-note--workflow {
    margin-bottom: 0.9rem;
}

.knowledge-panel-status {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 1.2rem;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #d8dbe8;
    font-size: 0.82rem;
}

.knowledge-panel-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #2bffb4;
    box-shadow: 0 0 12px rgba(43, 255, 180, 0.45);
}

.knowledge-doc-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
}

.knowledge-doc-grid .doc-card {
    padding: 0;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: default;
}

.knowledge-doc-grid .doc-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.knowledge-doc-card-content {
    width: 100%;
    padding: 1rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
}

.knowledge-doc-icon {
    display: flex;
    align-items: center;
    gap: 6px;
}

.knowledge-doc-tag {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 2px 6px;
    border-radius: 4px;
    background: currentColor;
    -webkit-background-clip: unset;
    background-clip: unset;
    -webkit-text-fill-color: #000;
    color: inherit;
    opacity: 0.85;
}

.knowledge-doc-grid .doc-label {
    flex: 1;
    min-width: 0;
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.3;
    text-align: right;
    overflow-wrap: anywhere;
    word-break: normal;
    color: #d8dbe8;
}

.knowledge-empty-state {
    margin-top: 1rem;
    padding: 1rem 1.1rem;
    border-radius: 16px;
    border: 1px dashed rgba(255, 255, 255, 0.12);
    color: #7a7f92;
    line-height: 1.6;
    font-size: 0.88rem;
}

.knowledge-base-dropzone {
    width: 100%;
    margin: 0.3rem 0 0.9rem;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    border: 1px dashed rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.knowledge-base-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.knowledge-base-title {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.78);
}

.knowledge-base-count {
    font-size: 0.78rem;
    color: #7a7f92;
}

.knowledge-base-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    max-height: 220px;
    overflow: auto;
    padding-right: 0.2rem;
}

.knowledge-base-chip {
    width: 100%;
    padding: 0;
    gap: 0;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

.knowledge-base-chip-content {
    padding: 0.75rem 0.8rem;
}

.knowledge-base-chip .doc-label {
    flex: 1;
    min-width: 0;
    font-size: 0.82rem;
    line-height: 1.2;
    text-align: left;
    overflow-wrap: anywhere;
}

.knowledge-chip-remove {
    width: 28px;
    height: 28px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: #cfd3e4;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.knowledge-chip-remove:hover {
    background: rgba(255, 91, 87, 0.14);
    border-color: rgba(255, 91, 87, 0.35);
    color: #ff8c88;
}

.knowledge-base-empty {
    color: #7a7f92;
    line-height: 1.6;
    font-size: 0.88rem;
}

.knowledge-story-bridge {
    margin-bottom: 0.8rem;
    padding: 0.9rem 1rem;
    border-left: 1px solid rgba(0, 240, 255, 0.4);
    background: linear-gradient(90deg, rgba(0, 240, 255, 0.08), rgba(0, 240, 255, 0));
    color: #cfd3e4;
    font-size: 0.9rem;
    line-height: 1.6;
}

.knowledge-workflow-panel .wf-button-panel {
    gap: 8px;
    margin-bottom: 12px;
}

.knowledge-workflow-panel .wf-add-btn {
    padding: 9px 14px;
    font-size: 0.82rem;
}

.knowledge-workflow-panel .workflow-canvas-wrapper {
    height: min(44vh, 360px);
}

@media (max-width: 1500px) {
    .knowledge-doc-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Typography */
.setup-scene h3 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #fff, #888);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.scene-subtitle {
    font-size: 1rem;
    color: #888;
    margin-bottom: 2rem;
}

.draggable-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8rem;
    width: 100%;
}

.draggable-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

.voice-card,
.doc-card,
.node-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: grab;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
    user-select: none;
}

/* Scene 2 Doc Cards — Compact for 3-col grid */
.scene-connect-panel .doc-card {
    max-width: none;
    width: 100%;
    padding: 0.7rem 0.6rem;
    gap: 0.5rem;
    font-size: 0.75rem;
    flex-direction: column;
    text-align: center;
    border-radius: 10px;
}

.voice-card:hover,
.doc-card:hover,
.node-card:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.voice-icon,
.doc-icon {
    font-size: 1.5rem;
}

.voice-info {
    display: flex;
    flex-direction: column;
}

.voice-label,
.doc-label,
.node-label {
    font-weight: 500;
}

.voice-duration {
    font-size: 0.8rem;
    color: #666;
}

/* Right Panel Previews */
.preview-box,
.connected-box,
.flow-canvas-preview {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #333;
    border-radius: 16px;
    padding: 1.5rem;
    width: 100%;
    backdrop-filter: blur(10px);
}

.preview-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #00ff9d;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #00ff9d;
    border-radius: 50%;
    box-shadow: 0 0 10px #00ff9d;
}

.mini-player {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.play-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
}

.waveform-line {
    flex: 1;
    height: 2px;
    background: #333;
    position: relative;
    overflow: hidden;
}

.waveform-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    background: #00ff9d;
    animation: progress 2s infinite linear;
}

@keyframes progress {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(200%);
    }
}

.transcript-text {
    font-style: italic;
    color: #bbb;
    line-height: 1.5;
}

.success-badge {
    margin-top: 1rem;
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(0, 255, 157, 0.1);
    color: #00ff9d;
    border-radius: 20px;
    font-size: 0.85rem;
}

/* Scene 3 Workflow */
.draggable-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.flow-connections {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.flow-step {
    padding: 0.5rem 1rem;
    border: 1px solid #333;
    border-radius: 8px;
    background: #111;
    color: #666;
    width: 80%;
    text-align: center;
    transition: all 0.3s;
}

.flow-step.active {
    border-color: #00f0ff;
    color: #00f0ff;
    background: rgba(0, 240, 255, 0.1);
}

.flow-step.start,
.flow-step.end {
    border-radius: 20px;
    font-size: 0.8rem;
    background: #222;
}

.api-badge {
    display: block;
    font-size: 0.7rem;
    color: #00ff9d;
    margin-top: 2px;
}

/* Voice Scene Specifics */
.voice-selection-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
}

.upload-voice-container {
    width: 100%;
}

.upload-voice-btn {
    width: 100%;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.upload-voice-btn:hover {
    background: transparent;
}

.upload-icon-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #00f0ff;
}

.sc-wave-anim {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 16px;
}

.sc-wave-anim span {
    display: block;
    width: 2px;
    background: #00f0ff;
    animation: wave 1s infinite ease-in-out;
}

.sc-wave-anim span:nth-child(1) {
    height: 60%;
    animation-delay: 0s;
}

.sc-wave-anim span:nth-child(2) {
    height: 100%;
    animation-delay: 0.1s;
}

.sc-wave-anim span:nth-child(3) {
    height: 50%;
    animation-delay: 0.2s;
}

.sc-wave-anim span:nth-child(4) {
    height: 80%;
    animation-delay: 0.3s;
}

.sc-wave-anim span:nth-child(5) {
    height: 40%;
    animation-delay: 0.4s;
}

@keyframes wave {

    0%,
    100% {
        transform: scaleY(0.5);
    }

    50% {
        transform: scaleY(1);
    }
}

.upload-label {
    font-weight: 700;
    letter-spacing: 1.5px;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: #00f0ff;
    transition: all 0.25s ease;
}

.voice-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8rem;
}

.voice-card-compact {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0.7rem 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: grab;
    transition: background 0.25s ease, opacity 0.25s ease;
    position: relative;
    text-align: center;
}

.voice-card-compact:hover {
    background: rgba(255, 255, 255, 0.05);
}

.voice-card-compact:hover .voice-label-compact {
    opacity: 1;
}

.voice-label-compact {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    opacity: 0.85;
    transition: all 0.25s ease;
}

.placeholder-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    opacity: 0.6;
}

.placeholder-icon {
    font-size: 3rem;
    animation: float 3s infinite ease-in-out;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Responsive */
@media (max-width: 768px) {
    #scene-voice-content,
    #scene-knowledge-content {
        max-width: 100%;
        margin: 0;
    }

    .voice-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .setup-scene {
        flex-direction: column;
        justify-content: center;
        padding-top: 5rem;
        height: auto;
        min-height: 100vh;
        padding-bottom: 4rem;
    }

    .bg-grad-intro {
        height: auto !important;
        padding-bottom: 120px;
    }

    .bg-grad-1 {
        margin-top: 80px;
    }

    .scene-container {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
        width: 100%;
    }

    .left-panel,
    .right-panel {
        max-width: 100%;
        width: 100%;
        text-align: center;
        align-items: center;
        padding: 0;
    }

    .right-panel {
        margin-top: 0.5rem;
        text-align: center;
        align-items: center;
    }

    .hide-on-mobile {
        display: none !important;
    }

    .setup-scene h3 {
        font-size: 1.8rem;
    }



    /* Preview box centered below */
    .preview-box,
    .placeholder-box {
        text-align: center;
        align-items: center;
    }

    .success-badge {
        margin: 0 auto;
    }

    .draggable-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
    }

    .scene-container--knowledge-flow {
        gap: 2rem;
        min-height: auto;
    }

    .knowledge-panel,
    .wf-right-panel.knowledge-workflow-panel {
        width: 100%;
        max-width: 100%;
        text-align: left;
        align-items: flex-start;
    }

    .knowledge-panel {
        padding: 1.4rem;
    }

    .knowledge-workflow-panel .workflow-canvas-wrapper {
        height: 62vh;
        min-height: 420px;
    }

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

    .knowledge-story-bridge {
        width: 100%;
    }
}

/* Clone Voice Modal */
.clone-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.clone-modal-content {
    background: #0a0a0a;
    border: 1px solid #333;
    padding: 2.5rem;
    border-radius: 24px;
    width: 90%;
    max-width: 500px;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    animation: scaleUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.clone-modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: transparent;
    border: none;
    color: #666;
    font-size: 1.25rem;
    cursor: pointer;
    transition: color 0.2s;
}

.clone-modal-close:hover {
    color: #fff;
}

.clone-icon-large {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.clone-wave-anim {
    display: flex;
    gap: 4px;
    height: 20px;
    align-items: center;
}

.clone-wave-anim span {
    width: 3px;
    background: #00f0ff;
    border-radius: 2px;
    animation: wave 1s infinite ease-in-out;
}

.clone-wave-anim span:nth-child(1) {
    height: 60%;
    animation-delay: 0s;
}

.clone-wave-anim span:nth-child(2) {
    height: 100%;
    animation-delay: 0.1s;
}

.clone-wave-anim span:nth-child(3) {
    height: 70%;
    animation-delay: 0.2s;
}

.clone-modal-content h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: #fff;
    background: linear-gradient(to right, #fff, #888);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.clone-modal-content p {
    color: #888;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.clone-action-btn {
    width: 100%;
    padding: 1rem;
    background: #00f0ff;
    color: #000;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.clone-action-btn:hover {
    background: #fff;
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes scaleUp {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Voice Scene Specifics - Detailed Card */
.voice-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    width: 100%;
    margin-bottom: 1rem;
}

.voice-card-detailed {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 0.8rem 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: grab;
    transition: all 0.25s ease;
    position: relative;
    user-select: none;
    overflow: hidden;
}

.voice-card-detailed:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.voice-card-detailed.active {
    background: rgba(var(--voice-color), 0.1);
    border-color: var(--voice-color);
}

.voice-play-btn {
    min-width: 32px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid currentColor;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.2s;
    padding: 0;
    z-index: 10;
}

.voice-play-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.voice-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.voice-label-detailed {
    font-weight: 600;
    font-size: 1rem;
    color: #fff;
    letter-spacing: 0.5px;
}

.voice-meta {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.voice-tag {
    font-size: 0.65rem;
    color: #aaa;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.voice-duration {
    font-size: 0.7rem;
    color: #666;
    display: flex;
    align-items: center;
    gap: 4px;
}

.voice-status-badge {
    min-width: 24px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
}

.drag-handle-hint {
    margin-left: 0.5rem;
    color: #555;
    opacity: 0;
    transition: opacity 0.2s;
}

.voice-card-detailed:hover .drag-handle-hint {
    opacity: 0.5;
}

/* Trust Microcopy */
.trust-microcopy {
    font-size: 0.7rem;
    color: #444;
    text-align: center;
    margin-top: 1.5rem;
    font-style: italic;
    opacity: 0.6;
}

/* Updated Clone Modal */
.script-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed rgba(255, 255, 255, 0.15);
    padding: 1.5rem;
    border-radius: 12px;
    font-size: 1.2rem;
    color: #eee;
    font-style: italic;
    margin-bottom: 2rem;
    line-height: 1.6;
    text-align: center;
}

.record-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
    width: 100%;
}

.vu-meter {
    display: flex;
    gap: 4px;
    height: 60px;
    align-items: center;
    width: 100%;
    justify-content: center;
    padding: 0 1rem;
}

.vu-bar {
    width: 6px;
    background: #00f0ff;
    border-radius: 3px;
    transition: height 0.05s ease;
    opacity: 0.5;
}

.vu-meter.recording .vu-bar {
    opacity: 1;
    box-shadow: 0 0 10px #00f0ff;
}

.record-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #00f0ff;
    color: #00f0ff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.1);
    position: relative;
    z-index: 20;
}

.record-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.3);
}

.record-btn.stop {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
    color: #fff;
    animation: pulse-red 1.5s infinite;
}

.stop-icon {
    width: 24px;
    height: 24px;
    background: #ef4444;
    border-radius: 4px;
}

.record-timer {
    font-family: 'Courier New', monospace;
    color: #aaa;
    font-size: 1rem;
    letter-spacing: 2px;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 12px;
    border-radius: 4px;
}

.clone-apply-btn {
    width: 100%;
    padding: 1.2rem;
    background: #00f0ff;
    color: #000;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.clone-apply-btn:hover {
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 240, 255, 0.3);
}

@keyframes pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(239, 68, 68, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* Utilities */
.w-full {
    width: 100%;
}

.mt-4 {
    margin-top: 1rem;
}

.mt-6 {
    margin-top: 2rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.text-left {
    text-align: left;
}

.text-2xl {
    font-size: 1.5rem;
}

.font-bold {
    font-weight: 700;
}

.text-gray-400 {
    color: #888;
}

.text-sm {
    font-size: 0.85rem;
}

.mr-2 {
    margin-right: 0.5rem;
}

.animate-fade-in {
    animation: fadeIn 0.5s ease;
}

/* Voice Toast */
.voice-toast {
    position: absolute;
    top: 15vh;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 255, 157, 0.15);
    border: 1px solid #00ff9d;
    color: #00ff9d;
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-weight: 600;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    z-index: 100;
    animation: slideDown 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@media (max-width: 768px) {
    .voice-toast {
        display: none;
    }
}

@keyframes slideDown {
    from {
        transform: translate(-50%, -20px);
        opacity: 0;
    }

    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

/* SECTOR UI STYLES */
.sector-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
    width: 100%;
    position: relative;
    min-width: 340px;
}

@media (max-width: 1200px) {
    .sector-grid {
        grid-template-columns: 1fr;
    }
}

.sector-item {
    position: relative;
    height: 56px;
    transition: all 0.3s ease;
    pointer-events: auto;
}

.sector-item.faded {
    opacity: 0.3;
    filter: blur(1px);
}

.sector-item.expanded {
    grid-column: 1 / -1;
    z-index: 20;
}

.sector-card {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    display: flex;
    align-items: center;
    overflow: hidden;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: left center;
    z-index: 10;
    width: 100%;
    border-radius: 12px;
}

.sector-card:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.sector-card.active {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.15);
    transform: scale(1.02);
}

.sector-item.expanded .sector-card {
    width: 140px;
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
    border-top-right-radius: 20px;
    border-bottom-right-radius: 20px;
}

.sector-card-inner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 0.75rem;
    width: 280px;
}

.sector-icon {
    flex-shrink: 0;
}

.sector-label {
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    user-select: none;
}

.sector-sub-options {
    position: absolute;
    top: 0;
    left: 150px;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateX(-1rem);
    pointer-events: none;
}

.sector-item.expanded .sector-sub-options {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.gender-btn {
    height: 40px;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid;
    border-radius: 9999px;
    cursor: grab;
    transition: all 0.2s;
    user-select: none;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.gender-btn:active {
    cursor: grabbing;
}

/* Male button variations */
.gender-btn.male-btn {
    background: rgba(59, 130, 246, 0.1);
    color: #93c5fd;
    border-color: rgba(59, 130, 246, 0.3);
}

.gender-btn.male-btn:hover {
    background: rgba(59, 130, 246, 0.3);
}

.gender-btn.male-btn.active {
    background: #3b82f6;
    color: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.5);
}

/* Female button variations */
.gender-btn.female-btn {
    background: rgba(236, 72, 153, 0.1);
    color: #f9a8d4;
    border-color: rgba(236, 72, 153, 0.3);
}

.gender-btn.female-btn:hover {
    background: rgba(236, 72, 153, 0.3);
}

.gender-btn.female-btn.active {
    background: #ec4899;
    color: #ffffff;
    border-color: #ec4899;
    box-shadow: 0 0 15px rgba(236, 72, 153, 0.5);
}

/* ------------------------------------------- */
/* MOBILE OVERRIDES FOR SECTOR LIST UI */
/* Placed at the very end to ensure they override desktop styles */
/* ------------------------------------------- */
@media (max-width: 768px) {

    /* Sector grid: single column list on mobile */
    .sector-grid {
        display: flex;
        flex-direction: column;
        align-items: center;
        min-width: unset;
        width: 100%;
        gap: 0.6rem;
    }

    .sector-card-inner {
        width: 100%;
        padding: 0 1rem;
        justify-content: center;
    }

    .sector-item {
        width: 100%;
        max-width: 320px;
        height: 48px;
        margin: 0 auto;
    }

    .sector-label {
        font-size: 0.8rem;
    }
}


.knowledge-integrations-block {
    margin-top: 1.2rem;
    padding: 1rem 1.1rem 1.1rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255,255,255,0.08);
}

.knowledge-integrations-head h4 {
    margin: 0 0 0.35rem;
    font-size: 1rem;
    color: #f2f5ff;
}

.knowledge-integrations-head p {
    margin: 0 0 0.9rem;
    color: #a7b0c4;
    font-size: 0.9rem;
    line-height: 1.6;
}

.knowledge-integrations-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
}

.knowledge-integration-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 44px;
    padding: 0.8rem 0.95rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255,255,255,0.08);
    color: #e6edf6;
    font-size: 0.88rem;
    font-weight: 600;
}

.knowledge-integration-icon {
    display:inline-flex;
    color: #83f7ff;
}

.workflow-connector-strip {
    display: grid;
    gap: 0.75rem;
    margin-top: 0.35rem;
}

.workflow-connector-label {
    color: rgba(174, 188, 214, 0.82);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.workflow-connector-pills {
    display:flex;
    flex-wrap:wrap;
    gap: 0.65rem;
}

.workflow-connector-pill {
    display:inline-flex;
    align-items:center;
    padding: 0.5rem 0.75rem;
    border-radius: 999px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    color: #dce6f8;
    font-size: 0.78rem;
    font-weight: 600;
}

.workflow-legend {
    margin-bottom: 0.85rem;
    color: #7e8aa5;
    font-size: 0.84rem;
    line-height: 1.5;
}

@media (max-width: 1024px) {
    .knowledge-integrations-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .knowledge-panel,
    .wf-right-panel.knowledge-workflow-panel {
        width: 100%;
        max-width: 100%;
        flex-basis: 100%;
    }
}


.knowledge-workflow-panel .wf-subtitle {
    color: #aebdd8;
    font-size: 0.95rem;
    line-height: 1.65;
    max-width: 70ch;
}

.knowledge-workflow-panel .workflow-legend {
    color: #9fb1d3;
}

.knowledge-workflow-panel .wf-button-panel {
    gap: 10px;
}

.knowledge-workflow-panel .wf-add-btn {
    background: linear-gradient(180deg, rgba(15, 18, 28, 0.96), rgba(10, 12, 20, 0.96));
    border-color: rgba(255,255,255,0.1);
}

/* ===== Story-led connections redesign ===== */
.knowledge-panel--story {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.knowledge-story-stack {
    display: grid;
    gap: 14px;
}

.knowledge-story-card {
    display: grid;
    grid-template-columns: 48px 1fr;
    gap: 14px;
    padding: 18px 18px 16px;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(14,18,30,0.9), rgba(10,12,20,0.9));
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 14px 34px rgba(0,0,0,0.28);
}

.knowledge-story-step {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Sora', sans-serif;
    font-size: 0.9rem;
    font-weight: 800;
    color: #0b1016;
    background: linear-gradient(135deg, #7cf6ff, #c3a6ff);
    box-shadow: 0 10px 28px rgba(84, 206, 255, 0.18);
}

.knowledge-story-content h4 {
    margin: 2px 0 8px;
    font-size: 1.08rem;
    color: #f2f6ff;
}

.knowledge-story-content p {
    margin: 0;
    color: #aeb8cb;
    font-size: 0.94rem;
    line-height: 1.65;
}

.knowledge-story-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.knowledge-story-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 0.62rem 0.78rem;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.1);
    font-size: 0.82rem;
    font-weight: 700;
    color: #eef4ff;
    background: rgba(255,255,255,0.04);
}

.knowledge-story-chip.is-doc {
    background: rgba(88, 166, 255, 0.08);
}

.knowledge-story-chip.is-system {
    background: rgba(43, 255, 180, 0.08);
}

.knowledge-story-chip-icon {
    display: inline-flex;
    color: #7cf6ff;
}

.knowledge-story-list {
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 10px;
}

.knowledge-story-list li {
    position: relative;
    padding-left: 18px;
    color: #dfe7f4;
    font-size: 0.9rem;
    line-height: 1.55;
}

.knowledge-story-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.7em;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(135deg, #7cf6ff, #8dffcf);
    box-shadow: 0 0 12px rgba(124,246,255,0.45);
}

.knowledge-connectors-story {
    margin-top: 4px;
    padding: 18px;
    border-radius: 20px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
}

.knowledge-connectors-story-title {
    margin-bottom: 12px;
    color: #f1f6ff;
    font-size: 0.95rem;
    font-weight: 700;
}

.knowledge-connectors-story-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.knowledge-connectors-story-pill {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0.56rem 0.82rem;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.04);
    color: #dbe5f4;
    font-size: 0.82rem;
    font-weight: 700;
}

@media (max-width: 900px) {
    .knowledge-story-card {
        grid-template-columns: 1fr;
    }
}

/* ===== Full-width connections + service workflow stack ===== */
.scene-container--knowledge-flow.story-layout--stacked {
    display: flex;
    flex-direction: column;
    gap: clamp(56px, 8vw, 96px);
    width: 100%;
    max-width: 1320px;
    min-height: auto;
    padding-top: clamp(1.5rem, 3vh, 2.5rem);
}

.story-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.story-section-head {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 760px;
}

.story-section-head .scene-subtitle,
.story-section-head .wf-subtitle {
    max-width: 70ch;
}

.story-section-head--workflow {
    max-width: none;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    gap: 28px;
}

.story-section-head--workflow > div:first-child {
    max-width: 760px;
}

.knowledge-story-grid-full {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.knowledge-story-card--wide {
    height: 100%;
}

.knowledge-connectors-story--full {
    margin-top: 0;
    padding: 18px 20px;
}

.workflow-story-pills-wrap--inline {
    flex: 0 0 min(420px, 100%);
    max-width: 420px;
    margin-top: 2px;
}

.workflow-story-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.workflow-story-pill {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0.58rem 0.82rem;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.04);
    color: #e8eef8;
    font-size: 0.82rem;
    font-weight: 700;
}

.workflow-service-rail {
    display: flex;
    align-items: stretch;
    gap: 0;
    width: 100%;
    overflow-x: auto;
    padding: 10px 2px 14px;
    scrollbar-width: thin;
    scrollbar-color: rgba(124,246,255,0.35) transparent;
}

.workflow-service-rail::-webkit-scrollbar {
    height: 8px;
}

.workflow-service-rail::-webkit-scrollbar-thumb {
    background: rgba(124,246,255,0.25);
    border-radius: 999px;
}

.wf-stage-block {
    display: flex;
    align-items: center;
    min-width: max-content;
}

.wf-stage-card {
    width: 244px;
    min-height: 290px;
    padding: 22px 20px 20px;
    border-radius: 26px;
    border: 1px solid rgba(255,255,255,0.1);
    background: linear-gradient(180deg, rgba(11,16,28,0.98), rgba(9,12,20,0.98));
    box-shadow: 0 18px 44px rgba(0,0,0,0.28);
}

.wf-stage-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.wf-stage-icon {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #8af7ff;
    background: rgba(124,246,255,0.1);
    border: 1px solid rgba(124,246,255,0.12);
}

.wf-stage-kicker {
    color: rgba(174,188,214,0.85);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.16em;
}

.wf-stage-card h4 {
    margin: 0 0 10px;
    color: #f4f8ff;
    font-size: 1.15rem;
    line-height: 1.25;
}

.wf-stage-card p {
    margin: 0;
    color: #afbdd4;
    font-size: 0.94rem;
    line-height: 1.65;
}

.wf-stage-list {
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 8px;
}

.wf-stage-list li {
    position: relative;
    padding-left: 16px;
    color: #dfe7f4;
    font-size: 0.86rem;
    line-height: 1.55;
}

.wf-stage-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.72em;
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: linear-gradient(135deg, #7cf6ff, #8dffcf);
}

.wf-stage-connector {
    width: clamp(44px, 4vw, 72px);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.wf-stage-connector span {
    position: relative;
    display: block;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, rgba(124,246,255,0.12), rgba(124,246,255,0.72));
}

.wf-stage-connector span::after {
    content: '';
    position: absolute;
    right: -1px;
    top: 50%;
    width: 10px;
    height: 10px;
    border-top: 2px solid rgba(124,246,255,0.72);
    border-right: 2px solid rgba(124,246,255,0.72);
    transform: translateY(-50%) rotate(45deg);
}

@media (max-width: 1100px) {
    .knowledge-story-grid-full {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .story-section-head--workflow {
        flex-direction: column;
    }

    .workflow-story-pills-wrap--inline {
        max-width: none;
        width: 100%;
    }
}

@media (max-width: 780px) {
    .knowledge-story-grid-full {
        grid-template-columns: 1fr;
    }

    .wf-stage-card {
        width: 280px;
        min-height: 272px;
    }

    .wf-stage-connector {
        width: 34px;
    }
}
