/* ==========================================
   Per-app Documents sheet (in-place panel swap)
   Tokens only — no new background layers.
   ========================================== */

.tool-doc-sheet {
    display: none;
    flex-direction: column;
    gap: 0;
    min-height: 0;
    animation: stepFadeIn 0.3s ease-out;
}

.tool-doc-sheet.active {
    display: flex;
}

.tool-doc-header {
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
    padding-bottom: var(--space-5);
    margin-bottom: var(--space-5);
    border-bottom: 1px solid var(--color-border);
}

.tool-doc-back-btn {
    flex-shrink: 0;
    margin-top: 2px;
    padding: 6px 14px;
    background: transparent;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-muted);
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s ease, color 0.15s ease;
}

.tool-doc-back-btn:hover {
    background: var(--color-bg-muted);
    color: var(--color-text);
}

.tool-doc-back-btn:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.tool-doc-uk-header {
    flex: 1;
    min-width: 0;
}

.tool-doc-body {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
    flex: 1;
    min-height: 0;
}

.tool-doc-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-6) var(--space-5);
    border: 1px dashed var(--color-border-strong);
    border-radius: var(--radius-lg);
    background: var(--color-bg-subtle);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
    text-align: center;
}

.tool-doc-dropzone:hover,
.tool-doc-dropzone.is-dragover {
    border-color: var(--color-primary);
    background: var(--color-primary-bg-hover);
}

.tool-doc-dropzone:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.tool-doc-dropzone-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text);
}

.tool-doc-dropzone-sub {
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text-muted);
    margin-bottom: var(--space-2);
}

.tool-doc-progress.hidden {
    display: none;
}

.tool-doc-progress {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tool-doc-progress-bar {
    height: 6px;
    border-radius: var(--radius-pill);
    background: var(--color-bg-muted);
    overflow: hidden;
}

.tool-doc-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--color-primary);
    border-radius: var(--radius-pill);
    transition: width 0.2s ease;
}

.tool-doc-progress-text {
    font-size: 12px;
    color: var(--color-text-muted);
}

.tool-doc-list-wrap {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.tool-doc-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.tool-doc-skeleton {
    height: 56px;
    border-radius: var(--radius-lg);
}

.tool-doc-row {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 12px 14px;
    border: 1px solid var(--color-border-medium);
    border-radius: var(--radius-lg);
    background: var(--color-bg);
    transition: border-color 0.15s ease, background 0.15s ease;
}

.tool-doc-row:hover {
    border-color: var(--color-border-strong);
    background: var(--color-bg-subtle);
}

.tool-doc-row-main {
    flex: 1;
    min-width: 0;
}

.tool-doc-row-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tool-doc-row-meta {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-top: 2px;
}

.tool-doc-row-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.tool-doc-row-actions .uk-btn {
    padding: 6px 10px;
    font-size: 12px;
}

.tool-doc-footer {
    margin-top: var(--space-5);
    padding-top: var(--space-4);
    border-top: 1px solid var(--color-border);
    font-size: 11.5px;
    color: var(--color-text-muted);
    line-height: 1.4;
}

.tool-doc-delete-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
    margin-top: var(--space-2);
}

@media (width <= 900px) {
    .tool-doc-header {
        flex-wrap: wrap;
    }

    .tool-doc-row {
        flex-wrap: wrap;
    }

    .tool-doc-row-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* Imported (Phase-1-migrated) rows: context-only, no downloadable bytes yet. */
.tool-doc-imported {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-muted);
    padding: 5px 10px;
}
