/* ═══════════════════════════════════════
   GUIDED SCENARIO CREATION
   ═══════════════════════════════════════ */

.guided-page {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 80px);
    min-height: 0;
}

.guided-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.guided-back {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 6px 12px;
    border-radius: 8px;
    transition: background 0.15s;
}

.guided-back:hover {
    background: var(--accent-bg);
    color: var(--text);
}

.guided-header h2 {
    font-size: 1.2rem;
    margin: 0;
    color: var(--text);
}

/* Progress bar */
.guided-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0 0;
    flex-shrink: 0;
}

.guided-progress-bar {
    flex: 1;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.guided-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.4s ease;
}

.guided-progress-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
    min-width: 40px;
    text-align: right;
}

/* Chat area */
.guided-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding-top: 16px;
}

.guided-messages {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 16px;
}

.guided-bubble {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 0.92rem;
    line-height: 1.55;
}

.guided-bubble.assistant {
    align-self: flex-start;
    background: var(--panel);
    color: var(--text);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}

.guided-bubble.user {
    align-self: flex-end;
    background: var(--accent);
    color: var(--btn-text);
    border-bottom-right-radius: 4px;
}

.guided-bubble.typing {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
}

.guided-bubble.error {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    border-color: var(--accent);
}

.guided-retry-btn {
    background: var(--accent);
    color: var(--btn-text);
    border: none;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
}

.guided-retry-btn:hover {
    opacity: 0.85;
}

.thinking-label {
    background: linear-gradient(90deg,
        var(--text-muted) 0%,
        var(--text-muted) 35%,
        var(--text) 50%,
        var(--text-muted) 65%,
        var(--text-muted) 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: thinking-shimmer 2s ease-in-out infinite;
}

@keyframes thinking-shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

.thinking-dots {
    display: inline-flex;
    gap: 3px;
    align-items: center;
}

.thinking-dots span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.35;
    animation: thinking-bounce 1.2s infinite ease-in-out;
}

.thinking-dots span:nth-child(2) { animation-delay: 0.15s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes thinking-bounce {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.35; }
    40% { transform: translateY(-4px); opacity: 1; }
}

/* Input bar */
.guided-input-bar {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 12px 0 8px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.guided-input-bar textarea {
    flex: 1;
    background: var(--input-bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 0.92rem;
    font-family: inherit;
    resize: none;
    max-height: 120px;
    outline: none;
    line-height: 1.4;
}

.guided-input-bar textarea:focus {
    border-color: var(--border-focus);
}

.guided-input-bar .btn-send {
    background: var(--accent);
    color: var(--btn-text);
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    font-family: inherit;
    flex-shrink: 0;
    transition: background 0.15s;
}

.guided-input-bar .btn-send:hover { background: var(--accent-hover); }
.guided-input-bar .btn-send:disabled { opacity: 0.5; cursor: not-allowed; }

/* Launch section */
.guided-launch {
    flex-shrink: 0;
    padding: 20px 0;
}

.guided-summary {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    font-size: 0.92rem;
    line-height: 1.55;
    color: var(--text);
}

.guided-role-assign {
    text-align: center;
    font-size: 0.95rem;
    color: var(--text);
    margin-bottom: 20px;
}

.guided-launch-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.guided-launch-buttons .btn {
    min-width: 160px;
}

@media (max-width: 600px) {
    .guided-page {
        height: calc(100vh - 60px);
    }
    .guided-bubble {
        max-width: 90%;
    }
    .guided-launch-buttons {
        flex-direction: column;
    }
    .guided-launch-buttons .btn {
        width: 100%;
    }
}
