/* ══════════════════════════════════════════════════════════════
   Notespark — TipTap tables
   Isolated file. Load after the other nota-*.css files.
   TipTap ships no table styling at all, so everything here is new.
   ══════════════════════════════════════════════════════════════ */

.tiptap-container .ProseMirror table {
    border-collapse: collapse;
    table-layout: fixed;
    width: 100%;
    margin: 14px 0;
    overflow: hidden;
    border-radius: 10px;
    border: 1px solid rgba(70,55,30,0.16);
}

    .tiptap-container .ProseMirror table td,
    .tiptap-container .ProseMirror table th {
        position: relative;
        min-width: 1em;
        padding: 8px 11px;
        vertical-align: top;
        border: 1px solid rgba(70,55,30,0.14);
        box-sizing: border-box;
    }

    .tiptap-container .ProseMirror table th {
        background: rgba(70,55,30,0.055);
        font-weight: 750;
        text-align: left;
        color: #33302a;
    }

    .tiptap-container .ProseMirror table p {
        margin: 0;
    }

    /* Selected cells */
    .tiptap-container .ProseMirror table .selectedCell:after {
        content: "";
        position: absolute;
        inset: 0;
        background: rgba(108,92,231,0.14);
        pointer-events: none;
    }

    /* Column resize handle (Table is configured with resizable: true) */
    .tiptap-container .ProseMirror table .column-resize-handle {
        position: absolute;
        right: -2px;
        top: 0;
        bottom: -2px;
        width: 4px;
        background: #6C5CE7;
        pointer-events: none;
    }

.tiptap-container .ProseMirror.resize-cursor {
    cursor: col-resize;
}

/* ── Contextual table toolbar ── */
.tt-table-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    padding-top: 6px !important;
    margin-top: 2px;
    border-top: 1px dashed rgba(70,55,30,0.14);
    border-bottom: none !important;
}

.tt-table-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: var(--n-text-4);
    margin-right: 4px;
}

.nota.theme-light .tt-table-toolbar .tt-btn {
    font-size: 12px;
    padding: 4px 8px;
    white-space: nowrap;
}

    .nota.theme-light .tt-table-toolbar .tt-btn.danger {
        color: var(--n-danger) !important;
    }

        .nota.theme-light .tt-table-toolbar .tt-btn.danger:hover {
            background: var(--n-danger-bg) !important;
        }

/* Tables in the read-only contexts (e.g. shared previews) */
.nota.compact .tiptap-container .ProseMirror table {
    font-size: 13px;
}

    .nota.compact .tiptap-container .ProseMirror table td,
    .nota.compact .tiptap-container .ProseMirror table th {
        padding: 6px 8px;
    }

/* ── Author bubbles must not appear inside table cells ──
   The attribution extension stamps every block node, including the
   paragraphs inside each cell, so a 3×3 table sprouted nine bubbles.
   Belt-and-braces: hide them within tables regardless of theme class. */
.tiptap-container .ProseMirror table [data-author-id]::before,
.nota .tiptap-container .ProseMirror table [data-author-id]::before,
.nota.theme-light .tiptap-container .ProseMirror table [data-author-id]::before {
    display: none !important;
}
