/* style.css sets ul { list-style: none; padding: 0 }. Restore lists for the
   shared SideNote editor and any rendered markdown from it. */
.sidenote-visual-editor ul,
.sidenote-prose ul {
    list-style-type: disc;
    list-style-position: outside;
    margin: 0 0 1rem;
    padding-left: 1.5rem;
}

.sidenote-visual-editor ol,
.sidenote-prose ol {
    list-style-type: decimal;
    list-style-position: outside;
    margin: 0 0 1rem;
    padding-left: 1.5rem;
}

.sidenote-visual-editor li,
.sidenote-prose li {
    display: list-item;
    line-height: 1.7;
}

.sidenote-visual-editor li + li,
.sidenote-prose li + li {
    margin-top: 0.35rem;
}

.sidenote-visual-editor ul.contains-task-list,
.sidenote-prose ul.contains-task-list {
    list-style: none;
    padding-left: 0;
}

.sidenote-visual-editor li.task-list-item,
.sidenote-prose li.task-list-item {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    line-height: 1.4;
}

.sidenote-visual-editor li.task-list-item input[type="checkbox"],
.sidenote-prose li.task-list-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    flex-shrink: 0;
    accent-color: #f59e0b;
    -webkit-appearance: checkbox;
    appearance: auto;
}

.sidenote-prose li.task-list-item input[type="checkbox"],
.sidenote-visual-editor[contenteditable="false"] li.task-list-item input[type="checkbox"] {
    pointer-events: none;
    cursor: default;
}

.sidenote-visual-editor[contenteditable="true"] li.task-list-item input[type="checkbox"],
.sidenote-prose.sidenote-prose--checkable li.task-list-item input[type="checkbox"] {
    pointer-events: auto;
    cursor: pointer;
}

/* Markdown tables. costum.css zeros padding and sets nowrap on every
   table tbody td:last-child (data-grid action column). Override that here
   so GitHub-style markdown tables keep cell padding and wrap. */
.sidenote-visual-editor table,
.sidenote-prose table {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    border-collapse: separate;
    border-spacing: 0;
    margin: 0 0 1rem;
    border: 1px solid color-mix(in srgb, currentColor 16%, transparent);
    border-radius: 12px;
    overflow: visible;
}

.sidenote-visual-editor table thead tr,
.sidenote-prose table thead tr {
    position: static;
    z-index: auto;
}

.sidenote-visual-editor th,
.sidenote-visual-editor td,
.sidenote-prose th,
.sidenote-prose td {
    padding: 10px 14px !important;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid color-mix(in srgb, currentColor 16%, transparent);
    border-right: 1px solid color-mix(in srgb, currentColor 16%, transparent);
    white-space: normal !important;
    overflow-wrap: break-word;
    word-break: normal;
}

.sidenote-visual-editor thead tr:first-child th:first-child,
.sidenote-prose thead tr:first-child th:first-child {
    border-top-left-radius: 12px;
}

.sidenote-visual-editor thead tr:first-child th:last-child,
.sidenote-prose thead tr:first-child th:last-child {
    border-top-right-radius: 12px;
}

.sidenote-visual-editor tr:last-child td:first-child,
.sidenote-prose tr:last-child td:first-child {
    border-bottom-left-radius: 12px;
}

.sidenote-visual-editor tr:last-child td:last-child,
.sidenote-prose tr:last-child td:last-child {
    border-bottom-right-radius: 12px;
}

.sidenote-visual-editor tr:last-child th,
.sidenote-visual-editor tr:last-child td,
.sidenote-prose tr:last-child th,
.sidenote-prose tr:last-child td {
    border-bottom: 0;
}

.sidenote-visual-editor th,
.sidenote-prose th {
    font-weight: 700;
    background: color-mix(in srgb, currentColor 8%, transparent);
}
