/* Foenc Build Agent — /build full-page chat */

.build-agent-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: linear-gradient(165deg, #0f172a 0%, #1e293b 42%, #0f172a 100%);
    color: #e2e8f0;
}

.build-agent-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(10px);
    flex-wrap: wrap;
}

.build-agent-header__back {
    border: none;
    background: rgba(51, 65, 85, 0.6);
    color: #e2e8f0;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 10px;
    cursor: pointer;
}

.build-agent-header__brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 200px;
}

.build-agent-header__brand h1 {
    font-size: 1.1rem;
    margin: 0;
    color: #f8fafc;
}

.build-agent-header__brand p {
    font-size: 0.8rem;
    color: #94a3b8;
}

.build-agent-header__avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: #fff;
}

.build-agent-header__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-left: auto;
}

.build-agent-header__actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.build-agent-header__name {
    max-width: 220px;
    background: rgba(30, 41, 59, 0.9);
    border-color: rgba(148, 163, 184, 0.35);
    color: #f1f5f9;
}

.build-agent-footer__actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.build-agent-main {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 820px;
    width: 100%;
    margin: 0 auto;
}

.build-agent-msg {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
}

.build-agent-msg--user {
    flex-direction: row-reverse;
}

.build-agent-msg__avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #6366f1, #3b82f6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.build-agent-msg__bubble {
    max-width: min(92%, 560px);
    padding: 0.75rem 1rem;
    border-radius: 14px;
    font-size: 0.92rem;
    line-height: 1.5;
}

.build-agent-msg--assistant .build-agent-msg__bubble {
    background: rgba(30, 41, 59, 0.95);
    border: 1px solid rgba(148, 163, 184, 0.2);
    color: #e2e8f0;
}

.build-agent-msg--user .build-agent-msg__bubble {
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    color: #fff;
}

.build-agent-msg--status .build-agent-msg__bubble {
    font-style: italic;
    opacity: 0.85;
    font-size: 0.85rem;
}

.build-agent-suggestion {
    padding: 0.65rem;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px dashed rgba(96, 165, 250, 0.4);
}

.build-agent-footer {
    padding: 1rem 1.25rem 1.25rem;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(15, 23, 42, 0.92);
    max-width: 820px;
    width: 100%;
    margin: 0 auto;
}

.build-agent-composer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.5rem;
    align-items: end;
}

.build-agent-composer__input {
    width: 100%;
    min-width: 0;
    resize: none;
    background: rgba(30, 41, 59, 0.95);
    border-color: rgba(148, 163, 184, 0.35);
    color: #f1f5f9;
    border-radius: 12px;
}

.build-agent-composer__send {
    border-radius: 12px;
    width: 2.75rem;
    height: 2.75rem;
    min-width: 2.75rem;
    padding: 0;
}

.build-agent-blueprint {
    margin-top: 0.75rem;
}

.build-agent-starters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.build-agent-starters__label {
    width: 100%;
    margin: 0;
}

.build-agent-starter-chip {
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(51, 65, 85, 0.5);
    color: #e2e8f0;
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    cursor: pointer;
}

.build-agent-starter-chip:hover {
    background: rgba(59, 130, 246, 0.35);
    border-color: #60a5fa;
}

.build-agent-result {
    margin-top: 0.5rem;
    padding: 0.85rem;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(52, 211, 153, 0.35);
}

.build-agent-result__header {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.build-agent-result__header i {
    color: #34d399;
    font-size: 1.25rem;
}

.build-agent-result__header h3 {
    font-size: 1rem;
    margin: 0 0 0.25rem;
    color: #f8fafc;
}

.build-agent-result__header p {
    font-size: 0.8rem;
    color: #94a3b8;
    margin: 0;
}

.build-agent-result__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.78rem;
    color: #cbd5e1;
    margin-bottom: 0.65rem;
}

.build-agent-result__actions {
    display: flex;
    gap: 0.5rem;
}

/* Generation progress on dark build page */
.build-agent-page .generation-activity-panel {
    margin: 0.25rem 0;
    border-color: rgba(96, 165, 250, 0.35);
    background: rgba(30, 41, 59, 0.95);
    box-shadow: none;
}

.build-agent-page .generation-activity-panel__title {
    color: #f8fafc;
}

.build-agent-page .generation-activity-panel__message {
    color: #93c5fd;
}

.build-agent-page .generation-activity-panel__hint {
    color: #94a3b8;
}

.build-agent-page .text-muted {
    color: #94a3b8 !important;
}

/* Plan review panel (/build) */
.build-agent-review-anchor {
    flex-shrink: 0;
}

.build-agent-chat-history {
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 10px;
    padding: 0.35rem 0.75rem 0.75rem;
    background: rgba(15, 23, 42, 0.45);
}

.build-agent-chat-history summary {
    cursor: pointer;
    padding: 0.35rem 0;
    list-style-position: inside;
}

.build-agent-chat-history__body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 220px;
    overflow-y: auto;
    padding-top: 0.35rem;
}

.build-plan-review {
    margin-top: 0;
    padding: 1.25rem;
    border-radius: 14px;
    background: rgba(30, 41, 59, 0.92);
    border: 1px solid rgba(148, 163, 184, 0.25);
}

.build-plan-review__title {
    font-size: 1.15rem;
    margin: 0 0 0.35rem;
    color: #f8fafc;
}

.build-plan-review__kind {
    color: #cbd5e1;
    margin-bottom: 0.75rem;
}

.build-plan-review__subtitle {
    font-size: 0.95rem;
    margin: 0 0 0.5rem;
    color: #e2e8f0;
}

.build-plan-review__list {
    margin: 0 0 0.75rem;
    padding-left: 1.2rem;
    color: #94a3b8;
    font-size: 0.875rem;
}

.build-plan-review__list--outline {
    color: #cbd5e1;
}

.build-plan-review__style {
    color: #94a3b8;
}

.build-plan-review__section {
    margin-top: 1.25rem;
}

.build-plan-review__select {
    max-width: 280px;
    background: rgba(15, 23, 42, 0.9);
    border-color: rgba(148, 163, 184, 0.35);
    color: #f1f5f9;
}

.build-plan-review__features {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.5rem;
    max-height: 320px;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.build-plan-review__feature {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    text-align: left;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(15, 23, 42, 0.65);
    color: #e2e8f0;
    cursor: pointer;
    width: 100%;
}

.build-plan-review__feature--on {
    border-color: rgba(96, 165, 250, 0.55);
    background: rgba(59, 130, 246, 0.15);
}

.build-plan-review__feature--locked {
    opacity: 0.75;
    cursor: default;
}

.build-plan-review__feature-check {
    color: #60a5fa;
    margin-top: 0.15rem;
}

.build-plan-review__feature-body strong {
    font-size: 0.85rem;
    color: #f1f5f9;
}

.build-plan-review__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.25rem;
    align-items: center;
}
