/* ================================================ */
/* Bid Review Tool                                  */
/* ================================================ */

/* State visibility */
.br-state {
    display: none;
}

.br-state.active {
    display: block;
}

/* Upload State */
.br-upload-card {
    text-align: center;
    padding: 40px 20px;
}

.br-upload-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    border-radius: 14px;
    color: #4f46e5;
    margin-bottom: 16px;
}

.br-upload-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 8px;
}

.br-upload-text {
    font-size: 14px;
    color: var(--color-text-muted);
    line-height: 1.5;
    margin: 0 auto 20px auto;
    max-width: 400px;
}

/* Dropzone */
.br-dropzone {
    border: 2px dashed var(--color-border, #d1d5db);
    border-radius: 12px;
    padding: 30px 20px;
    margin: 0 auto 16px auto;
    max-width: 400px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--color-text-muted);
}

.br-dropzone:hover {
    border-color: #4f46e5;
    background: rgba(79, 70, 229, 0.03);
}

.br-dropzone.drag-over {
    border-color: #4f46e5;
    background: rgba(79, 70, 229, 0.06);
}

.br-dropzone-text {
    font-size: 14px;
    font-weight: 500;
    margin: 10px 0 2px;
}

.br-dropzone-subtext {
    font-size: 13px;
    color: var(--color-text-faint);
    margin: 0 0 4px;
}

.br-dropzone-formats {
    font-size: 12px;
    color: var(--color-text-faint);
    margin: 0;
}

/* File list */
.br-file-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    max-width: 400px;
    margin: 0 auto 16px auto;
}

.br-file-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--color-bg-muted, #f3f4f6);
    border-radius: 16px;
    padding: 4px 10px;
    font-size: 12px;
    color: var(--color-text);
}

.br-file-remove {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 14px;
    padding: 0 2px;
    line-height: 1;
}

.br-file-remove:hover {
    color: #dc2626;
}

/* Upload actions */
.br-upload-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    max-width: 400px;
    margin: 0 auto;
}

.br-upload-continue {
    width: 100%;
    padding: 10px 24px;
    background: #4f46e5;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.br-upload-continue:hover:not(:disabled) {
    background: #4338ca;
}

.br-upload-continue:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.br-upload-skip {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 13px;
    cursor: pointer;
    padding: 4px 8px;
}

.br-upload-skip:hover {
    color: var(--color-text);
    text-decoration: underline;
}

/* Chat State */
.br-chat {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.br-chat.active {
    display: flex;
}

/* Messages */
.br-messages {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
}

.br-msg {
    display: flex;
    gap: 10px;
    max-width: 88%;
    animation: stepFadeIn 0.2s ease-out;
}

.br-msg.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.br-msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.br-msg-content {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.6;
}

.br-msg.assistant .br-msg-content {
    background: rgba(0, 0, 0, 0.03);
    color: var(--color-text);
    border-bottom-left-radius: 4px;
}

.br-msg.user .br-msg-content {
    background: var(--color-primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.br-msg-content p {
    margin: 0 0 8px 0;
}

.br-msg-content p:last-child {
    margin-bottom: 0;
}

.br-msg-content strong {
    font-weight: 600;
}

.br-msg-content ul,
.br-msg-content ol {
    margin: 4px 0 8px 0;
    padding-left: 20px;
}

.br-msg-content li {
    margin-bottom: 2px;
}

.br-msg-content h1,
.br-msg-content h2,
.br-msg-content h3,
.br-msg-content h4 {
    margin: 12px 0 6px 0;
    font-weight: 600;
}

.br-msg-content h3 {
    font-size: 15px;
}

.br-msg-content h4 {
    font-size: 14px;
}

/* Copy button on assistant messages */
.br-copy-msg-btn {
    background: none;
    border: none;
    color: var(--color-text-faint);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.2s, color 0.2s;
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: 8px;
}

.br-msg:hover .br-copy-msg-btn {
    opacity: 1;
}

.br-copy-msg-btn:hover {
    color: var(--color-text);
    background: var(--color-bg-muted);
}

/* Chat input — inherits from .tool-prompt-bar */
.br-input-area {
    margin-top: auto;
}

.br-input { /* styling inherited from .tool-prompt-bar textarea */ }
.br-send-btn { /* styling inherited from .tool-prompt-bar .prompt-send-btn */ }

/* Typing indicator */
.br-typing {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}

.br-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-text-muted);
    animation: brTypingDot 1.2s ease-in-out infinite;
}

.br-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.br-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes brTypingDot {
    0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); }
    30% { opacity: 1; transform: scale(1); }
}

/* New Review button in header */
.br-new-review-header-btn {
    background: none;
    border: 1px solid var(--color-border, #d1d5db);
    color: var(--color-text-muted);
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 6px;
    cursor: pointer;
    margin-left: auto;
    transition: all 0.2s;
}

.br-new-review-header-btn:hover {
    background: var(--color-bg-muted);
    color: var(--color-text);
    border-color: var(--color-text-muted);
}

/* ================================== */
/* Weekly Owner Update — KB Doc Viewer */
/* ================================== */
.wou-kb-hint {
    font-size: 12.5px;
    color: var(--color-text-muted);
    margin: 0;
    line-height: 1.5;
}

.wou-kb-doc-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 2px;
}

.wou-kb-doc-card {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 7px 10px;
    background: var(--color-bg-muted, #f9fafb);
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 7px;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s, border-color 0.15s;
    font-size: 13px;
    color: var(--color-text);
}

.wou-kb-doc-card:hover:not(:disabled) {
    background: var(--color-bg-hover, #f3f4f6);
    border-color: var(--color-border-hover, #d1d5db);
}

.wou-kb-doc-card:disabled,
.wou-kb-processing {
    opacity: 0.55;
    cursor: not-allowed;
}

.wou-kb-doc-card.wou-kb-opening {
    opacity: 0.6;
}

.wou-kb-doc-icon {
    flex-shrink: 0;
    color: var(--color-text-muted);
}

.wou-kb-doc-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.wou-kb-status {
    font-size: 11px;
    color: var(--color-text-muted);
    background: var(--color-bg, #f3f4f6);
    border-radius: 4px;
    padding: 1px 6px;
    flex-shrink: 0;
    text-transform: capitalize;
}

.wou-kb-open-icon {
    flex-shrink: 0;
    color: var(--color-text-muted);
    opacity: 0.6;
}

/* KB doc card — two-line layout (name + date) */
.wou-kb-doc-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex: 1;
    overflow: hidden;
}

.wou-kb-date-badge {
    font-size: 11px;
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
