.biblioteca-page {
    --biblioteca-surface: var(--bg-elevated);
    --biblioteca-surface-soft: color-mix(in srgb, var(--bg-elevated) 78%, var(--bg-muted));
    --biblioteca-line: color-mix(in srgb, var(--border) 84%, transparent);
    --biblioteca-line-strong: color-mix(in srgb, var(--border-strong) 88%, var(--text-muted));
    --biblioteca-ink: var(--text);
    --biblioteca-muted: var(--text-muted);
    --biblioteca-accent: var(--primary);
    --biblioteca-radius: 8px;
    display: grid;
    align-content: start;
    gap: var(--space-5);
    min-height: calc(100vh - 132px);
}

.biblioteca-page h2,
.biblioteca-page h3,
.biblioteca-page h4,
.biblioteca-document-page h3 {
    margin: 0;
    color: var(--biblioteca-ink);
    letter-spacing: 0;
    line-height: 1.16;
}

.biblioteca-page p,
.biblioteca-muted {
    margin: 0;
    color: var(--biblioteca-muted);
    width: 100%;
}

.biblioteca-source-modal {
    --biblioteca-surface: var(--bg-elevated);
    --biblioteca-line: color-mix(in srgb, var(--border) 84%, transparent);
    --biblioteca-ink: var(--text);
    --biblioteca-muted: var(--text-muted);
    --biblioteca-radius: 8px;
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.32);
}

.biblioteca-source-modal[hidden] {
    display: none;
}

.biblioteca-source-modal__panel {
    width: min(620px, 100%);
    max-height: min(720px, calc(100vh - 48px));
    overflow: auto;
    border: 1px solid var(--biblioteca-line);
    border-radius: var(--biblioteca-radius);
    background: var(--biblioteca-surface);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.16);
}

.biblioteca-source-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--biblioteca-line);
}

.biblioteca-source-modal__head button {
    width: 34px;
    height: 34px;
    border: 1px solid var(--biblioteca-line);
    border-radius: var(--biblioteca-radius);
    background: var(--biblioteca-surface);
    color: var(--biblioteca-ink);
    cursor: pointer;
}

.biblioteca-source-modal__body {
    display: grid;
    gap: 10px;
    padding: 18px;
}

.biblioteca-source-modal__status {
    margin: 0 18px 18px;
    padding: 10px 12px;
    border-radius: var(--biblioteca-radius);
    background: color-mix(in srgb, var(--primary-soft) 42%, transparent);
    color: var(--biblioteca-ink);
}

.biblioteca-source-modal__status.is-error {
    background: color-mix(in srgb, var(--danger) 10%, var(--biblioteca-surface));
    color: var(--danger);
}

.biblioteca-source-option,
.biblioteca-source-folder,
.biblioteca-source-mode {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--biblioteca-line);
    border-radius: var(--biblioteca-radius);
    background: var(--biblioteca-surface);
}

.biblioteca-source-option {
    text-align: left;
    cursor: pointer;
}

.biblioteca-source-option span {
    color: var(--biblioteca-muted);
}

.biblioteca-source-folder {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
}

.biblioteca-source-folder button,
.biblioteca-source-back,
.biblioteca-source-mode button {
    border: 1px solid var(--biblioteca-line);
    border-radius: var(--biblioteca-radius);
    background: var(--biblioteca-surface);
    color: var(--biblioteca-ink);
    padding: 8px 10px;
    cursor: pointer;
}

.biblioteca-source-folder button:first-child {
    overflow: hidden;
    border-color: transparent;
    text-align: left;
    text-overflow: ellipsis;
}

.biblioteca-source-mode button {
    text-align: left;
}

.biblioteca-hero,
.biblioteca-panel,
.biblioteca-sidepanel,
.biblioteca-create-panel,
.biblioteca-chat-panel,
.biblioteca-mainpanel {
    border: 1px solid var(--biblioteca-line);
    border-radius: var(--biblioteca-radius);
    background: var(--biblioteca-surface);
    box-shadow: 0 12px 32px rgba(31, 31, 28, 0.06);
}

.biblioteca-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: var(--space-5);
    overflow: hidden;
    padding: 24px;
}

.biblioteca-hero::before,
.biblioteca-page > .page-actions::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: linear-gradient(180deg, var(--primary), var(--info), var(--warning));
}

.biblioteca-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(135deg, color-mix(in srgb, var(--primary-soft) 42%, transparent), transparent 58%);
}

.biblioteca-hero > *,
.biblioteca-page > .page-actions > * {
    position: relative;
    z-index: 1;
}

.biblioteca-hero h2 {
    max-width: 780px;
    margin-top: 2px;
    font-size: var(--font-2xl);
    font-weight: 850;
}

.biblioteca-hero p:not(.biblioteca-kicker) {
    max-width: 780px;
    margin-top: 7px;
}

.biblioteca-kicker {
    margin: 0;
    color: var(--biblioteca-accent);
    font-size: var(--font-xs);
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.biblioteca-hero-actions,
.biblioteca-filterbar,
.biblioteca-panel-head,
.biblioteca-sidepanel__head,
.biblioteca-view-switch,
.biblioteca-folder-list,
.biblioteca-card-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.biblioteca-hero-actions,
.biblioteca-panel-head,
.biblioteca-sidepanel__head {
    justify-content: space-between;
}

.biblioteca-hero-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.biblioteca-page > .page-actions {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--biblioteca-line);
    border-radius: var(--biblioteca-radius);
    background: var(--biblioteca-surface);
    box-shadow: 0 12px 32px rgba(31, 31, 28, 0.05);
    padding: 20px 20px 20px 24px;
}

.biblioteca-page > .page-actions h2 {
    font-size: var(--font-xl);
    font-weight: 850;
}

.biblioteca-page > .page-actions p {
    margin-top: 4px;
    max-width: 780px;
}

.biblioteca-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-4);
}

.biblioteca-stats article {
    position: relative;
    display: grid;
    min-height: 104px;
    gap: var(--space-2);
    overflow: hidden;
    border: 1px solid var(--biblioteca-line);
    border-radius: var(--biblioteca-radius);
    background: var(--biblioteca-surface);
    box-shadow: var(--shadow-card);
    padding: 15px 16px;
}

.biblioteca-stats article::before {
    content: "";
    width: 32px;
    height: 4px;
    border-radius: 999px;
    background: var(--primary);
}

.biblioteca-stats article[data-stat="resources"]::before {
    background: var(--info);
}

.biblioteca-stats article[data-stat="indexed"]::before {
    background: var(--success);
}

.biblioteca-stats article[data-stat="chats"]::before {
    background: var(--warning);
}

.biblioteca-stats span,
.biblioteca-resource-card small,
.biblioteca-message small {
    color: var(--biblioteca-muted);
    font-size: var(--font-xs);
    font-weight: 800;
}

.biblioteca-stats strong {
    color: var(--biblioteca-ink);
    font-size: var(--font-2xl);
    font-weight: 900;
    line-height: 1;
}

.biblioteca-workspace,
.biblioteca-folder-grid,
.biblioteca-page-editor {
    display: grid;
    gap: var(--space-4);
    align-items: start;
}

.biblioteca-workspace.has-create-panel {
    grid-template-columns: minmax(230px, 300px) minmax(0, 1fr) minmax(280px, 360px);
}

.biblioteca-workspace.is-wide {
    grid-template-columns: minmax(230px, 300px) minmax(0, 1fr);
}

.biblioteca-folder-grid {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
}

.biblioteca-folder-grid.is-wide {
    grid-template-columns: minmax(0, 1fr);
}

.biblioteca-collections-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    gap: var(--space-4);
    align-items: start;
}

.biblioteca-collections-layout.is-wide {
    grid-template-columns: minmax(0, 1fr);
}

.biblioteca-page-editor {
    grid-template-columns: minmax(230px, 300px) minmax(0, 1fr) minmax(280px, 360px);
}

.biblioteca-chat-layout {
    display: grid;
    grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
    gap: var(--space-4);
    align-items: start;
}

.biblioteca-panel,
.biblioteca-sidepanel,
.biblioteca-create-panel,
.biblioteca-chat-panel,
.biblioteca-mainpanel {
    padding: 18px;
}

.biblioteca-mainpanel {
    min-width: 0;
}

.biblioteca-sidepanel,
.biblioteca-create-panel {
    display: grid;
    gap: var(--space-5);
}

.biblioteca-sidepanel section,
.biblioteca-create-panel section,
.biblioteca-panel {
    min-width: 0;
}

.biblioteca-sidepanel__head,
.biblioteca-panel-head {
    margin-bottom: var(--space-3);
}

.biblioteca-sidepanel__actions,
.biblioteca-sidebar-heading-meta {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 6px;
    justify-content: flex-end;
    margin-left: auto;
    min-width: 20px;
}

.biblioteca-sidepanel h3,
.biblioteca-panel h3,
.biblioteca-create-panel h3 {
    font-size: var(--font-md);
    font-weight: 850;
}

.biblioteca-panel-head p {
    margin-top: 4px;
}

.biblioteca-stack,
.biblioteca-create-panel form,
.biblioteca-chat-composer,
.biblioteca-messages,
.biblioteca-document-page,
.biblioteca-embeds {
    display: grid;
    gap: var(--space-3);
}

.biblioteca-row-link,
.biblioteca-token-copy {
    position: relative;
    display: grid;
    gap: 3px;
    width: 100%;
    min-width: 0;
    border: 1px solid transparent;
    border-radius: var(--biblioteca-radius);
    background: var(--biblioteca-surface-soft);
    color: var(--biblioteca-ink);
    padding: 11px 12px;
    text-align: left;
    transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease;
}

.biblioteca-row-link:hover,
.biblioteca-token-copy:hover,
.biblioteca-folder-tile:hover,
.biblioteca-resource-card:hover {
    border-color: var(--biblioteca-line-strong);
    background: var(--biblioteca-surface);
    color: var(--biblioteca-ink);
    box-shadow: 0 10px 24px rgba(31, 31, 28, 0.07);
    transform: translateY(-1px);
}

.biblioteca-row-link strong,
.biblioteca-token-copy strong,
.biblioteca-resource-card h4 {
    overflow: hidden;
    text-overflow: ellipsis;
}

.biblioteca-row-link span,
.biblioteca-token-copy span {
    overflow: hidden;
    color: var(--biblioteca-muted);
    font-size: var(--font-xs);
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.biblioteca-view-switch {
    flex-wrap: wrap;
}

.biblioteca-view-switch a {
    min-height: 32px;
    border: 1px solid var(--biblioteca-line);
    border-radius: 999px;
    color: var(--biblioteca-muted);
    font-size: var(--font-xs);
    font-weight: 850;
    padding: 7px 12px;
}

.biblioteca-view-switch a.is-active,
.biblioteca-view-switch a:hover {
    border-color: color-mix(in srgb, var(--primary) 42%, var(--border));
    background: var(--primary-soft);
    color: var(--biblioteca-ink);
}

.biblioteca-view-switch.is-inline {
    margin: var(--space-4) 0;
}

.biblioteca-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-4);
    margin-top: var(--space-4);
}

.biblioteca-resource-card {
    position: relative;
    display: grid;
    align-content: start;
    gap: var(--space-3);
    min-width: 0;
    min-height: 178px;
    border: 1px solid var(--biblioteca-line);
    border-radius: var(--biblioteca-radius);
    background: var(--biblioteca-surface);
    box-shadow: var(--shadow-card);
    padding: 16px;
    transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease;
}

.biblioteca-resource-card::before {
    content: "";
    position: absolute;
    top: 14px;
    right: 14px;
    width: 28px;
    height: 4px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--primary) 72%, var(--bg-muted));
}

.biblioteca-resource-card > div:first-child {
    display: flex;
    align-items: center;
    min-height: 26px;
    gap: var(--space-2);
    padding-right: 42px;
    color: var(--biblioteca-muted);
    font-size: var(--font-xs);
    font-weight: 850;
}

.biblioteca-resource-card h4 {
    display: -webkit-box;
    min-height: 2.35em;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: var(--font-md);
    font-weight: 850;
}

.biblioteca-resource-card h4 a {
    color: inherit;
}

.biblioteca-resource-card p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.biblioteca-resource-card form {
    margin-top: auto;
}

.biblioteca-collections-list {
    display: grid;
    gap: 10px;
}

.biblioteca-collections-toolbar {
    display: grid;
    grid-template-columns: auto minmax(220px, 1fr) auto;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}

.biblioteca-collections-search {
    min-width: 0;
}

.biblioteca-menu-limit-form {
    display: inline-grid;
    grid-template-columns: auto 72px;
    gap: 8px;
    align-items: center;
    color: var(--biblioteca-muted);
    font-size: var(--font-sm);
    font-weight: 800;
}

.biblioteca-menu-limit-form .form-control {
    min-height: 34px;
    padding: 6px 8px;
}

.biblioteca-collections-toolbar .biblioteca-ajax-status {
    grid-column: 1 / -1;
}

.biblioteca-collection-row {
    overflow: hidden;
    border: 1px solid var(--biblioteca-line);
    border-radius: var(--biblioteca-radius);
    background: var(--biblioteca-surface);
}

.biblioteca-shared-collection-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
}

.biblioteca-shared-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    padding: 10px 14px;
}

.biblioteca-shared-actions form {
    margin: 0;
}

.biblioteca-collection-row[open],
.biblioteca-collection-row.is-drop-before,
.biblioteca-collection-row.is-drop-after {
    border-color: var(--biblioteca-line-strong);
}

.biblioteca-collection-row.is-dragging {
    opacity: 0.55;
}

.biblioteca-collection-row.is-drop-before {
    box-shadow: inset 0 3px 0 var(--primary);
}

.biblioteca-collection-row.is-drop-after {
    box-shadow: inset 0 -3px 0 var(--primary);
}

