/* File cards — documents an agent turn made or edited, and composer chips for
   files about to be attached. js/shared/components/file-cards.js.
   Tokens only (theme-dark.css re-points them). The format shows in the icon
   tile's glyph; the tile itself stays in the accent so a reply with three
   files reads as one set, not a rainbow. */

.efc-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 12px;
}

.efc-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-bg-white);
    box-shadow: var(--shadow-sm);
}

.efc-card.is-deleted { opacity: 0.55; }

.efc-icon {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--color-primary-lighter);
    color: var(--color-primary);
    font-size: 17px;
}

.efc-body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.efc-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.efc-sub {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    font-size: 11px;
    color: var(--color-text-secondary);
}

.efc-summary {
    font-size: 11px;
    color: var(--color-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.efc-badge {
    display: inline-block;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    font-size: 10px;
    font-weight: 600;
    line-height: 16px;
    color: var(--color-text-secondary);
    margin-right: 2px;
}

.efc-badge-current {
    background: var(--color-success-bg);
    border-color: var(--color-success-border);
    color: var(--color-success-text);
    margin-left: 4px;
}

.efc-stale { color: var(--color-warning); }

.efc-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 4px;
}

.efc-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 28px;
    padding: 0 8px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-bg-white);
    color: var(--color-text-secondary);
    font-size: 12px;
    cursor: pointer;
}

.efc-btn:hover {
    background: var(--color-bg-hover);
    color: var(--color-text-primary);
}

.efc-btn-primary {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: var(--color-text-white);
    font-weight: 600;
}

.efc-btn-primary:hover {
    background: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    color: var(--color-text-white);
}

/* Version history popover, anchored to the card's right edge. */
.efc-history {
    position: absolute;
    right: 8px;
    top: calc(100% + 4px);
    z-index: 30;
    width: min(380px, calc(100vw - 32px));
    max-height: 320px;
    overflow-y: auto;
    padding: 6px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-bg-white);
    box-shadow: var(--shadow-xl);
}

.efc-history-head {
    padding: 4px 6px 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
}

.efc-history-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px;
    border-radius: 6px;
    font-size: 12px;
    color: var(--color-text-primary);
}

.efc-history-row:hover { background: var(--color-bg-secondary); }

.efc-history-main {
    flex: 1 1 auto;
    min-width: 0;
}

.efc-history-summary {
    display: block;
    font-size: 11px;
    color: var(--color-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.efc-history-actions {
    display: flex;
    gap: 4px;
}

.efc-history-empty {
    padding: 8px;
    font-size: 12px;
    color: var(--color-text-secondary);
}

/* Composer chips (attachments not yet sent). */
.efc-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 240px;
    height: 30px;
    padding: 0 6px 0 9px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-bg-secondary);
    font-size: 12px;
    color: var(--color-text-primary);
}

.efc-chip > .fa { color: var(--color-primary); }

.efc-chip.is-uploading { opacity: 0.7; }

.efc-chip-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.efc-chip-remove {
    border: 0;
    background: transparent;
    color: var(--color-text-muted);
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
}

.efc-chip-remove:hover { color: var(--color-danger); }

/* Attachments on a sent user message. */
.efc-attached {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

@media (max-width: 600px) {
    .efc-btn-primary span { display: none; }
}
