/* ============================= */
/* History: card list             */
/* ============================= */

.history-list {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.protocol-card {
    display: flex;
    gap: 16px;
    padding: 18px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: white;
    transition: box-shadow 0.15s ease;
}

.protocol-card:hover {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

.protocol-card-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    background: #f3f4f6;
    border-radius: 10px;
}

.protocol-card-body {
    flex: 1;
    min-width: 0;
}

.protocol-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.protocol-card-filename {
    font-weight: 600;
    color: #222;
    font-size: 15px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.protocol-card-date {
    margin-top: 4px;
    font-size: 13px;
    color: #888;
}

.protocol-card-actions {
    margin-top: 14px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.protocol-action-button {
    padding: 8px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: white;
    color: #222;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

.protocol-action-button:hover {
    background: #f3f4f6;
}

.protocol-action-button-outline {
    background: #fafafa;
    color: #555;
}


/* ============================= */
/* Status badges                   */
/* ============================= */

.status-badge {
    flex-shrink: 0;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.status-badge-done {
    background: #dcfce7;
    color: #15803d;
}

.status-badge-progress {
    background: #eef2ff;
    color: #4338ca;
}

.status-badge-failed {
    background: #fee2e2;
    color: #b42318;
}


/* ============================= */
/* Empty state                     */
/* ============================= */

.history-empty {
    padding: 60px 20px;
    text-align: center;
}

.history-empty-icon {
    font-size: 40px;
    margin-bottom: 12px;
    opacity: 0.6;
}

.history-empty-text {
    color: #777;
    font-size: 15px;
}


/* ============================= */
/* Transcript modal                */
/* ============================= */

.transcript-modal {
    width: min(100%, 640px);
}

.transcript-text {
    max-height: 420px;
    overflow-y: auto;
    padding: 16px;
    margin-bottom: 20px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fafafa;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    white-space: pre-wrap;
    word-break: break-word;
}


/* ============================= */
/* History-page responsive rules   */
/* ============================= */

@media (max-width: 700px) {
    .protocol-card {
        flex-direction: column;
    }

    .protocol-card-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .status-badge {
        align-self: flex-start;
    }
}