.biblioteca-collection-summary {
    display: grid;
    grid-template-columns: 34px 24px minmax(180px, 1fr) auto auto auto 18px;
    gap: 12px;
    align-items: center;
    min-height: 56px;
    cursor: pointer;
    list-style: none;
    padding: 10px 14px;
}

.biblioteca-collection-summary::-webkit-details-marker {
    display: none;
}

.biblioteca-collection-name {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.biblioteca-collection-name strong,
.biblioteca-collection-name small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.biblioteca-collection-name strong {
    color: var(--biblioteca-ink);
    font-weight: 900;
}

.biblioteca-collection-name small,
.biblioteca-collection-count {
    color: var(--biblioteca-muted);
    font-size: var(--font-xs);
    font-weight: 760;
}

.biblioteca-collection-chevron {
    color: var(--biblioteca-muted);
    font-size: 16px;
    line-height: 1;
    transition: transform 0.16s ease;
}

.biblioteca-collection-row[open] .biblioteca-collection-chevron {
    transform: rotate(180deg);
}

.biblioteca-collection-details {
    display: grid;
    gap: 14px;
    border-top: 1px solid var(--biblioteca-line);
    padding: 14px;
}

.biblioteca-drag-handle,
.biblioteca-collection-spacer {
    width: 30px;
    height: 30px;
}

.biblioteca-drag-handle {
    display: inline-grid;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    cursor: grab;
}

.biblioteca-drag-handle:active {
    cursor: grabbing;
}

.biblioteca-drag-handle:hover {
    border-color: var(--biblioteca-line);
    background: var(--biblioteca-surface-soft);
}

.biblioteca-drag-handle span {
    width: 4px;
    height: 4px;
    border-radius: 999px;
    background: var(--biblioteca-muted);
    box-shadow:
        7px 0 0 var(--biblioteca-muted),
        14px 0 0 var(--biblioteca-muted),
        0 7px 0 var(--biblioteca-muted),
        7px 7px 0 var(--biblioteca-muted),
        14px 7px 0 var(--biblioteca-muted),
        0 14px 0 var(--biblioteca-muted),
        7px 14px 0 var(--biblioteca-muted),
        14px 14px 0 var(--biblioteca-muted);
}

.biblioteca-share-list,
.biblioteca-share-form,
.biblioteca-collection-edit-form,
.biblioteca-delete-form {
    display: grid;
    gap: 8px;
}

.biblioteca-share-list strong,
.biblioteca-share-form label {
    color: var(--biblioteca-ink);
    font-size: var(--font-xs);
    font-weight: 900;
}

.biblioteca-share-list span {
    width: fit-content;
    max-width: 100%;
    overflow: hidden;
    border: 1px solid var(--biblioteca-line);
    border-radius: 999px;
    background: var(--biblioteca-surface-soft);
    color: var(--biblioteca-muted);
    font-size: var(--font-xs);
    font-weight: 780;
    padding: 5px 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.biblioteca-share-pill {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    margin: 0 6px 6px 0;
}

.biblioteca-share-pill span {
    width: auto;
    max-width: 260px;
    border-radius: 999px;
    padding-right: 28px;
}

.biblioteca-share-pill:hover span {
    border-radius: 999px;
}

.biblioteca-share-pill button {
    display: inline-flex;
    opacity: 0;
    pointer-events: none;
    margin-left: -26px;
    align-items: center;
    justify-content: center;
    width: 22px;
    min-height: 22px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--biblioteca-muted);
    cursor: pointer;
    font-size: 14px;
    font-weight: 900;
    line-height: 1;
}

.biblioteca-share-pill:hover button,
.biblioteca-share-pill:focus-within button {
    opacity: 1;
    pointer-events: auto;
}

.biblioteca-share-pill button:hover {
    background: var(--danger-soft);
    color: var(--danger);
}

.biblioteca-chat-toolbar {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(160px, 220px) auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 14px;
}

.biblioteca-chat-search-box {
    position: relative;
}

.biblioteca-chat-search-box input {
    padding-right: 54px;
}

.biblioteca-chat-search-box .biblioteca-ai-search-button {
    position: absolute;
    top: 50%;
    right: 5px;
    transform: translateY(-50%);
}

.biblioteca-ai-search-button {
    display: inline-grid;
    place-items: center;
    min-width: 40px;
    height: 32px;
    border: 0;
    border-radius: 8px;
    background: color-mix(in srgb, var(--primary) 58%, #ffffff);
    color: var(--biblioteca-surface);
    font-weight: 900;
    cursor: pointer;
}

.biblioteca-ai-search-button:hover {
    background: var(--primary);
}

.biblioteca-ai-search-button.is-loading {
    opacity: .72;
    cursor: wait;
}

.biblioteca-ai-search-results {
    display: grid;
    gap: 10px;
    margin: 0 0 18px;
    padding: 14px;
    border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--biblioteca-line));
    border-radius: var(--biblioteca-radius);
    background: color-mix(in srgb, var(--primary) 7%, var(--biblioteca-surface-soft));
}

.biblioteca-ai-search-results__head {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: baseline;
}

.biblioteca-ai-search-results__head span {
    color: var(--biblioteca-muted);
}

.biblioteca-ai-search-results p {
    margin: 0;
    color: var(--biblioteca-muted);
}

.biblioteca-ai-search-list {
    display: grid;
    gap: 8px;
}

.biblioteca-ai-search-item {
    display: grid;
    gap: 3px;
    padding: 10px;
    border: 1px solid var(--biblioteca-line);
    border-radius: 6px;
    color: inherit;
    text-decoration: none;
    background: var(--biblioteca-surface);
}

.biblioteca-ai-search-item:hover {
    border-color: color-mix(in srgb, var(--primary) 42%, var(--biblioteca-line));
}

.biblioteca-ai-search-item span {
    color: var(--biblioteca-ink);
    font-weight: 800;
}

.biblioteca-ai-search-item strong {
    color: var(--primary);
    font-size: var(--font-sm);
}

.biblioteca-ai-search-item em {
    color: var(--biblioteca-muted);
    font-style: normal;
}

.biblioteca-check-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--biblioteca-muted);
    font-size: var(--font-sm);
    font-weight: 800;
    white-space: nowrap;
}

.biblioteca-table-wrap {
    overflow-x: auto;
}

.biblioteca-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-sm);
}

.biblioteca-table th,
.biblioteca-table td {
    border-bottom: 1px solid var(--biblioteca-line);
    padding: 10px 8px;
    text-align: left;
    vertical-align: top;
}

.biblioteca-table th {
    color: var(--biblioteca-muted);
    font-size: var(--font-xs);
    font-weight: 900;
}

.biblioteca-inline-form {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 8px 6px 0;
}

.biblioteca-share-form {
    grid-template-columns: minmax(180px, 1fr) auto;
    align-items: center;
}

.biblioteca-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.biblioteca-chip-list span {
    max-width: 220px;
    overflow: hidden;
    border: 1px solid var(--biblioteca-line);
    border-radius: 999px;
    color: var(--biblioteca-muted);
    font-size: var(--font-xs);
    font-weight: 800;
    padding: 4px 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.biblioteca-chat-title-cell {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.biblioteca-icon-mini {
    display: inline-grid;
    place-items: center;
    width: 24px;
    min-height: 24px;
    border: 1px solid var(--biblioteca-line);
    border-radius: 6px;
    background: transparent;
    color: var(--biblioteca-muted);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
}

.biblioteca-icon-mini svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.biblioteca-icon-mini.is-active {
    color: var(--primary);
    border-color: color-mix(in srgb, var(--primary) 40%, var(--biblioteca-line));
    background: color-mix(in srgb, var(--primary-soft) 62%, transparent);
}

.biblioteca-icon-mini:hover {
    color: var(--biblioteca-ink);
}

.biblioteca-modal-form {
    display: grid;
    gap: 10px;
}

.biblioteca-pin-order {
    display: inline-flex;
    gap: 2px;
    margin-left: 4px;
}

.biblioteca-pin-order button {
    width: 20px;
    min-height: 20px;
    border: 1px solid var(--biblioteca-line);
    border-radius: 5px;
    background: transparent;
    color: var(--biblioteca-muted);
    cursor: pointer;
    font-size: 11px;
    line-height: 1;
    padding: 0;
}

.link-button {
    border: 0;
    background: transparent;
    color: var(--biblioteca-accent);
    cursor: pointer;
    font: inherit;
    font-size: var(--font-xs);
    font-weight: 900;
    padding: 0;
}

.biblioteca-user-picker {
    position: relative;
    display: grid;
    gap: 8px;
}

.biblioteca-user-picker__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.biblioteca-user-picker__chips:empty {
    display: none;
}

.biblioteca-user-picker__chips button {
    display: inline-grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 2px 8px;
    max-width: 100%;
    border: 1px solid color-mix(in srgb, var(--primary) 26%, var(--border));
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--biblioteca-ink);
    cursor: pointer;
    padding: 6px 8px 6px 10px;
    text-align: left;
}

.biblioteca-user-picker__chips span,
.biblioteca-user-picker__chips small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.biblioteca-user-picker__chips span {
    font-size: var(--font-xs);
    font-weight: 900;
}

.biblioteca-user-picker__chips small {
    grid-column: 1 / 2;
    color: var(--biblioteca-muted);
    font-size: 11px;
    font-weight: 760;
}

.biblioteca-user-picker__chips b {
    grid-column: 2 / 3;
    grid-row: 1 / 3;
    color: var(--biblioteca-muted);
    font-size: 14px;
    line-height: 1;
}

.biblioteca-user-picker__results {
    position: absolute;
    z-index: 20;
    top: calc(100% - 2px);
    right: 0;
    left: 0;
    display: grid;
    overflow: hidden;
    border: 1px solid var(--biblioteca-line-strong);
    border-radius: var(--biblioteca-radius);
    background: var(--biblioteca-surface);
    box-shadow: var(--shadow-dropdown);
}

.biblioteca-user-picker__results button,
.biblioteca-user-picker__empty {
    display: grid;
    gap: 2px;
    border: 0;
    border-bottom: 1px solid var(--biblioteca-line);
    background: transparent;
    color: var(--biblioteca-ink);
    cursor: pointer;
    padding: 10px 12px;
    text-align: left;
}

.biblioteca-user-picker__results button:last-child {
    border-bottom: 0;
}

.biblioteca-user-picker__results button:hover {
    background: var(--biblioteca-surface-soft);
}

.biblioteca-user-picker__results strong {
    overflow: hidden;
    font-size: var(--font-sm);
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.biblioteca-user-picker__results small,
.biblioteca-user-picker__empty {
    color: var(--biblioteca-muted);
    font-size: var(--font-xs);
    font-weight: 760;
}

.biblioteca-resource-table td strong,
.biblioteca-resource-table td small,
.data-table td strong,
.data-table td small {
    display: block;
}

.biblioteca-page .table-wrapper {
    border-radius: var(--biblioteca-radius);
    border-color: var(--biblioteca-line);
}

.biblioteca-page .data-table th {
    color: var(--biblioteca-muted);
    font-size: var(--font-xs);
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.biblioteca-page .data-table tbody tr {
    transition: background .14s ease;
}

.biblioteca-page .data-table tbody tr:hover {
    background: color-mix(in srgb, var(--primary-soft) 42%, transparent);
}

.biblioteca-status {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    gap: 6px;
    border: 1px solid var(--biblioteca-line);
    border-radius: 999px;
    background: var(--biblioteca-surface-soft);
    color: var(--biblioteca-ink);
    font-size: var(--font-xs);
    font-weight: 850;
    line-height: 1;
    padding: 6px 9px;
    white-space: nowrap;
}

.biblioteca-status.is-not_indexed {
    background: var(--bg-muted);
    color: var(--biblioteca-muted);
}

.biblioteca-status.is-processing,
.biblioteca-status.is-pending {
    border-color: color-mix(in srgb, var(--warning) 28%, var(--border));
    background: var(--warning-soft);
    color: color-mix(in srgb, var(--warning) 70%, var(--text));
}

.biblioteca-status.is-available,
.biblioteca-status.is-synced {
    border-color: color-mix(in srgb, var(--success) 28%, var(--border));
    background: var(--success-soft);
    color: color-mix(in srgb, var(--success) 68%, var(--text));
}

.biblioteca-status.is-error,
.biblioteca-status.is-missing {
    border-color: color-mix(in srgb, var(--danger) 28%, var(--border));
    background: var(--danger-soft);
    color: color-mix(in srgb, var(--danger) 78%, var(--text));
}

.biblioteca-ai-preferences {
    max-width: 980px;
    padding: var(--space-5);
}

.biblioteca-preferences-block {
    display: grid;
    gap: var(--space-3);
}

.biblioteca-preferences-subtitle {
    margin: 6px 0 -2px;
}

.biblioteca-demo-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 0;
    padding: 20px 28px;
    border: 1px solid var(--biblioteca-line);
    border-radius: var(--biblioteca-radius);
    background: var(--bg-muted);
    color: var(--biblioteca-ink);
}

.biblioteca-demo-toggle span {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.biblioteca-demo-toggle strong {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    line-height: 1.2;
}

.biblioteca-demo-toggle em {
    display: inline-flex;
    align-items: center;
    padding: 5px 8px;
    border-radius: 4px;
    background: var(--surface);
    color: #d9480f;
    font-size: 12px;
    font-style: normal;
    font-weight: 800;
    text-transform: uppercase;
}

.biblioteca-demo-toggle small {
    display: block;
    color: var(--biblioteca-muted);
    font-weight: 500;
    line-height: 1.35;
}

.biblioteca-demo-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.biblioteca-demo-toggle i {
    position: relative;
    flex: 0 0 58px;
    width: 58px;
    height: 30px;
    border: 1px solid var(--biblioteca-line);
    border-radius: 999px;
    background: color-mix(in srgb, var(--biblioteca-muted) 28%, var(--surface));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    transition: background 0.18s ease;
}

.biblioteca-demo-toggle i::after {
    content: "";
    position: absolute;
    top: 4px;
    left: 4px;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transition: transform 0.18s ease;
}

.biblioteca-demo-toggle i::before {
    content: "";
    position: absolute;
    inset: 3px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.biblioteca-demo-toggle input:checked + i {
    border-color: color-mix(in srgb, var(--accent) 65%, var(--biblioteca-line));
    background: var(--accent);
}

.biblioteca-demo-toggle input:checked + i::after {
    transform: translateX(28px);
}

.biblioteca-checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin: 0;
    padding: 16px 18px;
    border: 1px solid var(--biblioteca-line);
    border-radius: var(--biblioteca-radius);
    background: var(--bg-muted);
    color: var(--biblioteca-ink);
}

.biblioteca-checkbox-row input {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    margin-top: 1px;
    accent-color: var(--accent);
}

.biblioteca-checkbox-row span {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.biblioteca-checkbox-row strong,
.biblioteca-checkbox-row small {
    display: block;
    line-height: 1.35;
}

.biblioteca-checkbox-row small {
    color: var(--biblioteca-muted);
    font-weight: 500;
}

.biblioteca-chat-context-row > span {
    gap: 8px;
    width: 100%;
}

.biblioteca-inline-field {
    display: grid;
    gap: 8px;
    max-width: 520px;
    margin-top: 8px;
}

.biblioteca-inline-field > span {
    display: block;
    font-weight: 700;
}

.biblioteca-inline-field .form-control {
    width: 100%;
    max-width: 220px;
}

.biblioteca-index-dot {
    display: inline-flex;
    flex: 0 0 8px;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--biblioteca-muted);
    vertical-align: middle;
}

.biblioteca-index-dot.is-not_indexed {
    background: var(--biblioteca-muted);
}

.biblioteca-index-dot.is-processing {
    background: var(--warning);
}

.biblioteca-index-dot.is-available {
    background: var(--success);
}

.biblioteca-index-dot.is-error {
    background: var(--danger);
}

.biblioteca-empty,
.biblioteca-readonly-note {
    display: grid;
    gap: var(--space-2);
    border: 1px dashed var(--biblioteca-line-strong);
    border-radius: var(--biblioteca-radius);
    background: color-mix(in srgb, var(--bg-muted) 72%, transparent);
    color: var(--biblioteca-muted);
    padding: 16px;
}

.biblioteca-readonly-action {
    display: inline;
    margin: 0;
}

.biblioteca-text-link {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--primary);
    cursor: pointer;
    font: inherit;
    padding: 0;
    text-decoration: underline;
}

.biblioteca-filterbar {
    flex-wrap: wrap;
    align-items: end;
    border: 1px solid var(--biblioteca-line);
    border-radius: var(--biblioteca-radius);
    background: var(--biblioteca-surface-soft);
    padding: 12px;
}

.biblioteca-filterbar .form-control {
    max-width: 260px;
}

.biblioteca-folder-toolbar {
    display: grid;
    grid-template-columns: minmax(220px, 360px) 1fr;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.biblioteca-folder-toolbar__left {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
}

.biblioteca-folder-toolbar form {
    margin: 0;
}

.biblioteca-folder-toolbar .form-control {
    min-height: 36px;
}

.biblioteca-folder-view-form .form-control {
    width: 150px;
}

.biblioteca-folder-search {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-width: 0;
}

.biblioteca-folder-search .form-control {
    width: 100%;
}

.biblioteca-folder-layout {
    display: grid;
    gap: var(--space-4);
}

.biblioteca-resource-filter-panel {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    border: 1px solid var(--biblioteca-line);
    border-radius: var(--biblioteca-radius);
    background: var(--biblioteca-surface);
    box-shadow: 0 12px 32px rgba(31, 31, 28, 0.05);
    padding: 14px 16px;
}

.biblioteca-resource-filter-panel[hidden] {
    display: none !important;
}

.biblioteca-resource-filter-panel form {
    margin: 0;
}

.biblioteca-resource-filter-panel .biblioteca-folder-search {
    flex: 0 1 340px;
    margin-left: auto;
}

.biblioteca-resource-filter-panel .biblioteca-results-count {
    flex: 0 0 auto;
}

.biblioteca-resource-filter-panel .biblioteca-folder-search .form-control {
    min-height: 32px;
    padding: 6px 12px;
}

.biblioteca-resource-filter-panel .biblioteca-ajax-status {
    margin-left: 0;
}

.biblioteca-ajax-status {
    color: var(--biblioteca-muted);
    font-size: var(--font-xs);
    font-weight: 800;
    justify-self: end;
}

.biblioteca-ajax-status.is-error {
    color: var(--danger);
}

.biblioteca-resource-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
}

.biblioteca-resource-controls label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--biblioteca-muted);
    font-size: var(--font-xs);
    font-weight: 800;
}

