/* Table Mod */

body {
    --table-width: 88cqw;
    --table-border-color: rgba(169, 169, 169, 0.2);
}

body:not(.table-width-obsidian-default) .markdown-source-view.mod-cm6 .cm-table-widget .table-wrapper,
body:not(.table-width-obsidian-default) :is(.markdown-rendered, .markdown-source-view.mod-cm6.is-live-preview) table {
    width: 100% !important;
}

.markdown-source-view,
.markdown-reading-view {
    container-type: inline-size;
}

.table-width-customized .markdown-source-view.mod-cm6.is-live-preview .cm-content>.cm-table-widget,
.table-width-customized .markdown-rendered .markdown-preview-sizer>div:has(>table) {
    overflow: auto;
    width: var(--table-width) !important;
    margin-left: calc((var(--table-width) - 100%) / -2) !important;
}

:root table {
    --table-border-radius: 8px;
    border-collapse: separate;
    border-spacing: 2px;
}

tr td,
tr th {
    border-radius: var(--table-border-radius);
}

:root :is(td, th) {
    border-width: 1px;
}

/* Uncomment the lines below to remove border spacing and combine all table boxes together */

/* === erase this line to uncomment === //

:root table {border-spacing: 0;}
tr td, tr th {border-radius: 0;}
th:first-child {border-top-left-radius: var(--table-border-radius);}
th:last-child {border-top-right-radius: var(--table-border-radius);}
tr:last-child td:first-child {border-bottom-left-radius: var(--table-border-radius);}
tr:last-child td:last-child {border-bottom-right-radius: var(--table-border-radius);}
:root :is(td, th) {border-width: 0 var(--table-border-width) var(--table-border-width) 0;}

/* */