/* Organize PDF pages: file summary, note and actions. The card grid and toolbar buttons are styled in tools.css. */

.org-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; margin-top: 4px; }
.org-file { min-width: 0; font-weight: 500; overflow-wrap: anywhere; }

#previewSection .drag-hint { margin: 10px 0 0; }

.org-note { margin-top: 18px; color: var(--ink-soft); font-size: .85rem; max-width: 70ch; }

#previewSection .preview-actions { margin-top: 14px; }
/* The message sits in the (sticky, on phones) action bar so it is never scrolled out of sight. */
.preview-actions .status { flex: 1 0 100%; min-height: 0; margin: 0; }

@media (max-width: 820px) {
    /* Keep the sticky bar to one row of two buttons, so it leaves room for the grid and for dragging. */
    #previewSection .preview-actions { gap: 8px; }
    #previewSection .preview-actions .btn { flex: 1 1 0; min-width: 0; padding-inline: 10px; }
}

@media (min-width: 821px) {
    /* Back on the left, the main action on the right. */
    #previewSection .preview-actions { justify-content: space-between; }
    #previewSection .preview-actions .btn { flex: 0 1 auto; min-width: 220px; }
}

/* One chip per open file, shown once there is more than one. */
.org-files { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.org-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    max-width: 100%;
    min-height: 48px;
    padding: 4px 4px 4px 12px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 999px;
}
.org-chip-text { display: grid; min-width: 0; line-height: 1.25; }
.org-chip-name { max-width: 26ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; font-weight: 500; }
.org-chip-count { color: var(--ink-soft); font-size: .8rem; font-variant-numeric: tabular-nums; }
.org-chip-remove {
    flex: none;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    color: var(--ink-soft);
    background: transparent;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
}
.org-chip-remove:hover:not(:disabled) { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }
.org-chip-remove:disabled { opacity: .35; cursor: not-allowed; }
.org-chip-remove:focus-visible { outline-offset: -2px; border-radius: 50%; }