.biblioteca-resource-controls input[type="checkbox"] {
    accent-color: var(--primary);
}

.biblioteca-resource-controls .btn.is-active {
    border-color: color-mix(in srgb, var(--primary) 42%, var(--border));
    background: var(--primary-soft);
    color: var(--biblioteca-ink);
}

.biblioteca-resource-controls .btn {
    min-height: 32px;
    padding: 6px 10px;
}

.biblioteca-resource-list {
    display: grid;
    gap: var(--space-4);
}

.biblioteca-resource-results-panel {
    border: 0;
    background: transparent;
    box-shadow: none;
    padding: 0;
}

.biblioteca-tag-resource-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    border-bottom: 1px solid var(--biblioteca-line);
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
}

.biblioteca-tag-resource-header h2,
.biblioteca-tag-resource-header p {
    margin: 0;
}

.biblioteca-tag-resource-header p {
    color: var(--biblioteca-muted);
    font-size: var(--font-sm);
    font-weight: 750;
}

.biblioteca-tags-inline-search {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-left: auto;
    min-width: min(100%, 420px);
}

.biblioteca-results-count,
.biblioteca-tags-inline-search span {
    color: var(--biblioteca-muted);
    font-size: var(--font-sm);
    font-weight: 750;
    white-space: nowrap;
}

.biblioteca-tags-inline-search .form-control {
    min-width: 260px;
}

.biblioteca-resource-item {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: var(--space-4);
    border: 1px solid var(--biblioteca-line);
    border-radius: var(--biblioteca-radius);
    background: var(--biblioteca-surface);
    box-shadow: var(--shadow-card);
    padding: 18px;
}

.biblioteca-resource-item.is-selected {
    border-color: color-mix(in srgb, var(--primary) 50%, var(--border));
    box-shadow: 0 14px 36px rgba(31, 31, 28, 0.10);
}

.biblioteca-resource-select {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding-top: 3px;
}

.biblioteca-resource-select form {
    margin: 0;
}

.biblioteca-star {
    border: 0;
    background: transparent;
    color: var(--biblioteca-muted);
    cursor: pointer;
    font: inherit;
    font-size: 20px;
    line-height: 1;
    padding: 0;
}

.biblioteca-star.is-active {
    color: var(--warning);
}

.biblioteca-star--collection,
.biblioteca-star--sidebar,
.biblioteca-star--sidebar-filter {
    font-size: 12px;
}

.biblioteca-star--sidebar,
.biblioteca-star--sidebar-filter {
    min-width: 14px;
}

.biblioteca-sidebar-collection-row {
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr);
    gap: 3px;
    align-items: center;
}

.biblioteca-sidebar-collection-row .biblioteca-tree-link {
    min-width: 0;
}

.biblioteca-file-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: var(--biblioteca-ink);
}

.biblioteca-file-badge svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.biblioteca-file-badge .biblioteca-index-dot {
    position: absolute;
    right: -3px;
    bottom: -3px;
    border: 2px solid var(--biblioteca-surface);
}

.biblioteca-resource-body {
    display: contents;
    min-width: 0;
}

.biblioteca-resource-item-head {
    display: flex;
    grid-column: 2;
    min-height: 24px;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
}

.biblioteca-resource-item-head h3 {
    font-size: var(--font-md);
}

.biblioteca-resource-item-head p,
.biblioteca-resource-breadcrumb,
.biblioteca-resource-actions {
    margin-top: 5px;
    color: var(--biblioteca-muted);
    font-size: var(--font-xs);
    font-weight: 750;
}

.biblioteca-resource-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: 0;
}

.biblioteca-resource-breadcrumb {
    grid-column: 1 / -1;
    margin: 0;
}

.biblioteca-resource-menu {
    position: relative;
}

.biblioteca-resource-menu summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    color: var(--biblioteca-muted);
    cursor: pointer;
    list-style: none;
}

.biblioteca-resource-menu summary::-webkit-details-marker {
    display: none;
}

.biblioteca-resource-menu summary:hover {
    background: var(--bg-muted);
    color: var(--biblioteca-ink);
}

.biblioteca-resource-menu > div {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 10;
    display: grid;
    min-width: 190px;
    border: 1px solid var(--biblioteca-line);
    border-radius: var(--biblioteca-radius);
    background: var(--biblioteca-surface);
    box-shadow: var(--shadow-popover);
    padding: 6px;
}

.biblioteca-resource-menu a,
.biblioteca-resource-menu button {
    width: 100%;
    border: 0;
    background: transparent;
    border-radius: 6px;
    color: var(--biblioteca-muted);
    cursor: pointer;
    font-size: var(--font-sm);
    font-weight: 750;
    padding: 9px 10px;
    text-align: left;
}

.biblioteca-resource-menu a:hover,
.biblioteca-resource-menu button:hover {
    background: var(--bg-muted);
    color: var(--biblioteca-ink);
}

.biblioteca-modal[hidden] {
    display: none;
}

.biblioteca-modal {
    position: fixed;
    z-index: 1000;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 20px;
}

.biblioteca-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.34);
}

.biblioteca-modal__panel {
    position: relative;
    z-index: 1;
    display: grid;
    width: min(420px, 100%);
    gap: var(--space-4);
    border: 1px solid var(--biblioteca-line);
    border-radius: var(--biblioteca-radius);
    background: var(--biblioteca-surface);
    box-shadow: var(--shadow-dropdown);
    padding: 20px;
}

.biblioteca-note-modal-panel {
    width: min(720px, 100%);
    max-height: min(88vh, 860px);
    overflow: auto;
}

.biblioteca-note-modal-head {
    display: grid;
    gap: 4px;
}

.biblioteca-note-form {
    display: grid;
    gap: 14px;
}

.biblioteca-note-form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.biblioteca-note-form-buttons {
    display: flex;
    gap: 10px;
}

.biblioteca-note-visibility-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--biblioteca-muted);
    font-weight: 700;
}

.biblioteca-note-list-section {
    display: grid;
    gap: 14px;
    padding-top: 6px;
}

.biblioteca-note-list-section h4 {
    font-size: var(--font-md);
}

.biblioteca-note-list {
    display: grid;
    gap: 14px;
}

.biblioteca-note-entry {
    display: grid;
    gap: 10px;
    border: 1px solid var(--biblioteca-line);
    border-radius: var(--biblioteca-radius);
    background: color-mix(in srgb, var(--biblioteca-surface) 88%, var(--bg-muted));
    padding: 16px;
}

.biblioteca-note-entry.is-empty {
    color: var(--biblioteca-muted);
}

.biblioteca-note-entry__head,
.biblioteca-note-entry__actions,
.biblioteca-resource-inline-actions,
.biblioteca-notes-toolbar,
.biblioteca-note-card__actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.biblioteca-note-entry__head,
.biblioteca-resource-inline-actions {
    justify-content: space-between;
}

.biblioteca-note-entry__body {
    color: var(--biblioteca-ink);
    line-height: 1.55;
}

.biblioteca-note-entry small,
.biblioteca-note-card__summary p,
.biblioteca-note-card__summary small {
    color: var(--biblioteca-muted);
}

.biblioteca-modal__panel h3,
.biblioteca-modal__panel p {
    margin: 0;
}

.biblioteca-modal__panel h3 {
    padding-right: 34px;
    font-size: var(--font-lg);
    font-weight: 850;
}

.biblioteca-modal__panel p {
    color: var(--biblioteca-muted);
}

.biblioteca-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid var(--biblioteca-line);
    border-radius: 7px;
    background: var(--biblioteca-surface);
    color: var(--biblioteca-muted);
    cursor: pointer;
    font-size: 18px;
    font-weight: 900;
    line-height: 1;
}

.biblioteca-modal__close:hover {
    border-color: var(--biblioteca-line-strong);
    color: var(--biblioteca-ink);
}

.biblioteca-loading-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: end center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.18);
}

.biblioteca-loading-modal.is-hiding {
    opacity: 0;
}

.biblioteca-loading-modal__panel {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 240px;
    max-width: min(420px, 90vw);
    border: 1px solid var(--biblioteca-line);
    border-radius: 8px;
    background: var(--biblioteca-surface);
    color: var(--biblioteca-ink);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
    padding: 14px 16px;
}

.biblioteca-loading-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--biblioteca-line-strong);
    border-top-color: var(--primary);
    border-radius: 999px;
    animation: biblioteca-spin 780ms linear infinite;
}

@keyframes biblioteca-spin {
    to { transform: rotate(360deg); }
}

body.biblioteca-modal-open {
    overflow: hidden;
}

