/* ==========================================================================
   Knowledge document (AI-1825): one document's editor, with the drop zone
   for its file, the file itself as a quiet row and Save in a footer that
   stays in view while the long form scrolls.
   ========================================================================== */

.kd-shell {
    max-width: 1180px;
    margin: 0 auto;
}

.kd-nav {
    margin: 6px 0 12px;
}

.kd-lock {
    margin-bottom: 12px;
}

/* ---------- Drop zone --------------------------------------------------- */

.kd-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 100%;
    min-height: 126px;
    padding: 22px;
    border: 1.5px dashed color-mix(in srgb, var(--ui-accent) 34%, transparent);
    border-radius: var(--ui-radius-lg);
    background: color-mix(in srgb, var(--ui-accent) 5%, transparent);
    text-align: center;
    cursor: pointer;
    transition: border-color 160ms var(--ui-ease), background-color 160ms var(--ui-ease);
}

.kd-dropzone:hover {
    border-color: var(--ui-accent);
    background: var(--ui-bg-active);
}

.kd-dropzone__title {
    font-size: 0.9375rem;
    font-weight: 600;
}

.kd-dropzone__help {
    color: var(--ui-text-2);
    font-size: 0.75rem;
}

.kd-dropzone .ui-btn {
    margin-top: 4px;
}

/* ---------- The file ---------------------------------------------------- */

.kd-file {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 8px 10px 14px;
}

.kd-file__mark {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid color-mix(in srgb, var(--ui-accent) 35%, transparent);
    border-radius: 50%;
    background: var(--ui-bg-hover);
}

.kd-file__text {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
}

.kd-file__name {
    overflow: hidden;
    font-size: 0.875rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kd-file__meta {
    color: var(--ui-text-2);
    font-size: 0.75rem;
}

/* ---------- Form -------------------------------------------------------- */

.kd-autoattach {
    display: flex;
    align-items: center;
}

.kd-analysis__body {
    padding: 8px;
}

/* The footer stays in view while the form scrolls. */
.kd-editor .ui-settings__footer {
    position: sticky;
    bottom: 0;
    z-index: 5;
    border-radius: 0 0 20px 20px;
    background: var(--ui-bg-card);
}

.kd-footer__back {
    margin-right: auto;
}
