.project-files {
    min-width: 0;
}

.project-file-header-controls {
    flex: 0 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.project-file-input {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    opacity: 0;
    pointer-events: none;
}

.project-file-upload-button {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 5px;
    border: 1px solid var(--input-border);
    background: var(--overlay-bg);
    color: var(--text);
    cursor: pointer;
    font: inherit;
    font-size: 20px;
    font-weight: 400;
    line-height: 1;
}

.project-file-upload-button:hover:not(:disabled) {
    background: var(--overlay-bg-hover);
}

.project-file-upload-button:disabled {
    cursor: progress;
    opacity: 0.7;
}

.project-file-feedback {
    min-width: 0;
    overflow: hidden;
    color: var(--muted-2);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-file-feedback.is-success {
    color: var(--accent-color);
}

.project-file-feedback.is-error {
    color: var(--error-text, #ff6b6b);
}

.project-file-empty {
    margin: 0;
    padding: 14px 0;
    color: var(--muted-2);
    font-size: 14px;
}

.project-file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 146px);
    justify-content: start;
    gap: 18px 16px;
    min-width: 0;
}

.project-file-tile {
    position: relative;
    box-sizing: border-box;
    width: 152px;
    min-width: 0;
    display: grid;
    justify-items: start;
    gap: 8px;
}

.project-file-document {
    position: relative;
    box-sizing: border-box;
    width: 132px;
    height: 168px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 7px 22px 7px 7px;
    background: linear-gradient(145deg, var(--card-bg-strong-hover), var(--card-bg-strong));
    color: var(--text);
}

.project-file-document::before {
    content: "";
    position: absolute;
    top: -1px;
    right: -1px;
    width: 30px;
    height: 30px;
    border-left: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    border-radius: 0 20px 0 6px;
    background: var(--surface);
    pointer-events: none;
}

.project-file-type {
    max-width: 102px;
    overflow: hidden;
    color: var(--text);
    font-size: 23px;
    font-weight: 750;
    letter-spacing: 0.04em;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-file-size {
    color: var(--muted-2);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.project-file-delete {
    position: absolute;
    z-index: 3;
    top: 0;
    right: 20px;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 0 18px 0 6px;
    color: var(--muted-2);
    background: transparent;
    cursor: pointer;
    font: inherit;
    font-size: 17px;
    line-height: 1;
    opacity: 0.68;
    touch-action: manipulation;
}

.project-file-delete:hover:not(:disabled) {
    color: #fca5a5;
    background: transparent;
    opacity: 1;
}

.project-file-delete:disabled {
    cursor: progress;
    opacity: 0.35;
}

.project-file-name {
    width: 132px;
    min-height: 34px;
    display: -webkit-box;
    overflow: hidden;
    color: var(--text);
    font-size: 13px;
    font-weight: 550;
    line-height: 1.3;
    overflow-wrap: anywhere;
    text-align: center;
    text-decoration: none;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.project-file-actions {
    position: absolute;
    z-index: 2;
    right: 8px;
    bottom: 8px;
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.project-file-action {
    box-sizing: border-box;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border: 1px solid var(--input-border);
    border-radius: 5px;
    background: var(--overlay-bg);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.project-file-action:hover {
    background: var(--overlay-bg-hover);
}

.project-file-action img {
    display: block;
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.project-file-upload-button:focus-visible,
.project-file-action:focus-visible,
.project-file-delete:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}