.biblioteca-resource-tags {
    display: flex;
    grid-column: 1 / -1;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.biblioteca-resource-tags span,
.biblioteca-resource-tags a,
.biblioteca-resource-collections a {
    border-radius: 999px;
    background: var(--bg-muted);
    color: var(--biblioteca-muted);
    font-size: var(--font-xs);
    font-weight: 850;
    padding: 4px 9px;
    text-decoration: none;
}

.biblioteca-resource-tags a:hover,
.biblioteca-resource-collections a:hover {
    color: var(--biblioteca-ink);
    background: color-mix(in srgb, var(--primary-soft) 72%, var(--biblioteca-surface));
}

.biblioteca-resource-collections {
    display: flex;
    grid-column: 1 / -1;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.biblioteca-resource-summary {
    grid-column: 1 / -1;
    border-left: 4px solid var(--primary);
    border-radius: 6px;
    background: color-mix(in srgb, var(--bg-muted) 66%, transparent);
    color: var(--biblioteca-muted);
    line-height: 1.55;
    padding: 12px 14px;
}

.biblioteca-resource-viewer {
    grid-column: 1 / -1;
    overflow: hidden;
    min-height: 320px;
    border-radius: var(--biblioteca-radius);
    background: var(--bg-muted);
}

.biblioteca-resource-viewer iframe,
.biblioteca-resource-viewer video {
    display: block;
    width: 100%;
    min-height: 420px;
    border: 0;
}

.biblioteca-resource-file-preview {
    display: flex;
    grid-column: 1 / -1;
    align-items: center;
    gap: var(--space-3);
    border: 1px dashed var(--biblioteca-line-strong);
    border-radius: var(--biblioteca-radius);
    background: color-mix(in srgb, var(--bg-muted) 66%, transparent);
    padding: 16px;
}

.biblioteca-resource-file-preview p {
    margin-top: 3px;
    font-size: var(--font-sm);
}

.sr-only {
    position: absolute;
    overflow: hidden;
    width: 1px;
    height: 1px;
    margin: -1px;
    clip: rect(0, 0, 0, 0);
}

.biblioteca-explorer {
    position: relative;
    display: grid;
    grid-template-columns: minmax(180px, var(--biblioteca-tree-width, 280px)) 8px minmax(0, 1fr) 8px minmax(280px, var(--biblioteca-inspector-width, 380px));
    min-height: 0;
    height: calc(100vh - 168px);
    overflow: hidden;
    border: 1px solid var(--biblioteca-line);
    border-radius: var(--biblioteca-radius);
    background: var(--biblioteca-surface);
    box-shadow: 0 16px 40px rgba(31, 31, 28, 0.07);
}

.biblioteca-explorer.is-tree-collapsed {
    grid-template-columns: 58px 8px minmax(0, 1fr) 8px minmax(280px, var(--biblioteca-inspector-width, 380px));
}

.biblioteca-explorer.is-inspector-collapsed {
    grid-template-columns: minmax(180px, var(--biblioteca-tree-width, 280px)) 8px minmax(0, 1fr) 8px 58px;
}

.biblioteca-explorer.is-tree-collapsed.is-inspector-collapsed {
    grid-template-columns: 58px 8px minmax(0, 1fr) 8px 58px;
}

.biblioteca-explorer-tree,
.biblioteca-inspector {
    display: grid;
    align-content: start;
    gap: var(--space-3);
    min-height: 0;
    min-width: 0;
    overflow: hidden;
    background: var(--biblioteca-surface-soft);
    padding: 14px;
}

.biblioteca-explorer-tree {
    border-right: 1px solid var(--biblioteca-line);
}

.biblioteca-inspector {
    border-left: 1px solid var(--biblioteca-line);
    overflow-y: auto;
    padding-bottom: 28px;
    scrollbar-color: color-mix(in srgb, var(--biblioteca-muted) 34%, transparent) transparent;
    scrollbar-width: thin;
}

.biblioteca-toolbar-icon-form {
    margin: 0;
}

.biblioteca-inspector.is-expanded {
    position: fixed;
    inset: 48px;
    z-index: 80;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: auto;
    border: 1px solid var(--biblioteca-line-strong);
    border-radius: var(--biblioteca-radius);
    background: var(--biblioteca-surface);
    box-shadow: var(--shadow-popover);
}

.biblioteca-explorer-head,
.biblioteca-inspector-head,
.biblioteca-explorer-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

.biblioteca-explorer-toolbar > .biblioteca-results-count {
    flex: 0 0 auto;
}

.biblioteca-explorer.is-tree-collapsed .biblioteca-explorer-tree {
    justify-items: center;
    padding-inline: 10px;
}

.biblioteca-explorer.is-tree-collapsed .biblioteca-explorer-head {
    display: grid;
    justify-items: center;
}

.biblioteca-explorer.is-tree-collapsed .biblioteca-explorer-head strong,
.biblioteca-explorer.is-tree-collapsed .biblioteca-folder-tree a span:last-child {
    display: none;
}

.biblioteca-explorer.is-tree-collapsed .biblioteca-folder-tree a {
    grid-template-columns: 18px;
    justify-content: center;
    padding: 8px;
}

.biblioteca-explorer.is-inspector-collapsed .biblioteca-inspector {
    justify-items: center;
    padding-inline: 10px;
}

.biblioteca-explorer.is-inspector-collapsed .biblioteca-inspector-head {
    display: grid;
    justify-items: center;
}

.biblioteca-explorer.is-inspector-collapsed .biblioteca-inspector-head strong,
.biblioteca-explorer.is-inspector-collapsed .biblioteca-inspector > :not(.biblioteca-inspector-head) {
    display: none;
}

.biblioteca-resizer {
    width: 8px;
    min-width: 8px;
    background: transparent;
    cursor: col-resize;
}

.biblioteca-resizer:hover,
.biblioteca-resizer.is-active {
    background: color-mix(in srgb, var(--primary) 22%, transparent);
}

.biblioteca-explorer.is-tree-collapsed .biblioteca-resizer.is-left,
.biblioteca-explorer.is-inspector-collapsed .biblioteca-resizer.is-right {
    cursor: default;
}

.biblioteca-explorer-head strong,
.biblioteca-inspector-head strong {
    min-width: 0;
    overflow: hidden;
    color: var(--biblioteca-ink);
    font-size: var(--font-sm);
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.biblioteca-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid var(--biblioteca-line);
    border-radius: 7px;
    background: var(--biblioteca-surface);
    color: var(--biblioteca-ink);
    cursor: pointer;
    font-weight: 900;
}

.biblioteca-icon-btn:hover,
.biblioteca-sidebar-add:hover {
    border-color: var(--biblioteca-line-strong);
    background: var(--biblioteca-surface-soft);
    color: var(--biblioteca-ink);
}

.biblioteca-folder-tree {
    display: grid;
    gap: 3px;
    min-height: 0;
    overflow: auto;
    max-height: none;
    padding-right: 2px;
}

.biblioteca-folder-tree a {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    border-radius: 7px;
    color: var(--biblioteca-muted);
    font-size: var(--font-sm);
    font-weight: 780;
    padding: 7px 8px 7px calc(8px + (var(--depth, 0) * 18px));
}

.biblioteca-folder-tree a:hover,
.biblioteca-folder-tree a.is-active,
.biblioteca-file-tile.is-selected {
    background: color-mix(in srgb, var(--primary-soft) 72%, var(--biblioteca-surface));
    color: var(--biblioteca-ink);
}

.biblioteca-folder-tree a:focus,
.biblioteca-folder-tree a:focus-visible {
    outline: none;
    box-shadow: none;
}

.biblioteca-folder-tree a > span:not(.biblioteca-tree-toggle),
.biblioteca-file-tile strong {
    display: block;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.biblioteca-folder-tree a small {
    color: var(--biblioteca-muted);
    font-size: var(--font-xs);
    font-weight: 850;
    justify-self: end;
}

.biblioteca-tree-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 5px;
    color: var(--biblioteca-muted);
    font-size: 18px;
    font-weight: 900;
    line-height: 1;
}

.biblioteca-folder-tree a.has-children .biblioteca-tree-toggle::before {
    content: "›";
}

.biblioteca-folder-tree a.has-children.is-open .biblioteca-tree-toggle::before {
    content: "⌄";
}

.biblioteca-folder-tree a.has-children .biblioteca-tree-toggle:hover {
    background: var(--bg-muted);
    color: var(--biblioteca-ink);
}

.biblioteca-folder-tree a.is-hidden-by-tree {
    display: none;
}

.biblioteca-folder-icon {
    display: inline-block;
    width: 18px;
    height: 13px;
    border-radius: 3px;
    background: color-mix(in srgb, var(--warning) 76%, var(--biblioteca-surface));
    box-shadow: inset 0 0 0 1px rgba(31, 31, 28, 0.14);
}

.biblioteca-folder-icon::before {
    content: "";
    display: block;
    width: 9px;
    height: 4px;
    margin-top: -3px;
    margin-left: 2px;
    border-radius: 2px 2px 0 0;
    background: color-mix(in srgb, var(--warning) 70%, var(--biblioteca-surface));
}

.biblioteca-explorer-main {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    gap: var(--space-4);
    min-height: 0;
    min-width: 0;
    overflow: hidden;
    padding: 14px;
}

.biblioteca-breadcrumb {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    color: var(--biblioteca-muted);
    font-size: var(--font-sm);
    font-weight: 750;
}

.biblioteca-breadcrumb a {
    color: inherit;
}

.biblioteca-breadcrumb strong {
    min-width: 0;
    overflow: hidden;
    color: var(--biblioteca-ink);
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.biblioteca-explorer-search {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    flex: 1 1 360px;
    min-width: 0;
}

.biblioteca-display-switch {
    display: inline-flex;
    flex: 0 0 auto;
    gap: 4px;
    border: 1px solid var(--biblioteca-line);
    border-radius: 8px;
    background: var(--biblioteca-surface-soft);
    padding: 3px;
}

.biblioteca-display-switch a {
    border-radius: 6px;
    color: var(--biblioteca-muted);
    font-size: var(--font-xs);
    font-weight: 850;
    padding: 6px 9px;
}

.biblioteca-display-switch a.is-active,
.biblioteca-display-switch a:hover {
    background: var(--biblioteca-surface);
    color: var(--biblioteca-ink);
}

.biblioteca-explorer-search .form-control {
    min-height: 34px;
    max-width: 220px;
}

.biblioteca-explorer-search .biblioteca-compact-select {
    width: auto;
    min-width: 86px;
    max-width: 104px;
}

.biblioteca-file-grid {
    display: grid;
    grid-template-columns: repeat(var(--biblioteca-grid-columns, 4), minmax(0, 1fr));
    align-content: start;
    gap: 12px;
    min-height: 0;
    overflow: auto;
    padding: 2px;
    scrollbar-color: color-mix(in srgb, var(--biblioteca-muted) 34%, transparent) transparent;
    scrollbar-width: thin;
}

.biblioteca-file-grid::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

.biblioteca-file-grid::-webkit-scrollbar-track {
    background: transparent;
}

.biblioteca-file-grid::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: color-mix(in srgb, var(--biblioteca-muted) 28%, transparent);
}

.biblioteca-file-grid::-webkit-scrollbar-thumb:hover {
    background: color-mix(in srgb, var(--biblioteca-muted) 45%, transparent);
}

.biblioteca-file-grid.is-list {
    grid-template-columns: 1fr;
    gap: 4px;
}

.biblioteca-file-list-head {
    display: grid;
    grid-template-columns: 26px 34px minmax(0, 1fr) 72px minmax(140px, auto);
    align-items: center;
    gap: 7px;
    min-height: 30px;
    border-bottom: 1px solid var(--biblioteca-line);
    color: var(--biblioteca-muted);
    font-size: var(--font-xs);
    font-weight: 500;
    padding: 0 10px 5px;
}

.biblioteca-file-grid.is-list.is-all-files .biblioteca-file-list-head,
.biblioteca-file-grid.is-list.is-all-files .biblioteca-file-tile {
    grid-template-columns: 26px 34px minmax(0, 1fr) minmax(150px, 220px) 72px auto;
}

.biblioteca-file-folder {
    overflow: hidden;
    color: var(--biblioteca-muted);
    font-size: var(--font-xs);
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.biblioteca-bulk-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    color: var(--biblioteca-muted);
    font-size: var(--font-xs);
    font-weight: 750;
}

.biblioteca-bulk-actions form {
    margin: 0;
}

.biblioteca-file-list-head a {
    color: inherit;
    font-weight: 500;
}

.biblioteca-file-list-head a:hover,
.biblioteca-file-list-head a.is-active {
    color: var(--biblioteca-ink);
}

.biblioteca-file-list-head a.is-active::after {
    content: " ↑";
}

.biblioteca-file-list-head a.is-active.is-desc::after {
    content: " ↓";
}

.biblioteca-file-list-head > span:last-child {
    display: flex;
    justify-content: flex-end;
    gap: 14px;
    text-align: right;
}

.biblioteca-file-grid.is-list .biblioteca-file-tile {
    grid-template-columns: 26px 34px minmax(0, 1fr) 72px auto;
    align-items: center;
    justify-items: stretch;
    min-height: 48px;
    padding: 8px 10px;
    text-align: left;
}

.biblioteca-file-select {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
}

.biblioteca-file-select input,
.biblioteca-file-list-head input {
    width: 15px;
    height: 15px;
    margin: 0;
    accent-color: var(--primary);
}

.biblioteca-file-grid.is-grid .biblioteca-file-select {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 1;
}

.biblioteca-file-list-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 72px;
}

.biblioteca-file-grid.is-list .biblioteca-file-tile .biblioteca-folder-icon {
    width: 28px;
    height: 34px;
    margin: 0;
}

.biblioteca-file-grid.is-list .biblioteca-file-tile .biblioteca-folder-icon::before {
    top: 5px;
    left: 4px;
    width: 12px;
    height: 5px;
}

.biblioteca-file-grid.is-list .biblioteca-file-tile .biblioteca-folder-icon::after {
    top: 9px;
    height: 20px;
}

.biblioteca-file-grid.is-list .biblioteca-file-type {
    width: 28px;
    height: 34px;
    font-size: 9px;
}

.biblioteca-file-grid.is-list .biblioteca-file-tile small {
    justify-content: flex-end;
    gap: 14px;
    min-width: 140px;
    text-align: right;
}

.biblioteca-file-tile {
    position: relative;
    display: grid;
    align-content: start;
    justify-items: center;
    gap: 7px;
    min-height: 112px;
    min-width: 0;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--biblioteca-ink);
    padding: 11px 9px;
    text-align: center;
}

.biblioteca-file-tile:hover {
    border-color: var(--biblioteca-line);
    background: var(--biblioteca-surface-soft);
}

