/* Transfer annotations share the existing type, color and spacing system. */
.vf-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.vf-file-note {
    display: block;
    margin-top: 6px;
    color: var(--color-text-secondary);
    font-size: var(--text-sm);
    line-height: 1.6;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.vf-file-item--editable {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    align-items: start;
}

.vf-file-item--editable .vf-file-icon { margin-top: 3px; }
.vf-file-meta--editable { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.vf-file-note-toggle, .vf-file-note-done {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--color-text-secondary);
    font: inherit;
    font-size: var(--text-xs);
    font-weight: 600;
    cursor: pointer;
    min-height: 28px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: color var(--duration-fast), background-color var(--duration-fast);
}

.vf-file-note-toggle:hover, .vf-file-note-done:hover { color: var(--color-accent); background: var(--color-surface-hover); }
.vf-file-note-toggle:focus-visible, .vf-file-note-done:focus-visible, .vf-message-toolbar button:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.vf-file-note-toggle[aria-expanded="true"] { color: var(--color-accent); }
.vf-file-note-preview { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; font-size: var(--text-xs); }
.vf-file-note-editor { grid-column: 2 / -1; min-width: 0; }
.vf-file-note-input {
    display: block;
    width: 100%;
    min-height: 64px;
    max-height: 160px;
    padding: 10px 12px;
    resize: vertical;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-text-primary);
    font: inherit;
    font-size: var(--text-sm);
    line-height: 1.6;
    transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}

.vf-file-note-input:focus { outline: none; border-color: var(--color-accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-accent) 12%, transparent); }
.vf-file-note-input::placeholder { color: var(--color-text-tertiary); }
.vf-file-note-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 4px; }
.vf-file-note-count { color: var(--color-text-tertiary); font-size: 0.6875rem; font-variant-numeric: tabular-nums; }
.vf-file-note-done { color: var(--color-text-primary); }
.vf-file-item--editable button:disabled { cursor: default; opacity: 0.5; }
.vf-file-item:has(.vf-file-note:not([hidden])), .vf-file-open:has(.vf-file-note) { align-items: start; }

.vf-message-composer {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    overflow: hidden;
    transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}

.vf-message-composer:focus-within { border-color: var(--color-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-accent) 10%, transparent); }
.vf-message-toolbar { display: flex; align-items: center; gap: 3px; padding: 7px 10px; border-bottom: 1px solid var(--color-border-subtle); }
.vf-message-toolbar button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: color var(--duration-fast), background-color var(--duration-fast);
}

.vf-message-toolbar button:hover { color: var(--color-text-primary); background: var(--color-surface-hover); }
.vf-message-toolbar button[aria-pressed="true"] { color: var(--color-accent); background: color-mix(in srgb, var(--color-accent) 10%, transparent); }
.vf-message-toolbar button:disabled { opacity: 0.45; cursor: default; }
.vf-message-toolbar svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.vf-toolbar-divider { height: 17px; width: 1px; background: var(--color-border); margin: 0 5px; }
.vf-message-editor.ql-container { border: 0; font: inherit; }
.vf-message-editor .ql-editor, .vf-message-fallback {
    min-height: 112px;
    max-height: 300px;
    padding: 13px 16px;
    color: var(--color-text-primary);
    font: inherit;
    font-size: var(--text-sm);
    line-height: 1.75;
    overflow-wrap: anywhere;
    overscroll-behavior: contain;
}

.vf-message-editor .ql-editor.ql-blank::before { left: 16px; right: 16px; color: var(--color-text-tertiary); font-style: normal; }
.vf-message-editor .ql-editor strong { font-weight: 700; }
.vf-message-fallback { display: block; width: 100%; border: 0; background: transparent; resize: vertical; outline: none; }
.vf-message-footer { display: flex; justify-content: space-between; gap: 12px; padding: 7px 16px 11px; color: var(--color-text-tertiary); font-size: 0.6875rem; font-variant-numeric: tabular-nums; }
.vf-message-composer.has-error { border-color: var(--color-warning); }
.vf-message-composer.has-error .vf-message-footer { color: var(--color-warning); }
.vf-message-composer [hidden], .vf-file-item--editable [hidden] { display: none; }

.vf-rich-text { white-space: normal; overflow-wrap: anywhere; line-height: 1.7; }
.vf-rich-text p, .vf-rich-text li { white-space: pre-wrap; }
.vf-rich-text p { margin: 0 0 8px; }
.vf-rich-text p:last-child { margin-bottom: 0; }
.vf-rich-text ul, .vf-rich-text ol { margin: 8px 0; padding-left: 22px; }
.vf-rich-text ul { list-style: disc; }
.vf-rich-text ol { list-style: decimal; }
.vf-rich-text li { padding-left: 2px; }
.vf-rich-text li + li { margin-top: 3px; }
.vf-rich-text strong { font-weight: 700; }

@media (max-width: 600px) {
    .vf-file-note-editor { grid-column: 1 / -1; }
    .vf-file-note-input, .vf-message-editor .ql-editor, .vf-message-fallback { font-size: 16px; }
    .vf-message-toolbar button { width: 40px; height: 40px; }
    .vf-file-note-toggle, .vf-file-note-done { min-height: 36px; }
}

@media (prefers-reduced-motion: reduce) {
    .vf-file-note-input, .vf-file-note-toggle, .vf-file-note-done, .vf-message-composer, .vf-message-toolbar button { transition: none; }
}
