.messageCard {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    overflow: hidden;

    &__header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.75rem 1rem;
        background-color: #f9fafb;
        border-bottom: 1px solid #e5e7eb;
    }

    &__headerLeft {
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }

    &__headerRight {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    &__index {
        font-size: 0.75rem;
        font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
        color: #9ca3af;
    }

    &__toggleBtn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
        border-radius: 0.25rem;
        border: none;
        cursor: pointer;
        transition: all 0.15s ease;
        background-color: #e5e7eb;
        color: #4b5563;

        &:hover {
            background-color: #d1d5db;
        }

        &--active {
            background-color: #374151;
            color: #ffffff;
        }
    }

    &__expandBtn {
        padding: 0.25rem;
        border: none;
        background: transparent;
        cursor: pointer;
        border-radius: 0.25rem;
        transition: background-color 0.15s ease;

        &:hover {
            background-color: #e5e7eb;
        }
    }

    &__expandIcon {
        width: 1rem;
        height: 1rem;
        color: #6b7280;
        transition: transform 0.2s ease;

        &--expanded {
            transform: rotate(180deg);
        }
    }

    &__body {
        padding: 1rem;
    }

    &__raw {
        background-color: #111827;
        color: #f3f4f6;
        padding: 1rem;
        border-radius: 0.5rem;
        overflow-x: auto;
    }

    &__rawPre {
        font-size: 0.75rem;
        font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
        white-space: pre-wrap;
        margin: 0;
    }

    &__formatted {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    &__section {
        display: flex;
        flex-direction: column;
    }

    &__label {
        font-size: 0.75rem;
        font-weight: 500;
        color: #6b7280;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        margin-bottom: 0.5rem;
    }

    &__userMessage {
        background-color: #eff6ff;
        padding: 0.75rem;
        border-radius: 0.5rem;
        border: 1px solid #dbeafe;
        color: #1f2937;
        margin: 0;
    }

    &__toolCalls {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    &__tools {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }

    &__response {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }

    &__responseMessage {
        background-color: #f0fdf4;
        border: 1px solid #bbf7d0;
        padding: 0.75rem;
        border-radius: 0.5rem;
    }

    &__responseLabel {
        font-size: 0.75rem;
        color: #6b7280;
        font-weight: 500;
    }

    &__responseText {
        margin: 0.25rem 0 0 0;
        color: #1f2937;
    }

    &__responseMeta {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;

        @media (min-width: 768px) {
            grid-template-columns: repeat(4, 1fr);
        }
    }

    &__metaItem {
        background-color: #f3f4f6;
        padding: 0.5rem;
        border-radius: 0.25rem;
    }

    &__metaLabel {
        font-size: 0.75rem;
        color: #6b7280;
    }

    &__metaValue {
        font-weight: 500;
        margin: 0;

        &--mono {
            font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
        }

        &--success {
            color: #16a34a;
        }

        &--danger {
            color: #dc2626;
        }
    }

    &__assistantMessage {
        background-color: #f0fdf4;
        padding: 0.75rem;
        border-radius: 0.5rem;
        border: 1px solid #bbf7d0;
        color: #1f2937;
        margin: 0;
    }
}