.biblioteca-file-tile.is-dragging,
.biblioteca-folder-tree a.is-dragging {
    opacity: .42;
}

.biblioteca-drop-placeholder {
    min-height: 112px;
    border: 2px dashed color-mix(in srgb, var(--primary) 58%, var(--border));
    border-radius: 8px;
    background: color-mix(in srgb, var(--primary-soft) 62%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 18%, transparent);
    animation: bibliotecaDropOpen .12s ease-out;
}

@keyframes bibliotecaDropOpen {
    from {
        opacity: 0;
        transform: scale(.96);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.biblioteca-drop-placeholder.is-grid {
    min-width: 96px;
}

.biblioteca-drop-placeholder.is-list {
    min-height: 48px;
}

.biblioteca-drop-placeholder.is-tree {
    min-height: 34px;
    margin: 3px 0;
}

.biblioteca-folder-tree a.is-drop-inside,
.biblioteca-file-tile.is-drop-inside {
    outline: 2px solid color-mix(in srgb, var(--primary) 62%, transparent);
    outline-offset: -2px;
}

.biblioteca-folder-tree a.is-drop-before,
.biblioteca-file-tile.is-drop-before {
    box-shadow: inset 0 3px 0 var(--primary);
}

.biblioteca-folder-tree a.is-drop-after,
.biblioteca-file-tile.is-drop-after {
    box-shadow: inset 0 -3px 0 var(--primary);
}

.biblioteca-file-tile small {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    gap: 5px;
    overflow: hidden;
    color: var(--biblioteca-muted);
    font-size: var(--font-xs);
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.biblioteca-file-meta span:last-child {
    min-width: 56px;
    color: var(--biblioteca-ink);
}

.biblioteca-file-tile .biblioteca-folder-icon {
    position: relative;
    width: 42px;
    height: 54px;
    margin: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.biblioteca-file-tile .biblioteca-folder-icon::before {
    position: absolute;
    top: 8px;
    left: 5px;
    z-index: 1;
    width: 17px;
    height: 8px;
    margin: 0;
    border: 1px solid color-mix(in srgb, var(--warning) 66%, #7c5b08);
    border-bottom: 0;
    border-radius: 5px 5px 0 0;
    background: color-mix(in srgb, var(--warning) 84%, var(--biblioteca-surface));
    box-shadow: none;
}

.biblioteca-file-tile .biblioteca-folder-icon::after {
    content: "";
    position: absolute;
    top: 14px;
    left: 0;
    width: 100%;
    height: 31px;
    border: 1px solid color-mix(in srgb, var(--warning) 62%, #6f5209);
    border-radius: 7px;
    background:
        linear-gradient(
            180deg,
            color-mix(in srgb, var(--warning) 88%, var(--biblioteca-surface)) 0%,
            color-mix(in srgb, var(--warning) 78%, #8a6105) 100%
        );
    box-shadow:
        inset 0 1px 0 color-mix(in srgb, #fff 36%, transparent),
        0 1px 2px rgba(31, 31, 28, 0.14);
}

.biblioteca-file-type {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 54px;
    border: 1px solid var(--biblioteca-line);
    border-radius: 7px;
    background: var(--biblioteca-surface);
    color: var(--biblioteca-muted);
    font-size: 11px;
    font-weight: 900;
}

.biblioteca-file-open {
    cursor: pointer;
}

.biblioteca-file-open:hover {
    border-color: var(--biblioteca-accent);
    color: var(--biblioteca-accent);
}

.biblioteca-dropzone {
    display: grid;
    gap: 5px;
    width: 100%;
    min-height: 112px;
    border: 1px dashed var(--biblioteca-line-strong);
    border-radius: 8px;
    background: var(--biblioteca-surface);
    color: var(--biblioteca-muted);
    cursor: pointer;
    padding: 18px;
    text-align: center;
}

.biblioteca-dropzone strong {
    color: var(--biblioteca-ink);
}

.biblioteca-dropzone.is-dragover {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.biblioteca-inspector-form,
.biblioteca-dropzone-form,
.biblioteca-preview,
.biblioteca-editor-shell {
    display: grid;
    gap: var(--space-3);
}

.biblioteca-inspector-form label {
    display: grid;
    gap: 6px;
    color: var(--biblioteca-ink);
    font-size: var(--font-sm);
    font-weight: 850;
}

.biblioteca-preview {
    overflow: hidden;
    min-height: 210px;
    border: 1px solid var(--biblioteca-line);
    border-radius: 8px;
    background: var(--biblioteca-surface);
}

.biblioteca-preview iframe {
    display: block;
    width: 100%;
    min-height: 260px;
    border: 0;
}

.biblioteca-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.biblioteca-editor-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

.biblioteca-editor-shell.is-expanded {
    position: fixed;
    inset: 48px;
    z-index: 90;
    grid-template-rows: auto auto auto minmax(0, 1fr);
    overflow: auto;
    border: 1px solid var(--biblioteca-line-strong);
    border-radius: 8px;
    background: var(--biblioteca-surface);
    box-shadow: var(--shadow-popover);
    padding: 18px;
}

.biblioteca-editor-shell.is-expanded .biblioteca-wysiwyg {
    min-height: min(620px, calc(100vh - 250px));
}

.biblioteca-editor-toolbar button {
    min-height: 30px;
    border: 1px solid var(--biblioteca-line);
    border-radius: 6px;
    background: var(--biblioteca-surface);
    color: var(--biblioteca-muted);
    cursor: pointer;
    font-size: var(--font-xs);
    font-weight: 850;
    padding: 5px 8px;
}

.biblioteca-editor-toolbar button:hover {
    background: var(--bg-muted);
    color: var(--biblioteca-ink);
}

.biblioteca-wysiwyg {
    min-height: 240px;
    overflow: auto;
    border: 1px solid var(--biblioteca-line);
    border-radius: 8px;
    background: var(--biblioteca-surface);
    color: var(--biblioteca-ink);
    padding: 12px;
}

.biblioteca-context-menu {
    position: fixed;
    z-index: 100;
    display: grid;
    min-width: 180px;
    border: 1px solid var(--biblioteca-line);
    border-radius: 8px;
    background: var(--biblioteca-surface);
    box-shadow: var(--shadow-popover);
    padding: 6px;
}

.biblioteca-context-menu[hidden] {
    display: none !important;
}

.biblioteca-toast-stack {
    position: fixed;
    right: 24px;
    bottom: 42px;
    z-index: 120;
    display: grid;
    gap: 10px;
    width: min(420px, calc(100vw - 32px));
    pointer-events: none;
}

.biblioteca-toast {
    border: 1px solid var(--biblioteca-line);
    border-radius: 8px;
    background: var(--biblioteca-surface);
    box-shadow: var(--shadow-popover);
    color: var(--biblioteca-ink);
    font-size: var(--font-sm);
    font-weight: 850;
    padding: 13px 15px;
    transition: opacity .2s ease, transform .2s ease;
    pointer-events: auto;
}

.biblioteca-sync-log {
    max-height: 260px;
    overflow: auto;
    margin: 10px 0 0;
    padding: 10px;
    border: 1px solid var(--biblioteca-line);
    border-radius: 7px;
    background: var(--biblioteca-page);
    color: var(--biblioteca-ink);
    font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-weight: 500;
    white-space: pre-wrap;
    user-select: text;
}

.biblioteca-toast.is-success {
    border-color: color-mix(in srgb, var(--success) 36%, var(--border));
    background: color-mix(in srgb, var(--success-soft) 68%, var(--biblioteca-surface));
}

.biblioteca-toast.is-error {
    border-color: color-mix(in srgb, var(--danger) 36%, var(--border));
    background: color-mix(in srgb, var(--danger-soft) 68%, var(--biblioteca-surface));
}

.biblioteca-toast.is-running {
    border-color: color-mix(in srgb, var(--warning) 36%, var(--border));
    background: color-mix(in srgb, var(--warning-soft) 62%, var(--biblioteca-surface));
}

.biblioteca-toast.is-hiding {
    opacity: 0;
    transform: translateY(8px);
}

.biblioteca-upload-queue {
    position: fixed;
    right: 22px;
    bottom: 28px;
    z-index: 140;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 10px;
    width: min(420px, calc(100vw - 32px));
    max-height: min(340px, calc(100vh - 96px));
    overflow: hidden;
    border: 1px solid var(--biblioteca-line-strong);
    border-radius: 8px;
    background: color-mix(in srgb, var(--biblioteca-surface) 96%, #ffffff);
    box-shadow: var(--shadow-popover);
    color: var(--biblioteca-ink);
    padding: 12px;
    isolation: isolate;
}

.biblioteca-upload-queue header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--biblioteca-line);
    padding-bottom: 9px;
}

.biblioteca-upload-queue__actions,
.biblioteca-upload-queue p {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.biblioteca-upload-queue header strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.biblioteca-upload-queue__actions {
    flex: 0 0 auto;
}

.biblioteca-upload-queue__actions button {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 1px solid var(--biblioteca-line);
    border-radius: 999px;
    background: var(--biblioteca-surface);
    color: var(--biblioteca-ink);
    cursor: pointer;
    font-size: 17px;
    font-weight: 800;
    line-height: 1;
}

.biblioteca-upload-queue div {
    display: grid;
    gap: 5px;
    max-height: 260px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 2px;
}

.biblioteca-upload-queue p {
    margin: 0;
    border-radius: 6px;
    background: var(--bg-muted);
    font-size: var(--font-xs);
    padding: 7px 8px;
}

.biblioteca-upload-queue p span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.biblioteca-upload-queue small {
    flex: 0 0 auto;
    color: var(--biblioteca-muted);
    font-weight: 850;
}

.biblioteca-upload-queue p.is-running small {
    color: var(--warning);
}

.biblioteca-upload-queue p.is-done small {
    color: var(--success);
}

.biblioteca-upload-queue p.is-error small {
    color: var(--danger);
}

.biblioteca-context-menu button {
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--biblioteca-ink);
    cursor: pointer;
    font: inherit;
    font-size: var(--font-sm);
    font-weight: 750;
    padding: 9px 10px;
    text-align: left;
}

.biblioteca-context-menu button:hover {
    background: var(--bg-muted);
}

.biblioteca-hide-tags [data-biblioteca-section="tags"],
.biblioteca-hide-collections [data-biblioteca-section="collections"],
.biblioteca-hide-summary [data-biblioteca-section="summary"],
.biblioteca-hide-viewer [data-biblioteca-section="viewer"] {
    display: none;
}

.biblioteca-notes-panel {
    display: grid;
    gap: 18px;
    padding: 20px;
}

.biblioteca-notes-toolbar {
    justify-content: space-between;
    flex-wrap: wrap;
}

.biblioteca-notes-filter-form {
    display: inline-flex;
}

.biblioteca-notes-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.biblioteca-notes-list {
    display: grid;
    gap: 16px;
}

.biblioteca-note-card {
    border: 1px solid var(--biblioteca-line);
    border-radius: var(--biblioteca-radius);
    background: var(--biblioteca-surface);
}

.biblioteca-note-card[open] {
    box-shadow: 0 14px 30px rgba(31, 31, 28, 0.08);
}

.biblioteca-note-card__summary {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    cursor: pointer;
    list-style: none;
    padding: 18px;
}

.biblioteca-note-card__summary::-webkit-details-marker {
    display: none;
}

.biblioteca-note-card__main {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.biblioteca-note-card__title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.biblioteca-note-card__body {
    color: var(--biblioteca-ink);
    line-height: 1.55;
}

.biblioteca-note-card__chevron {
    color: var(--biblioteca-muted);
    font-size: 18px;
    line-height: 1;
}

.biblioteca-note-card__details {
    display: grid;
    gap: 14px;
    border-top: 1px solid var(--biblioteca-line);
    padding: 18px;
}

.biblioteca-note-card__form {
    display: grid;
    gap: 12px;
}

.biblioteca-folder-list {
    flex-wrap: wrap;
    margin: var(--space-4) 0;
}

.biblioteca-folder-tile {
    position: relative;
    display: grid;
    gap: 3px;
    min-width: 190px;
    border: 1px solid var(--biblioteca-line);
    border-radius: var(--biblioteca-radius);
    background: var(--biblioteca-surface);
    color: var(--biblioteca-ink);
    box-shadow: var(--shadow-card);
    padding: 14px;
    transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease;
}

.biblioteca-folder-tile::before {
    content: "";
    width: 26px;
    height: 4px;
    border-radius: 999px;
    background: var(--primary);
}

.biblioteca-folder-tile span {
    color: var(--biblioteca-muted);
    font-size: var(--font-xs);
    font-weight: 850;
}

.biblioteca-folder-tile.is-synced {
    border-style: dashed;
}

.biblioteca-folder-tile.is-synced::before {
    background: var(--info);
}

.biblioteca-full-btn {
    width: 100%;
    justify-content: center;
}

.biblioteca-create-panel form,
.biblioteca-chat-composer {
    min-width: 0;
}

.biblioteca-create-panel .form-group {
    margin: 0;
}

.biblioteca-create-panel .btn,
.biblioteca-chat-composer .btn {
    justify-content: center;
}

.biblioteca-chat-page {
    gap: 0;
    min-height: calc(100vh - 88px);
    margin: calc(var(--space-5) * -1);
    background: #fff;
}

:root[data-theme="dark"] .biblioteca-chat-page {
    background: color-mix(in srgb, var(--bg) 88%, #000);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .biblioteca-chat-page {
        background: color-mix(in srgb, var(--bg) 88%, #000);
    }
}

.biblioteca-chat-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--space-4);
    padding: 16px 26px 18px;
    border-bottom: 1px solid var(--biblioteca-line);
}

.biblioteca-chat-top h2 {
    max-width: min(920px, 100%);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.biblioteca-chat-current-title {
    max-width: min(940px, 100%);
    margin: 8px 0 0;
    color: var(--biblioteca-ink);
    font-size: 18px;
    font-weight: 850;
    line-height: 1.25;
}

.biblioteca-chat-context-line {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    color: var(--biblioteca-muted);
}

.biblioteca-chat-context-line > span:first-child {
    flex: 0 0 auto;
}

.biblioteca-chat-context-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    min-width: 0;
}

.biblioteca-chat-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    max-width: 320px;
    min-height: 30px;
    border: 1px solid var(--biblioteca-line);
    border-radius: 999px;
    background: var(--biblioteca-surface);
    color: var(--biblioteca-ink);
    padding: 4px 12px 4px 7px;
}

.biblioteca-chat-pill.is-stale {
    border-color: color-mix(in srgb, var(--danger) 42%, var(--border));
    background: var(--danger-soft);
    color: var(--danger);
}

.biblioteca-chat-pill.is-stale::before {
    content: "!";
    width: 16px;
    height: 16px;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 14%, transparent);
}

.biblioteca-chat-pill .biblioteca-file-type {
    width: 22px;
    height: 22px;
    font-size: 8px;
}

.biblioteca-chat-select {
    flex: 0 1 370px;
    width: min(370px, 100%);
    min-width: 220px;
    height: 32px;
}

.biblioteca-new-thread-btn {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    font-size: 20px;
    line-height: 1;
}

.biblioteca-chat-thread-row {
    flex-wrap: wrap;
    row-gap: 8px;
}

.biblioteca-chat-thread-row .biblioteca-icon-btn {
    margin-left: 0;
}

.biblioteca-chat-thread-row .biblioteca-new-thread-btn {
    margin-left: 2px;
}

.biblioteca-thread-tool-btn {
    flex: 0 0 auto;
}

.biblioteca-icon-calendar,
.biblioteca-icon-search {
    position: relative;
    display: inline-block;
    width: 14px;
    height: 14px;
}

.biblioteca-icon-calendar {
    border: 1.5px solid currentColor;
    border-radius: 3px;
}

.biblioteca-icon-calendar::before {
    content: "";
    position: absolute;
    left: 2px;
    right: 2px;
    top: 3px;
    border-top: 1.5px solid currentColor;
}

.biblioteca-icon-calendar::after {
    content: "";
    position: absolute;
    left: 3px;
    top: -3px;
    width: 7px;
    height: 4px;
    border-left: 1.5px solid currentColor;
    border-right: 1.5px solid currentColor;
}

.biblioteca-icon-search {
    border: 1.5px solid currentColor;
    border-radius: 999px;
    transform: scale(.78);
}

.biblioteca-icon-search::after {
    content: "";
    position: absolute;
    right: -5px;
    bottom: -3px;
    width: 7px;
    border-top: 1.5px solid currentColor;
    transform: rotate(45deg);
    transform-origin: left center;
}

.biblioteca-thread-panel {
    border-bottom: 1px solid var(--biblioteca-line);
    background: var(--biblioteca-surface);
    padding: 12px 20px 16px;
}

.biblioteca-thread-panel[hidden] {
    display: none;
}

.biblioteca-thread-panel__bar,
.biblioteca-thread-search-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.biblioteca-thread-panel__bar strong {
    color: var(--biblioteca-muted);
    font-size: var(--font-sm);
}

.biblioteca-thread-panel__bar button,
.biblioteca-thread-search-row > button {
    flex: 0 0 auto;
    border: 0;
    background: transparent;
    color: var(--biblioteca-muted);
    cursor: pointer;
    font-weight: 750;
}

.biblioteca-thread-date-list,
.biblioteca-thread-search-results {
    display: grid;
    gap: 1px;
    margin-top: 12px;
    border-radius: 6px;
    background: var(--biblioteca-surface-soft);
    overflow: hidden;
}

.biblioteca-thread-date-list button,
.biblioteca-thread-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 44px;
    border: 0;
    border-bottom: 1px solid var(--biblioteca-line);
    background: transparent;
    color: var(--biblioteca-ink);
    padding: 10px 14px;
    text-align: left;
    cursor: pointer;
}

.biblioteca-thread-date-list button:hover,
.biblioteca-thread-result:hover,
.biblioteca-thread-result.is-active {
    background: var(--biblioteca-surface);
}

.biblioteca-thread-result.is-active {
    box-shadow: inset 3px 0 0 var(--primary);
}

.biblioteca-thread-search-results {
    min-height: 64px;
    color: var(--biblioteca-muted);
    place-items: center stretch;
}

.biblioteca-thread-search-field {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 38px;
    border: 1px solid color-mix(in srgb, var(--primary) 74%, var(--biblioteca-line));
    border-radius: 6px;
    background: var(--biblioteca-surface-soft);
    color: var(--biblioteca-muted);
    padding: 0 8px;
}

.biblioteca-thread-search-field input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--biblioteca-ink);
    padding: 8px 7px;
    font: inherit;
}

.biblioteca-thread-search-field button {
    border: 0;
    background: transparent;
    color: var(--biblioteca-muted);
    cursor: pointer;
    font-size: 18px;
}

.biblioteca-thread-result__text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.biblioteca-thread-result__time {
    flex: 0 0 auto;
    color: var(--biblioteca-muted);
    font-size: var(--font-sm);
}

.biblioteca-message.is-search-hit {
    border-color: color-mix(in srgb, var(--primary) 64%, var(--biblioteca-line));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent), 0 18px 42px rgba(0, 0, 0, .14);
    animation: biblioteca-search-hit-pulse 1s ease-in-out 0s 5;
}

@keyframes biblioteca-search-hit-pulse {
    0%,
    100% {
        box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent), 0 18px 42px rgba(0, 0, 0, .14);
    }
    50% {
        box-shadow: 0 0 0 7px color-mix(in srgb, var(--primary) 30%, transparent), 0 20px 48px rgba(0, 0, 0, .18);
    }
}

.biblioteca-chat-thread {
    display: grid;
    align-content: start;
    gap: 26px;
    min-height: calc(100vh - 300px);
    padding: 42px 32px 240px;
}

.biblioteca-chat-day {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 18px;
    color: var(--biblioteca-muted);
    font-weight: 700;
}

.biblioteca-chat-day::before,
.biblioteca-chat-day::after {
    content: "";
    height: 1px;
    background: var(--biblioteca-line);
}

.biblioteca-message {
    display: grid;
    gap: var(--space-3);
    grid-template-columns: minmax(0, 1fr) auto;
    max-width: min(860px, 82%);
    border: 1px solid var(--biblioteca-line);
    border-radius: 18px;
    background: var(--biblioteca-surface);
    box-shadow: 0 18px 42px rgba(0, 0, 0, .14);
    padding: 24px 28px;
    font-size: 1.05rem;
    line-height: 1.55;
}

.biblioteca-message > div:first-child {
    grid-column: 1 / -1;
}

.biblioteca-message time {
    grid-column: 2;
    grid-row: 2;
    align-self: center;
    justify-self: end;
    color: var(--biblioteca-muted);
    font-size: var(--font-sm);
}

.biblioteca-message-actions {
    grid-column: 1;
    grid-row: 2;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease;
}

.biblioteca-message-actions form {
    margin: 0;
}

.biblioteca-message:hover .biblioteca-message-actions,
.biblioteca-message:focus-within .biblioteca-message-actions {
    opacity: 1;
    pointer-events: auto;
}

.biblioteca-message-actions button,
.biblioteca-message-actions select {
    min-height: 30px;
    border: 1px solid var(--biblioteca-line);
    border-radius: 8px;
    background: var(--biblioteca-surface-soft);
    color: var(--biblioteca-ink);
    padding: 4px 8px;
    font-size: var(--font-xs);
    font-weight: 800;
}

.biblioteca-message-meta {
    align-self: center;
    color: var(--biblioteca-muted);
    font-size: var(--font-xs);
    font-weight: 750;
}

.biblioteca-message-actions button.is-done,
.biblioteca-message-actions button.is-speaking {
    border-color: color-mix(in srgb, var(--primary) 48%, var(--border));
    color: var(--primary);
}

.biblioteca-message.is-user {
    justify-self: end;
    border-color: color-mix(in srgb, var(--primary) 48%, transparent);
    background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 88%, var(--success)), var(--primary));
    color: #fff;
}

.biblioteca-message.is-user time {
    color: color-mix(in srgb, #fff 72%, transparent);
}

.biblioteca-processing-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: currentColor;
    animation: biblioteca-processing-pulse 1s ease-in-out infinite;
}

@keyframes biblioteca-processing-pulse {
    0%, 100% {
        opacity: .35;
        transform: scale(.8);
    }
    50% {
        opacity: 1;
        transform: scale(1);
    }
}

.biblioteca-message.is-assistant,
.biblioteca-message.is-system {
    justify-self: start;
}

.biblioteca-chat-composer {
    position: sticky;
    bottom: 40px;
    width: min(940px, calc(100% - 42px));
    margin: 0 auto 24px;
    border: 1px solid var(--biblioteca-line);
    border-radius: 18px;
    background: color-mix(in srgb, var(--biblioteca-surface) 92%, transparent);
    box-shadow: 0 18px 42px rgba(0, 0, 0, .18);
    padding: 8px 16px 10px;
    backdrop-filter: blur(14px);
    z-index: 30;
}

.biblioteca-composer-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.biblioteca-chat-input-row {
    position: relative;
    display: block;
}

.biblioteca-chat-input-row textarea {
    min-height: 28px;
    max-height: 180px;
    resize: none;
    overflow-y: hidden;
    border: 0;
    background: transparent;
    font-size: 1rem;
    line-height: 1.35;
    padding: 3px 38px 3px 0;
}

.biblioteca-glossary-trigger {
    position: absolute;
    right: 0;
    bottom: 4px;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--success);
    font-size: 22px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
}

.biblioteca-glossary-trigger:hover,
.biblioteca-glossary-trigger:focus-visible {
    background: color-mix(in srgb, var(--success) 12%, transparent);
}

.biblioteca-glossary-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 8px;
    border: 1px solid color-mix(in srgb, var(--success) 30%, var(--biblioteca-line));
    border-radius: 8px;
    background: color-mix(in srgb, var(--success) 8%, var(--biblioteca-surface));
    color: var(--biblioteca-ink);
    padding: 9px 10px;
    font-size: var(--font-sm);
}

.biblioteca-glossary-box[hidden],
.biblioteca-glossary-trigger[hidden],
.biblioteca-prompt-info[hidden] {
    display: none;
}

.biblioteca-glossary-box strong {
    color: var(--success);
}

.biblioteca-glossary-box > button {
    flex: 0 0 auto;
    border: 0;
    background: transparent;
    color: var(--biblioteca-muted);
    font-size: 20px;
    cursor: pointer;
}

.biblioteca-glossary-chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 2px 3px;
    border: 1px solid var(--biblioteca-line);
    border-radius: 6px;
    background: var(--biblioteca-surface);
    padding: 3px 7px;
}

.biblioteca-glossary-info {
    position: relative;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
    border: 1px solid color-mix(in srgb, var(--success) 55%, var(--biblioteca-line));
    border-radius: 999px;
    color: var(--success);
    font-size: 10px;
    font-weight: 850;
    line-height: 1;
    cursor: help;
}

.biblioteca-glossary-info:hover::after,
.biblioteca-glossary-info:focus-visible::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    top: calc(100% + 8px);
    z-index: 40;
    width: min(360px, 78vw);
    transform: translateX(-50%);
    border: 1px solid var(--biblioteca-line);
    border-radius: 8px;
    background: var(--biblioteca-surface);
    box-shadow: 0 10px 24px rgba(0, 0, 0, .16);
    color: var(--biblioteca-ink);
    padding: 9px 11px;
    font-size: var(--font-sm);
    font-weight: 500;
    line-height: 1.35;
    white-space: normal;
}

.biblioteca-composer-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 4px;
}

.biblioteca-composer-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

.biblioteca-composer-controls .form-control {
    width: auto;
    max-width: min(420px, 58vw);
    min-height: 24px;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    padding: 0 18px 0 0;
    font-size: var(--font-sm);
    font-weight: 650;
}

.biblioteca-prompt-info {
    position: relative;
    width: 22px;
    height: 22px;
    border: 1px solid var(--biblioteca-line);
    border-radius: 999px;
    background: transparent;
    color: var(--biblioteca-muted);
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
    cursor: help;
}

.biblioteca-prompt-info:hover::after,
.biblioteca-prompt-info:focus-visible::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    z-index: 20;
    width: min(420px, 80vw);
    transform: translateX(-50%);
    border: 1px solid var(--biblioteca-line);
    border-radius: 8px;
    background: var(--biblioteca-surface);
    box-shadow: 0 10px 24px rgba(0, 0, 0, .16);
    color: var(--biblioteca-ink);
    padding: 10px 12px;
    font-size: var(--font-sm);
    font-weight: 500;
    line-height: 1.35;
    white-space: normal;
}

.biblioteca-icon-btn.is-send {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: #fff;
    color: #111;
    font-size: 18px;
    line-height: 1;
}

.biblioteca-chat-disclaimer {
    width: min(940px, calc(100% - 42px));
    margin: -8px auto 8px;
    text-align: center;
    font-size: var(--font-xs);
    color: var(--biblioteca-muted);
}

.biblioteca-glossary-page {
    width: min(1060px, 100%);
}

.biblioteca-glossary-search .form-control {
    width: min(380px, 100%);
}

.biblioteca-glossary-form-panel {
    padding: 22px;
}

.biblioteca-glossary-form {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) minmax(220px, 1fr) minmax(240px, 1.15fr) auto auto;
    align-items: end;
    gap: 16px;
}

.biblioteca-glossary-form .form-group {
    margin: 0;
}

.biblioteca-glossary-description-field textarea {
    min-height: 42px;
    resize: vertical;
}

.biblioteca-toggle-line {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    color: var(--biblioteca-muted);
    font-weight: 750;
}

.biblioteca-glossary-actions {
    display: inline-flex;
    gap: 10px;
}

.biblioteca-glossary-table td:nth-child(2) {
    max-width: 520px;
    overflow-wrap: anywhere;
}

.biblioteca-row-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.biblioteca-empty-cell {
    padding: 22px;
    text-align: center;
    color: var(--biblioteca-muted);
}

.biblioteca-document-page {
    width: min(860px, 100%);
    margin: 0 auto;
    border: 1px solid var(--biblioteca-line);
    border-radius: var(--biblioteca-radius);
    background: var(--biblioteca-surface);
    box-shadow: 0 16px 44px rgba(31, 31, 28, 0.06);
    padding: 36px;
}

.biblioteca-page-canvas {
    display: grid;
    gap: var(--space-5);
}

.biblioteca-document-page header {
    display: grid;
    gap: var(--space-3);
    margin-bottom: var(--space-5);
}

.biblioteca-document-page .biblioteca-resource-tags {
    margin: 0;
}

.biblioteca-document-page h3 {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.biblioteca-document-page h3 .biblioteca-index-dot {
    flex: 0 0 9px;
    width: 9px;
    height: 9px;
}

.biblioteca-document-page .biblioteca-resource-viewer {
    margin-top: var(--space-5);
}

.biblioteca-rich-content {
    color: var(--biblioteca-ink);
    font-size: var(--font-md);
    line-height: 1.65;
}

.biblioteca-rich-content p,
.biblioteca-rich-content ul,
.biblioteca-rich-content ol,
.biblioteca-rich-content blockquote {
    margin-top: 0;
}

.biblioteca-rich-content [data-biblioteca-token] {
    display: inline-flex;
    border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--border));
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: var(--font-xs);
    font-weight: 850;
    padding: 2px 7px;
}

.biblioteca-check {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--biblioteca-ink);
    font-weight: 750;
}

.biblioteca-token-copy {
    cursor: pointer;
    font: inherit;
}

.biblioteca-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
}

.biblioteca-editor-toolbar button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 32px;
    border: 1px solid var(--biblioteca-line);
    border-radius: var(--biblioteca-radius);
    background: var(--biblioteca-surface);
    color: var(--biblioteca-ink);
    cursor: pointer;
    font: inherit;
    font-size: var(--font-xs);
    font-weight: 900;
}

.biblioteca-editor-toolbar button:hover {
    border-color: var(--biblioteca-line-strong);
    background: var(--bg-muted);
}

.biblioteca-wysiwyg {
    min-height: 260px;
    border: 1px solid var(--biblioteca-line);
    border-radius: var(--biblioteca-radius);
    background: var(--biblioteca-surface);
    color: var(--biblioteca-ink);
    box-shadow: inset 0 1px 0 rgba(31, 31, 28, 0.03);
    padding: 14px;
    outline: none;
}

.biblioteca-wysiwyg:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--focus);
}

.biblioteca-sidebar-nav {
    display: grid;
    gap: 14px;
    margin-top: 4px;
    min-width: 0;
    overflow-x: hidden;
}

.biblioteca-sidebar-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.biblioteca-sidebar-title-menu {
    position: relative;
    min-width: 0;
}

.biblioteca-sidebar-title-menu summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    cursor: pointer;
    list-style: none;
}

.biblioteca-sidebar-title-menu summary::-webkit-details-marker {
    display: none;
}

.biblioteca-sidebar-title-menu summary span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.biblioteca-sidebar-title-dropdown {
    position: absolute;
    z-index: 30;
    top: calc(100% + 8px);
    left: 0;
    display: grid;
    gap: 3px;
    min-width: 180px;
    border: 1px solid var(--biblioteca-line);
    border-radius: 8px;
    background: var(--bg-elevated);
    box-shadow: var(--shadow-dropdown);
    padding: 6px;
}

.biblioteca-sidebar-title-dropdown a {
    border-radius: 6px;
    color: var(--text-main);
    font-size: 13px;
    font-weight: 760;
    padding: 8px 9px;
    text-decoration: none;
}

.biblioteca-sidebar-title-dropdown a:hover,
.biblioteca-sidebar-title-dropdown a:focus-visible {
    background: var(--bg-muted);
    outline: none;
}

.biblioteca-sidebar-search-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
}

.biblioteca-sidebar-search-btn:hover,
.biblioteca-sidebar-search-btn:focus-visible {
    border-color: var(--biblioteca-line);
    background: var(--bg-elevated);
    color: var(--text-main);
    outline: none;
}

.biblioteca-sidebar-search-btn svg {
    width: 14px;
    height: 14px;
}

.biblioteca-sidebar-group {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.biblioteca-sidebar-group.is-dragging {
    opacity: 0.55;
}

.biblioteca-sidebar-group.is-drop-before {
    margin-top: 18px;
}

.biblioteca-sidebar-group.is-drop-after {
    margin-bottom: 18px;
}

.biblioteca-sidebar-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0;
    line-height: 1.2;
    padding: 8px 10px 2px;
    text-transform: uppercase;
    cursor: pointer;
    list-style: none;
}

.biblioteca-sidebar-heading::-webkit-details-marker {
    display: none;
}

.biblioteca-sidebar-heading-main {
    display: inline-flex;
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
    gap: 8px;
}

.biblioteca-sidebar-heading .nav-icon {
    flex-basis: 18px;
    width: 18px;
    height: 18px;
}

.biblioteca-sidebar-heading-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.biblioteca-sidebar-heading small {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 850;
}

.biblioteca-sidebar-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: 1px solid var(--biblioteca-line);
    border-radius: 6px;
    background: var(--bg-elevated);
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 900;
    line-height: 1;
    text-decoration: none;
}

.biblioteca-sidebar-add svg {
    width: 14px;
    height: 14px;
    stroke-width: 2.4;
}

.biblioteca-sidebar-search-link {
    width: 18px;
    height: 18px;
    border: 0;
    background: transparent;
    margin-right: -1px;
}

.biblioteca-sidebar-search-link:hover,
.biblioteca-sidebar-search-link:focus-visible {
    background: transparent;
    color: var(--text-main);
}

.biblioteca-sidebar-drag {
    cursor: grab;
}

.biblioteca-sidebar-drag:active {
    cursor: grabbing;
}

.biblioteca-sidebar-tree {
    display: grid;
    gap: 2px;
    min-width: 0;
    padding-left: 10px;
}

.biblioteca-quick-search-modal[hidden] {
    display: none;
}

.biblioteca-quick-search-modal {
    position: fixed;
    z-index: 1100;
    inset: 0;
    display: grid;
    place-items: start center;
    padding: 64px 20px 20px;
}

.biblioteca-quick-search-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.18);
}

.biblioteca-quick-search-panel {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 12px;
    width: min(520px, calc(100vw - 24px));
    max-height: min(560px, calc(100vh - 84px));
    min-height: 0;
    border: 1px solid var(--biblioteca-line);
    border-radius: 18px;
    background: var(--bg-elevated);
    box-shadow: var(--shadow-dropdown);
    padding: 10px;
}

.biblioteca-quick-search-panel input {
    width: 100%;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text-main);
    font-size: 15px;
    padding: 8px 6px;
    outline: none;
}

.biblioteca-quick-search-list {
    display: grid;
    gap: 8px;
    overflow: auto;
    min-height: 0;
    max-height: 100%;
    padding-bottom: 2px;
}

.biblioteca-quick-search-section {
    display: grid;
    gap: 2px;
}

.biblioteca-quick-search-section-title {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
    padding: 3px 4px;
}

.biblioteca-quick-search-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    border-radius: 10px;
    color: var(--text-main);
    font-size: 14px;
    line-height: 1.25;
    padding: 8px 10px 8px 36px;
    text-decoration: none;
}

.biblioteca-quick-search-item:hover,
.biblioteca-quick-search-item:focus-visible,
.biblioteca-quick-search-item.is-active {
    background: var(--bg-muted);
    color: var(--text-main);
    outline: none;
}

.biblioteca-quick-search-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.biblioteca-quick-search-item small {
    max-width: 180px;
    overflow: hidden;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.biblioteca-quick-search-empty {
    color: var(--text-muted);
    font-size: 13px;
    padding: 10px 6px 12px;
}

.biblioteca-tree-node {
    display: grid;
    min-width: 0;
}

.biblioteca-tree-collapsible {
    display: grid;
    min-width: 0;
}

.biblioteca-tree-summary,
.biblioteca-tree-row {
    display: grid;
    grid-template-columns: 14px minmax(0, 1fr);
    align-items: center;
    gap: 2px;
    min-width: 0;
    list-style: none;
}

.biblioteca-tree-summary {
    cursor: pointer;
}

.biblioteca-tree-summary::-webkit-details-marker {
    display: none;
}

.biblioteca-tree-toggle,
.biblioteca-tree-spacer {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 26px;
    color: color-mix(in srgb, var(--text-muted) 72%, transparent);
}

.biblioteca-tree-toggle::before {
    display: block;
    width: 5px;
    height: 5px;
    border: solid currentColor;
    border-width: 0 1.5px 1.5px 0;
    content: "";
    transform: rotate(-45deg);
    transition: transform .14s ease;
}

.biblioteca-tree-collapsible[open] > .biblioteca-tree-summary .biblioteca-tree-toggle::before {
    transform: rotate(45deg);
}

.biblioteca-tree-children {
    display: grid;
    gap: 1px;
    min-width: 0;
    margin-left: 7px;
    padding-left: 6px;
    border-left: 1px solid color-mix(in srgb, var(--border) 54%, transparent);
}

.biblioteca-tree-link {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 5px;
    min-height: 26px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: var(--font-xs);
    font-weight: 760;
    line-height: 1.2;
    padding: 5px 7px;
}

.biblioteca-tree-link:hover {
    background: var(--bg-muted);
    color: var(--text);
}

.biblioteca-tree-link.is-active {
    background: color-mix(in srgb, var(--primary-soft) 28%, transparent);
    color: var(--text);
}

.biblioteca-tree-link--strong {
    color: var(--text);
    font-weight: 850;
}

.biblioteca-tree-link--resource {
    grid-template-columns: 10px minmax(0, 1fr);
}

.biblioteca-tree-link--more {
    color: var(--text-muted);
    font-style: italic;
}

.biblioteca-tree-link span:not(.biblioteca-sidebar-dot),
.biblioteca-tree-link small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.biblioteca-tree-link small {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 850;
}

.biblioteca-chat-age {
    min-width: max-content;
}

.biblioteca-tree-link.is-processing .biblioteca-chat-age {
    display: inline-block;
    box-sizing: border-box;
    flex: 0 0 auto;
    width: 12px;
    height: 12px;
    border: 2px solid color-mix(in srgb, var(--text-muted) 35%, transparent);
    border-top-color: var(--text-muted);
    border-radius: 999px;
    color: transparent;
    animation: bibliotecaSpin .7s linear infinite;
}

.biblioteca-tree-link.is-unread .biblioteca-chat-age {
    display: inline-block;
    box-sizing: border-box;
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--primary);
    color: transparent;
}

.biblioteca-sidebar-dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--text-muted);
}

.biblioteca-sidebar-dot.is-processing {
    background: var(--warning);
}

.biblioteca-sidebar-dot.is-available {
    background: var(--success);
}

.biblioteca-sidebar-dot.is-error {
    background: var(--danger);
}

@keyframes bibliotecaSpin {
    to {
        transform: rotate(360deg);
    }
}

.biblioteca-sidebar-empty {
    color: var(--text-muted);
    font-size: var(--font-xs);
    font-weight: 720;
    padding: 7px 10px;
}

.biblioteca-management-link {
    min-height: 34px;
}

.biblioteca-management-back {
    margin-bottom: 4px;
}

.biblioteca-management-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    gap: 18px;
    align-items: start;
    margin-bottom: 18px;
}

.biblioteca-management-stats {
    margin-bottom: 18px;
}

.biblioteca-role-list {
    display: grid;
    gap: 8px;
}

.biblioteca-role-list__head,
.biblioteca-role-summary {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) minmax(260px, 2fr) minmax(100px, .6fr);
    gap: 14px;
    align-items: center;
}

.biblioteca-role-list__head {
    border: 1px solid var(--biblioteca-line);
    border-radius: var(--biblioteca-radius) var(--biblioteca-radius) 0 0;
    background: var(--biblioteca-surface-soft);
    color: var(--biblioteca-muted);
    font-size: var(--font-xs);
    font-weight: 900;
    padding: 12px;
    text-transform: uppercase;
}

.biblioteca-role-card {
    overflow: hidden;
    border: 1px solid var(--biblioteca-line);
    border-radius: var(--biblioteca-radius);
    background: var(--biblioteca-surface);
}

.biblioteca-role-card[open] {
    overflow: visible;
}

.biblioteca-role-summary {
    grid-template-columns: minmax(150px, 1fr) minmax(260px, 2fr) minmax(100px, .6fr) auto;
    cursor: pointer;
    list-style: none;
    padding: 14px 12px;
}

.biblioteca-role-summary::-webkit-details-marker {
    display: none;
}

.biblioteca-role-summary::after {
    content: "v";
    justify-self: end;
    color: var(--biblioteca-muted);
    font-weight: 900;
}

.biblioteca-role-card[open] .biblioteca-role-summary {
    border-bottom: 1px solid var(--biblioteca-line);
}

.biblioteca-role-card[open] .biblioteca-role-summary::after {
    transform: rotate(180deg);
}

.biblioteca-role-summary span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.biblioteca-role-summary strong {
    display: block;
    color: var(--biblioteca-ink);
    font-weight: 900;
}

.biblioteca-role-detail {
    display: grid;
    gap: 16px;
    padding: 14px 12px 16px;
}

.biblioteca-role-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.biblioteca-role-actions .inline-form {
    display: flex;
    align-items: center;
}

.biblioteca-role-actions .link-button {
    line-height: 1.2;
}

.biblioteca-role-assignment-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
    gap: 16px;
    align-items: start;
}

.biblioteca-checkbox-list {
    display: grid;
    gap: 8px;
    margin: 12px 0;
}

.biblioteca-checkbox-list label {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: var(--font-sm);
    font-weight: 720;
}

@media (max-width: 980px) {
    .biblioteca-management-grid {
        grid-template-columns: 1fr;
    }

    .biblioteca-glossary-form {
        grid-template-columns: 1fr 1fr;
    }

    .biblioteca-glossary-description-field,
    .biblioteca-glossary-actions {
        grid-column: 1 / -1;
    }

    .biblioteca-role-list__head {
        display: none;
    }

    .biblioteca-role-summary,
    .biblioteca-role-assignment-grid {
        grid-template-columns: 1fr;
    }

    .biblioteca-role-summary::after {
        justify-self: start;
    }
}

.sidebar-collapsed .biblioteca-sidebar-nav {
    gap: 6px;
    margin-top: 8px;
}

.sidebar-collapsed .biblioteca-sidebar-group {
    gap: 0;
}

.sidebar-collapsed .biblioteca-sidebar-heading {
    justify-content: center;
    min-height: 38px;
    margin: 1px 0;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    padding: 8px 10px;
}

.sidebar-collapsed .biblioteca-sidebar-heading:hover {
    background: var(--bg-muted);
    color: var(--text);
}

.sidebar-collapsed .biblioteca-sidebar-heading .nav-icon {
    flex-basis: 22px;
    width: 22px;
    height: 22px;
}

.sidebar-collapsed .biblioteca-sidebar-heading-text,
.sidebar-collapsed .biblioteca-sidebar-heading small,
.sidebar-collapsed .biblioteca-sidebar-heading-meta,
.sidebar-collapsed .biblioteca-sidebar-tree {
    display: none;
}

@media (max-width: 1260px) {
    .biblioteca-explorer {
        grid-template-columns: 1fr;
    }

    .biblioteca-resizer {
        display: none;
    }

    .biblioteca-explorer-tree,
    .biblioteca-inspector {
        border: 0;
        border-bottom: 1px solid var(--biblioteca-line);
    }

    .biblioteca-folder-tree {
        max-height: 240px;
    }

    .biblioteca-inspector.is-expanded {
        inset: 18px;
    }

    .biblioteca-workspace.has-create-panel,
    .biblioteca-workspace.is-wide,
    .biblioteca-page-editor {
        grid-template-columns: 1fr;
    }

    .biblioteca-folder-grid,
    .biblioteca-collections-layout,
    .biblioteca-chat-layout {
        grid-template-columns: 1fr;
    }

    .biblioteca-messages {
        max-height: none;
    }
}

@media (max-width: 860px) {
    .biblioteca-shared-collection-row {
        grid-template-columns: 1fr;
    }

    .biblioteca-shared-actions {
        justify-content: flex-start;
        padding-top: 0;
    }

    .biblioteca-collection-summary {
        grid-template-columns: 34px 24px minmax(0, 1fr) auto 18px;
    }

    .biblioteca-collections-toolbar {
        grid-template-columns: 1fr;
    }

    .biblioteca-menu-limit-form {
        justify-content: start;
    }

    .biblioteca-collection-summary .btn,
    .biblioteca-collection-count {
        grid-column: 3 / 5;
        justify-self: start;
    }

    .biblioteca-hero,
    .biblioteca-page > .page-actions {
        grid-template-columns: 1fr;
    }

    .biblioteca-hero,
    .biblioteca-panel-head,
    .biblioteca-sidepanel__head,
    .biblioteca-page > .page-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .biblioteca-hero-actions {
        justify-content: flex-start;
    }

    .biblioteca-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .biblioteca-composer-grid {
        grid-template-columns: 1fr;
    }

    .biblioteca-glossary-form {
        grid-template-columns: 1fr;
    }

    .biblioteca-glossary-description-field,
    .biblioteca-glossary-actions {
        grid-column: auto;
    }

    .biblioteca-message {
        max-width: 100%;
    }
}

@media (max-width: 560px) {
    .biblioteca-hero,
    .biblioteca-panel,
    .biblioteca-sidepanel,
    .biblioteca-create-panel,
    .biblioteca-chat-panel,
    .biblioteca-mainpanel,
    .biblioteca-page > .page-actions {
        padding: 14px;
    }

    .biblioteca-stats {
        grid-template-columns: 1fr;
    }

    .biblioteca-filterbar .form-control,
    .biblioteca-filterbar .btn {
        width: 100%;
        max-width: none;
    }

    .biblioteca-folder-toolbar {
        grid-template-columns: 1fr;
    }

    .biblioteca-resource-filter-panel {
        align-items: stretch;
        flex-direction: column;
    }

    .biblioteca-resource-filter-panel .biblioteca-folder-search,
    .biblioteca-resource-filter-panel .biblioteca-folder-search .form-control {
        width: 100%;
        flex-basis: auto;
    }

    .biblioteca-folder-toolbar__left,
    .biblioteca-folder-toolbar .btn,
    .biblioteca-folder-view-form,
    .biblioteca-folder-view-form .form-control {
        width: 100%;
    }

    .biblioteca-ajax-status {
        justify-self: start;
    }

    .biblioteca-card-grid {
        grid-template-columns: 1fr;
    }

    .biblioteca-collection-summary {
        gap: 8px;
        padding: 10px;
    }

    .biblioteca-resource-item {
        grid-template-columns: 1fr;
    }

    .biblioteca-resource-item-head,
    .biblioteca-resource-actions {
        align-items: flex-start;
        flex-direction: column;
    }
}

.biblioteca-topic-hero,
.biblioteca-topic-detail-hero {
    align-items: center;
    background:
        linear-gradient(135deg, rgba(82, 122, 255, 0.22), rgba(31, 184, 137, 0.16)),
        var(--panel, var(--surface, #fff));
    border: 1px solid rgba(148, 163, 184, 0.32);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
    display: flex;
    gap: 18px;
    justify-content: space-between;
    margin-bottom: 18px;
    padding: 22px;
}

.biblioteca-topics-page .biblioteca-topic-hero,
.biblioteca-topic-page .biblioteca-topic-detail-hero {
    background:
        linear-gradient(135deg, rgba(28, 43, 71, 0.98), rgba(22, 55, 48, 0.96)),
        #18201d;
    border-color: rgba(132, 204, 162, 0.26);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.24);
}

.biblioteca-topic-hero h2,
.biblioteca-topic-detail-hero h2 {
    color: var(--text, #0f172a);
    margin: 0 0 6px;
}

.biblioteca-topics-page .biblioteca-topic-hero h2,
.biblioteca-topic-page .biblioteca-topic-detail-hero h2 {
    color: #f8fafc;
}

.biblioteca-topic-hero p,
.biblioteca-topic-detail-hero p {
    color: var(--muted-text, #64748b);
    margin: 0;
    max-width: 860px;
}

.biblioteca-topics-page .biblioteca-topic-hero p,
.biblioteca-topic-page .biblioteca-topic-detail-hero p {
    color: #dbe7df;
}

.biblioteca-topics-page .biblioteca-topic-hero .eyebrow,
.biblioteca-topic-page .biblioteca-topic-detail-hero .eyebrow {
    color: #a7f3d0;
}

.biblioteca-topic-metrics {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 18px;
}

.biblioteca-topic-metrics > div {
    background: var(--panel, var(--surface, #fff));
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 8px;
    padding: 16px;
}

.biblioteca-topics-page .biblioteca-topic-metrics > div,
.biblioteca-topic-page .biblioteca-topic-metrics > div {
    background: #20231f;
    border-color: rgba(255, 255, 255, 0.11);
}

.biblioteca-topic-metrics span {
    color: var(--muted-text, #64748b);
    display: block;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.biblioteca-topics-page .biblioteca-topic-metrics span,
.biblioteca-topic-page .biblioteca-topic-metrics span {
    color: #c3cabf;
}

.biblioteca-topic-metrics strong {
    color: var(--text, #0f172a);
    display: block;
    font-size: 30px;
    line-height: 1.1;
    margin-top: 4px;
}

.biblioteca-topics-page .biblioteca-topic-metrics strong,
.biblioteca-topic-page .biblioteca-topic-metrics strong {
    color: #f8fafc;
}

.biblioteca-topics-page .biblioteca-panel,
.biblioteca-topic-page .biblioteca-panel {
    background: #1f231f;
    border-color: rgba(255, 255, 255, 0.11);
}

.biblioteca-topics-page .biblioteca-muted,
.biblioteca-topic-page .biblioteca-muted,
.biblioteca-topics-page .biblioteca-panel p,
.biblioteca-topic-page .biblioteca-panel p {
    color: #c7cdc3;
}

.biblioteca-topics-page .form-control,
.biblioteca-topic-page .form-control {
    background: #181c18;
    border-color: rgba(255, 255, 255, 0.14);
    color: #f8fafc;
}

.biblioteca-topics-page .form-control::placeholder,
.biblioteca-topic-page .form-control::placeholder {
    color: #8e968b;
}

.biblioteca-topics-page .btn-primary,
.biblioteca-topic-page .btn-primary {
    background: #9fc3b1;
    border-color: #9fc3b1;
    color: #132019;
}

.biblioteca-topics-page .btn-primary:hover,
.biblioteca-topic-page .btn-primary:hover {
    background: #b7d8c8;
    border-color: #b7d8c8;
    color: #0f1b14;
}

.biblioteca-topics-page .btn-secondary,
.biblioteca-topic-page .btn-secondary {
    background: #242923;
    border-color: rgba(255, 255, 255, 0.16);
    color: #f4f6f1;
}

.biblioteca-topics-page .biblioteca-table th,
.biblioteca-topic-page .biblioteca-table th {
    color: #c3cabf;
}

.biblioteca-topics-page .biblioteca-table td,
.biblioteca-topic-page .biblioteca-table td {
    border-color: rgba(255, 255, 255, 0.1);
    color: #f4f6f1;
}

.biblioteca-topic-builder {
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(220px, 0.38fr) minmax(0, 1fr);
}

.biblioteca-topic-form-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.biblioteca-topic-form-grid label {
    display: grid;
    gap: 6px;
}

.biblioteca-topic-form-grid label > span {
    color: var(--text, #0f172a);
    font-size: 13px;
    font-weight: 700;
}

.biblioteca-topic-wide {
    grid-column: 1 / -1;
}

.biblioteca-topic-badge,
.biblioteca-topic-hero-badges span {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    color: #1d4ed8;
    display: inline-flex;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    padding: 6px 9px;
}

.biblioteca-topic-cron {
    align-items: center;
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(0, 1fr) auto;
}

.biblioteca-topic-cron .form-control {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    margin-top: 10px;
}

.biblioteca-topic-hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.biblioteca-topic-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 16px;
}

.biblioteca-topic-tabs a {
    background: var(--surface, #fff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 8px;
    color: var(--text, #0f172a);
    font-weight: 700;
    padding: 9px 12px;
    text-decoration: none;
}

.biblioteca-topic-section-head {
    align-items: flex-start;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 16px;
}

.biblioteca-topic-section-head h3 {
    margin: 0 0 4px;
}

.biblioteca-topic-section-head p {
    color: var(--muted-text, #64748b);
    margin: 0;
}

.biblioteca-topic-report-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.biblioteca-topic-thread {
    background: #f8fafc;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 8px;
    display: grid;
    gap: 10px;
    max-height: 560px;
    overflow: auto;
    padding: 14px;
}

.biblioteca-topic-empty-state {
    background: var(--surface, #fff);
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    padding: 18px;
}

.biblioteca-topic-empty-state p {
    color: var(--muted-text, #64748b);
    margin: 6px 0 0;
}

.biblioteca-topic-composer {
    margin-top: 12px;
}

.biblioteca-topic-candidate-search {
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(0, 1fr) auto;
    margin-bottom: 12px;
}

.biblioteca-topic-candidate-list {
    background: #f8fafc;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 8px;
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
    padding: 12px;
}

.biblioteca-topic-candidate-list label {
    align-items: flex-start;
    background: var(--surface, #fff);
    border: 1px solid transparent;
    border-radius: 8px;
    display: grid;
    gap: 10px;
    grid-template-columns: auto minmax(0, 1fr);
    padding: 10px;
}

.biblioteca-topic-candidate-list label:hover {
    border-color: #bfdbfe;
}

.biblioteca-topic-candidate-list label.is-disabled {
    opacity: 0.62;
}

.biblioteca-topic-candidate-list strong,
.biblioteca-topic-candidate-list small,
.biblioteca-topic-candidate-list em {
    display: block;
}

.biblioteca-topic-candidate-list small {
    color: var(--muted-text, #64748b);
    margin-top: 2px;
}

.biblioteca-topic-candidate-list em {
    color: #334155;
    font-style: normal;
    margin-top: 4px;
}

.biblioteca-topic-report-list {
    display: grid;
    gap: 14px;
}

.biblioteca-topic-report-list article {
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 8px;
    padding: 16px;
}

.biblioteca-topic-report-list header {
    display: grid;
    gap: 3px;
    margin-bottom: 10px;
}

.biblioteca-topic-report-list small {
    color: var(--muted-text, #64748b);
}

.biblioteca-chat-topic-add {
    align-items: center;
    display: inline-grid;
    gap: 6px;
    grid-template-columns: minmax(140px, 190px) auto;
    margin: 0 6px 6px 0;
    vertical-align: middle;
}

.biblioteca-chat-topic-add .form-control {
    min-height: 34px;
    padding-bottom: 5px;
    padding-top: 5px;
}

@media (max-width: 900px) {
    .biblioteca-topic-hero,
    .biblioteca-topic-detail-hero,
    .biblioteca-topic-section-head,
    .biblioteca-topic-cron {
        align-items: flex-start;
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .biblioteca-topic-builder,
    .biblioteca-topic-form-grid,
    .biblioteca-topic-metrics,
    .biblioteca-topic-candidate-search {
        grid-template-columns: 1fr;
    }
}
