/**
 * ============================================================
 * Projeto Ícaro
 * Delta Analytics
 *
 * Delta Rich Editor
 * ============================================================
 */

@import url("../../../../vendor/katex/katex.min.css");

.delta-rich-editor {
    display: grid;
    grid-template-rows: auto 1fr auto;

    width: 100%;

    border:
        1px solid
        rgba(255, 255, 255, 0.12);

    border-radius: 12px;

    overflow: hidden;

    background:
        rgba(255, 255, 255, 0.025);
}


.delta-rich-editor__toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 8px;

    padding: 10px 12px;

    border-bottom:
        1px solid
        rgba(255, 255, 255, 0.10);

    background:
        rgba(255, 255, 255, 0.035);
}


.delta-rich-editor__toolbar-group {
    display: inline-flex;
    align-items: center;

    gap: 4px;

    padding-right: 8px;

    border-right:
        1px solid
        rgba(255, 255, 255, 0.10);
}


.delta-rich-editor__toolbar-group:last-child {
    border-right: 0;
}


.delta-rich-editor__toolbar button,
.delta-rich-editor__toolbar select {
    min-height: 34px;

    border:
        1px solid
        rgba(255, 255, 255, 0.12);

    border-radius: 7px;

    background:
        rgba(255, 255, 255, 0.04);

    color: inherit;

    font: inherit;

    cursor: pointer;
}


.delta-rich-editor__toolbar button {
    min-width: 34px;

    padding: 5px 9px;
}


.delta-rich-editor__toolbar select {
    padding: 5px 9px;
}


.delta-rich-editor__toolbar button:hover,
.delta-rich-editor__toolbar select:hover {
    background:
        rgba(255, 255, 255, 0.08);
}


.delta-rich-editor__toolbar button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}


.delta-rich-editor__toolbar button:disabled:hover {
    background:
        rgba(255, 255, 255, 0.04);
}


.delta-rich-editor__toolbar button.is-active {
    background:
        rgba(170, 26, 48, 0.22);

    border-color:
        rgba(190, 45, 68, 0.65);
}


.delta-rich-editor__surface {
    min-height: 260px;

    background:
        rgba(255, 255, 255, 0.015);
}


.delta-rich-editor__surface .tiptap {
    min-height: 260px;

    padding: 18px;

    outline: none;

    line-height: 1.65;
}


.delta-rich-editor__surface .tiptap p {
    margin:
        0 0 0.8em;
}


.delta-rich-editor__surface .tiptap h1,
.delta-rich-editor__surface .tiptap h2,
.delta-rich-editor__surface .tiptap h3 {
    margin:
        1em 0 0.5em;
}


.delta-rich-editor__surface .tiptap blockquote {
    margin:
        1em 0;

    padding:
        8px 14px;

    border-left:
        4px solid
        rgba(190, 45, 68, 0.75);

    background:
        rgba(255, 255, 255, 0.03);
}


.delta-rich-editor__surface .tiptap ul,
.delta-rich-editor__surface .tiptap ol {
    padding-left: 28px;
}


.delta-rich-editor__surface .tiptap table {
    width: 100%;

    border-collapse: collapse;

    margin:
        16px 0;
}


.delta-rich-editor__surface .tiptap th,
.delta-rich-editor__surface .tiptap td {
    min-width: 90px;

    padding: 8px 10px;

    border:
        1px solid
        rgba(255, 255, 255, 0.18);

    vertical-align: top;
}


.delta-rich-editor__surface
.tiptap
.selectedCell::after {
    content: "";

    position: absolute;
    inset: 0;

    pointer-events: none;

    background:
        rgba(160, 30, 50, 0.12);
}


.delta-rich-editor__surface
.tiptap
[data-placeholder]::before {
    content:
        attr(data-placeholder);

    float: left;

    height: 0;

    color:
        rgba(255, 255, 255, 0.35);

    pointer-events: none;
}


.delta-rich-editor__status {
    display: flex;
    justify-content: flex-end;

    padding:
        7px 12px;

    border-top:
        1px solid
        rgba(255, 255, 255, 0.08);

    font-size: 12px;

    opacity: 0.65;
}

/* ============================================================
 * Extended toolbar
 * ============================================================
 */

.delta-rich-editor__toolbar {
    display: grid;

    gap: 6px;

    overflow-x: auto;
}


.delta-rich-editor__toolbar-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 6px;
}


.delta-rich-editor__toolbar-group {
    flex-shrink: 0;
}


.delta-rich-editor__toolbar select {
    max-width: 170px;
}


.delta-rich-editor__color-control {
    position: relative;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 34px;
    min-height: 34px;

    padding: 4px 7px;

    border:
        1px solid
        rgba(255, 255, 255, 0.12);

    border-radius: 7px;

    cursor: pointer;

    font-weight: 700;
}


.delta-rich-editor__color-control input {
    position: absolute;

    width: 100%;
    height: 100%;

    inset: 0;

    opacity: 0;

    cursor: pointer;
}


.delta-rich-editor__panel {
    padding: 12px;

    border-bottom:
        1px solid
        rgba(255, 255, 255, 0.10);

    background:
        rgba(255, 255, 255, 0.035);
}


.delta-rich-editor__panel[hidden] {
    display: none;
}


.delta-rich-editor__panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;

    margin-bottom: 10px;
}


.delta-rich-editor__panel-header button {
    min-width: 30px;
    min-height: 30px;

    border:
        1px solid
        rgba(255, 255, 255, 0.12);

    border-radius: 7px;

    background:
        transparent;

    color:
        inherit;

    cursor: pointer;
}


.delta-rich-editor__special-character-grid {
    display: grid;

    grid-template-columns:
        repeat(
            auto-fill,
            minmax(
                40px,
                1fr
            )
        );

    gap: 5px;
}


.delta-rich-editor__special-character-grid button {
    min-height: 40px;

    border:
        1px solid
        rgba(255, 255, 255, 0.10);

    border-radius: 7px;

    background:
        rgba(255, 255, 255, 0.035);

    color:
        inherit;

    font-size: 18px;

    cursor: pointer;
}


.delta-rich-editor__special-character-grid button:hover {
    background:
        rgba(255, 255, 255, 0.08);
}


.delta-rich-editor__table-tools {
    display: flex;
    flex-wrap: wrap;

    gap: 6px;
}


.delta-rich-editor__table-tools button {
    min-height: 34px;

    padding: 6px 10px;

    border:
        1px solid
        rgba(255, 255, 255, 0.12);

    border-radius: 7px;

    background:
        rgba(255, 255, 255, 0.035);

    color:
        inherit;

    cursor: pointer;
}


.delta-rich-editor__table-tools button:hover {
    background:
        rgba(255, 255, 255, 0.08);
}


/* ============================================================
 * ProseMirror content
 * ============================================================
 */

.delta-rich-editor__surface .tiptap {
    word-break: break-word;
}


.delta-rich-editor__surface .tiptap a {
    text-decoration: underline;

    cursor: pointer;
}


.delta-rich-editor__surface .tiptap hr {
    margin: 24px 0;

    border: 0;

    border-top:
        1px solid
        rgba(255, 255, 255, 0.20);
}


.delta-rich-editor__surface
.tiptap
ul[data-type="taskList"] {
    padding-left: 0;

    list-style: none;
}


.delta-rich-editor__surface
.tiptap
ul[data-type="taskList"]
li {
    display: flex;
    align-items: flex-start;

    gap: 8px;
}


.delta-rich-editor__surface
.tiptap
ul[data-type="taskList"]
li
> label {
    margin-top: 3px;
}


.delta-rich-editor__surface
.tiptap
ul[data-type="taskList"]
li
> div {
    flex: 1;
}


.delta-rich-editor__surface
.tiptap
.tableWrapper {
    overflow-x: auto;
}


.delta-rich-editor__surface
.tiptap
table {
    position: relative;
}


.delta-rich-editor__surface
.tiptap
td,
.delta-rich-editor__surface
.tiptap
th {
    position: relative;
}


.delta-rich-editor__surface
.tiptap
th {
    font-weight: 700;

    background:
        rgba(255, 255, 255, 0.05);
}


.delta-rich-editor__surface
.tiptap
.column-resize-handle {
    position: absolute;

    top: 0;
    right: -2px;
    bottom: -2px;

    width: 4px;

    pointer-events: none;

    background:
        rgba(180, 35, 55, 0.7);
}


.delta-rich-editor__surface
.tiptap.resize-cursor {
    cursor: col-resize;
}

/* ============================================================
 * Delta Legal Ordered Lists
 *
 * Visual hierarchy:
 * 1.
 * 1.1.
 * 1.1.1.
 * 1.1.1.1.
 * ============================================================
 */

.delta-rich-editor__surface
.tiptap
ol {
    list-style:
        none;

    counter-reset:
        delta-list;

    padding-left:
        0;

    margin:
        0.6em 0;
}


.delta-rich-editor__surface
.tiptap
ol
> li {
    position:
        relative;

    counter-increment:
        delta-list;

    padding-left:
        2.7em;

    margin:
        0.28em 0;
}


.delta-rich-editor__surface
.tiptap
ol
> li::before {
    content:
        counters(
            delta-list,
            "."
        )
        ".";

    position:
        absolute;

    left:
        0;

    min-width:
        2.25em;

    font-variant-numeric:
        tabular-nums;

    font-weight:
        500;

    text-align:
        right;
}


.delta-rich-editor__surface
.tiptap
ol
ol {
    margin:
        0.3em 0 0.3em 0.6em;
}


.delta-rich-editor__surface
.tiptap
ol
ol
> li {
    padding-left:
        3.5em;
}


.delta-rich-editor__surface
.tiptap
ol
ol
ol
> li {
    padding-left:
        4.4em;
}


.delta-rich-editor__surface
.tiptap
ol
ol
ol
ol
> li {
    padding-left:
        5.2em;
}


/*
 * Tiptap places the nested list inside the previous list item.
 * Prevent paragraph spacing from making the hierarchy look
 * disconnected.
 */
.delta-rich-editor__surface
.tiptap
ol
> li
> p {
    margin-bottom:
        0.25em;
}

/* ============================================================
 * Professional document surface
 * ============================================================
 */

.delta-rich-editor__surface {
    padding:
        18px;

    background:
        rgba(
            0,
            0,
            0,
            0.14
        );
}


.delta-rich-editor__surface
.tiptap {
    width:
        min(
            860px,
            100%
        );

    min-height:
        420px;

    margin:
        0 auto;

    padding:
        44px
        52px
        64px;

    border:
        1px solid
        rgba(
            0,
            0,
            0,
            0.12
        );

    border-radius:
        3px;

    background:
        #ffffff;

    color:
        #171717;

    font-family:
        Calibri,
        Arial,
        sans-serif;

    font-size:
        10pt;

    line-height:
        1.25;

    box-shadow:
        0
        8px
        28px
        rgba(
            0,
            0,
            0,
            0.18
        );

    caret-color:
        #8f1d2c;
}


.delta-rich-editor__surface
.tiptap::selection,
.delta-rich-editor__surface
.tiptap
::selection {
    background:
        rgba(
            143,
            29,
            44,
            0.18
        );
}


.delta-rich-editor__surface
.tiptap
[data-placeholder]::before {
    color:
        rgba(
            0,
            0,
            0,
            0.34
        );
}


.delta-rich-editor__surface
.tiptap
blockquote {
    background:
        rgba(
            143,
            29,
            44,
            0.045
        );

    border-left-color:
        rgba(
            143,
            29,
            44,
            0.72
        );
}


.delta-rich-editor__surface
.tiptap
hr {
    border-top-color:
        rgba(
            0,
            0,
            0,
            0.22
        );
}


.delta-rich-editor__surface
.tiptap
th,
.delta-rich-editor__surface
.tiptap
td {
    border-color:
        rgba(
            0,
            0,
            0,
            0.24
        );
}


.delta-rich-editor__surface
.tiptap
th {
    background:
        rgba(
            0,
            0,
            0,
            0.045
        );
}


.delta-rich-editor__surface
.tiptap
.selectedCell::after {
    background:
        rgba(
            143,
            29,
            44,
            0.12
        );
}

/* ============================================================
 * Question authoring surface
 *
 * Delta Rich Editor edits semantic question content.
 * It is not a page-layout editor.
 * ============================================================
 */

.delta-rich-editor__surface {
    padding: 0;

    background:
        rgba(
            255,
            255,
            255,
            0.018
        );
}


.delta-rich-editor__surface
.tiptap {
    width: 100%;

    min-height:
        var(
            --delta-rich-editor-min-height,
            180px
        );

    margin: 0;

    padding:
        18px
        20px;

    border: 0;

    border-radius: 0;

    background:
        rgba(
            255,
            255,
            255,
            0.985
        );

    color:
        #171717;

    font-family:
        Calibri,
        Arial,
        sans-serif;

    font-size:
        10pt;

    line-height:
        1.25;

    box-shadow:
        none;

    outline:
        none;

    caret-color:
        #8f1d2c;
}


.delta-rich-editor--full
.delta-rich-editor__surface
.tiptap {
    min-height:
        var(
            --delta-rich-editor-min-height,
            260px
        );
}


.delta-rich-editor--focused
.delta-rich-editor__surface
.tiptap {
    min-height:
        var(
            --delta-rich-editor-min-height,
            150px
        );
}


.delta-rich-editor--compact
.delta-rich-editor__surface
.tiptap {
    min-height:
        var(
            --delta-rich-editor-min-height,
            90px
        );

    padding:
        14px
        16px;
}


.delta-rich-editor:focus-within {
    border-color:
        rgba(
            143,
            29,
            44,
            0.62
        );

    box-shadow:
        0
        0
        0
        2px
        rgba(
            143,
            29,
            44,
            0.10
        );
}

/* ============================================================
 * Delta Math Expression
 * ============================================================
 */

.delta-rich-editor__math-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.delta-rich-editor__math-button strong {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 15px;
    font-style: italic;
}


.delta-rich-editor__math-panel {
    max-width: 680px;
}


.delta-rich-editor__math-panel
.delta-rich-editor__panel-header > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}


.delta-rich-editor__math-panel
.delta-rich-editor__panel-header small {
    font-weight: 400;
    opacity: 0.72;
}


.delta-rich-editor__math-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 14px;
}


.delta-rich-editor__math-mode {
    display: flex;
    align-items: center;
    gap: 18px;
}


.delta-rich-editor__math-mode label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.delta-rich-editor__math-visual-section {
    display: grid;
    gap: 8px;
}


.delta-rich-editor__math-section-heading {
    display: flex;
    flex-direction: column;
    gap: 2px;
}


.delta-rich-editor__math-section-heading small {
    opacity: 0.72;
}


.delta-rich-editor__math-live-host {
    width: 100%;
    min-width: 0;
}


.delta-rich-editor__math-live-field {
    display: block;

    width: 100%;
    min-width: 0;
    min-height: 72px;

    box-sizing: border-box;

    padding:
        14px
        16px;

    border:
        1px solid
        rgba(
            127,
            127,
            127,
            0.35
        );

    border-radius: 8px;

    background:
        #ffffff;

    color:
        #171717;

    font-size:
        1.25rem;
}

.delta-rich-editor__math-palette {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 6px;
}


.delta-rich-editor__math-quick-section,
.delta-rich-editor__math-library-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}


.delta-rich-editor__math-palette-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;

    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.045em;
}


.delta-rich-editor__math-palette-heading small {
    font-size: 10px;
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
    opacity: 0.62;
}


.delta-rich-editor__math-palette-grid {
    display: grid;

    grid-template-columns:
        repeat(
            auto-fill,
            minmax(
                76px,
                1fr
            )
        );

    gap: 6px;
}


.delta-rich-editor__math-palette-grid--quick {
    grid-template-columns:
        repeat(
            auto-fill,
            minmax(
                82px,
                1fr
            )
        );
}


.delta-rich-editor__math-palette-button {
    min-width: 0;
    min-height: 52px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 3px;

    padding: 7px 6px;

    border:
        1px solid
        rgba(
            127,
            127,
            127,
            0.28
        );

    border-radius: 7px;

    background:
        rgba(
            127,
            127,
            127,
            0.045
        );

    color: inherit;

    cursor: pointer;
}


.delta-rich-editor__math-palette-button:hover {
    border-color:
        rgba(
            143,
            29,
            44,
            0.58
        );

    background:
        rgba(
            143,
            29,
            44,
            0.08
        );
}


.delta-rich-editor__math-palette-button.is-featured {
    min-height: 60px;

    border-color:
        rgba(
            143,
            29,
            44,
            0.30
        );

    background:
        rgba(
            143,
            29,
            44,
            0.055
        );
}


.delta-rich-editor__math-palette-symbol {
    font-family:
        "Cambria Math",
        "STIX Two Math",
        "Times New Roman",
        serif;

    font-size: 19px;
    line-height: 1.15;
}


.delta-rich-editor__math-palette-button.is-featured
.delta-rich-editor__math-palette-symbol {
    font-size: 22px;
}


.delta-rich-editor__math-palette-button small {
    width: 100%;

    overflow: hidden;

    font-size: 10px;

    opacity: 0.68;

    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}


.delta-rich-editor__math-library-toggle {
    width: 100%;

    padding: 9px 12px;

    border:
        1px solid
        rgba(
            143,
            29,
            44,
            0.28
        );

    border-radius: 7px;

    background:
        rgba(
            143,
            29,
            44,
            0.045
        );

    color: inherit;

    font-weight: 600;

    cursor: pointer;
}


.delta-rich-editor__math-library-toggle:hover {
    background:
        rgba(
            143,
            29,
            44,
            0.09
        );
}


.delta-rich-editor__math-library {
    display: flex;
    flex-direction: column;

    gap: 10px;

    padding: 12px;

    border:
        1px solid
        rgba(
            127,
            127,
            127,
            0.24
        );

    border-radius: 8px;

    background:
        rgba(
            127,
            127,
            127,
            0.025
        );
}


.delta-rich-editor__math-library[hidden] {
    display: none;
}


.delta-rich-editor__math-library-search {
    width: 100%;

    box-sizing: border-box;

    padding: 9px 11px;

    border:
        1px solid
        rgba(
            127,
            127,
            127,
            0.32
        );

    border-radius: 7px;

    background: #ffffff;

    color: #171717;

    font: inherit;
}


.delta-rich-editor__math-library-tabs {
    display: flex;
    flex-wrap: wrap;

    gap: 5px;
}


.delta-rich-editor__math-library-tabs button {
    padding: 5px 8px;

    border:
        1px solid
        rgba(
            127,
            127,
            127,
            0.25
        );

    border-radius: 999px;

    background:
        transparent;

    color: inherit;

    font-size: 11px;

    cursor: pointer;
}


.delta-rich-editor__math-library-tabs button:hover,
.delta-rich-editor__math-library-tabs button.is-active {
    border-color:
        rgba(
            143,
            29,
            44,
            0.52
        );

    background:
        rgba(
            143,
            29,
            44,
            0.10
        );
}


.delta-rich-editor__math-library-content {
    display: flex;
    flex-direction: column;

    gap: 16px;

    max-height: 430px;

    overflow-y: auto;

    padding-right: 4px;
}


.delta-rich-editor__math-library-group > strong {
    font-size: 12px;
}


.delta-rich-editor__math-library-empty {
    padding: 18px;

    text-align: center;

    font-size: 12px;

    opacity: 0.68;
}


.delta-rich-editor__math-code {
    border:
        1px solid
        rgba(
            127,
            127,
            127,
            0.22
        );

    border-radius: 8px;

    background:
        rgba(
            127,
            127,
            127,
            0.025
        );
}


.delta-rich-editor__math-code > summary {
    padding: 9px 11px;

    font-size: 12px;
    font-weight: 600;

    cursor: pointer;

    user-select: none;
}


.delta-rich-editor__math-code[open] > summary {
    border-bottom:
        1px solid
        rgba(
            127,
            127,
            127,
            0.18
        );
}


.delta-rich-editor__math-code
.delta-rich-editor__math-field {
    padding:
        10px
        10px
        0;
}


.delta-rich-editor__math-code
.delta-rich-editor__math-help {
    padding:
        0
        10px
        10px;
}


.delta-rich-editor__math-live-field:focus-within {
    border-color:
        rgba(
            143,
            29,
            44,
            0.72
        );

    outline:
        2px solid
        rgba(
            143,
            29,
            44,
            0.12
        );

    outline-offset:
        1px;
}

.delta-rich-editor__math-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}


.delta-rich-editor__math-field > span {
    font-weight: 600;
}


.delta-rich-editor__math-field textarea {
    width: 100%;
    min-height: 94px;
    resize: vertical;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid
        rgba(127, 127, 127, 0.35);
    border-radius: 7px;
    font-family:
        "Cascadia Code",
        Consolas,
        monospace;
    font-size: 13px;
    line-height: 1.5;
}


.delta-rich-editor__math-help {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 12px;
    opacity: 0.8;
}


.delta-rich-editor__math-help code {
    padding: 3px 6px;
    border-radius: 4px;
    background:
        rgba(127, 127, 127, 0.12);
}


.delta-rich-editor__math-preview-section {
    display: flex;
    flex-direction: column;
    gap: 7px;
}


.delta-rich-editor__math-preview {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: auto;
    padding: 16px;
    border: 1px solid
        rgba(127, 127, 127, 0.26);
    border-radius: 8px;
    background: #ffffff;
    color: #111111;
}


.delta-rich-editor__math-error {
    padding: 8px 10px;
    border-radius: 6px;
    background:
        rgba(190, 30, 45, 0.1);
    color:
        #a71927;
    font-size: 12px;
}


.delta-rich-editor__math-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}


.delta-rich-editor__math-actions
button {
    padding: 7px 12px;
}


.delta-rich-editor__math-actions
[data-math-submit] {
    font-weight: 600;
}


.delta-rich-editor__math-actions
[data-math-submit]:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}


.delta-math-expression {
    cursor: pointer;
    border-radius: 4px;
    transition:
        box-shadow 120ms ease,
        background-color 120ms ease;
}


.delta-math-expression--inline {
    display: inline;
    margin: 0;
    padding: 0;
    vertical-align: baseline;
    line-height: inherit;
    font-size: inherit;
}

.delta-math-expression--inline > .katex {
    display: inline;
    margin: 0;
    padding: 0;
    font-size: 1em;
    line-height: inherit;
}


.delta-math-expression--block {
    display: block;
    width: 100%;
    margin: 0.85em 0;
    text-align: center;
}


.delta-math-expression:hover {
    background:
        rgba(127, 127, 127, 0.08);
}


.delta-math-expression.is-selected {
    box-shadow:
        0 0 0 2px
        rgba(190, 30, 45, 0.35);
}

/* ============================================================
 * Delta Table Editor
 * ============================================================
 */

.delta-rich-editor__table-insert-panel {
    max-width: 520px;
}


.delta-rich-editor__table-insert-panel
.delta-rich-editor__panel-header > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}


.delta-rich-editor__table-insert-panel
.delta-rich-editor__panel-header small {
    font-weight: 400;
    opacity: 0.72;
}


.delta-rich-editor__table-insert-content {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 14px;
}


.delta-rich-editor__table-grid-picker {
    display: grid;
    grid-template-columns:
        repeat(
            10,
            26px
        );
    gap: 3px;
    width: max-content;
}


.delta-rich-editor__table-grid-cell {
    width: 26px;
    height: 26px;
    padding: 0;
    border: 1px solid
        rgba(127, 127, 127, 0.38);
    border-radius: 3px;
    background: #ffffff;
    cursor: pointer;
}


.delta-rich-editor__table-grid-cell:hover,
.delta-rich-editor__table-grid-cell.is-selected {
    border-color:
        rgba(190, 30, 45, 0.75);
    background:
        rgba(190, 30, 45, 0.12);
}


.delta-rich-editor__table-grid-status {
    min-height: 20px;
    font-size: 13px;
    font-weight: 600;
}


.delta-rich-editor__table-dimensions {
    display: flex;
    gap: 12px;
}


.delta-rich-editor__table-dimensions label {
    display: flex;
    flex-direction: column;
    gap: 5px;
}


.delta-rich-editor__table-dimensions span {
    font-size: 12px;
    font-weight: 600;
}


.delta-rich-editor__table-dimensions input {
    width: 90px;
    box-sizing: border-box;
    padding: 7px 8px;
}


.delta-rich-editor__table-insert-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}


.delta-rich-editor__table-insert-options label {
    display: flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
}


.delta-rich-editor__table-insert-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}


.delta-rich-editor__table-insert-actions
[data-table-insert-confirm] {
    font-weight: 600;
}


/* Editing surface */

.delta-rich-editor
.ProseMirror table {
    width: max-content;
    max-width: none;

    border-collapse: collapse;

    table-layout: fixed;

    margin:
        12px
        0;
}


.delta-rich-editor
.ProseMirror td,
.delta-rich-editor
.ProseMirror th {
    position: relative;
    min-width: 48px;
    padding: 7px 9px;
    border: 1px solid
        rgba(70, 70, 70, 0.45);
    vertical-align: middle;
}


.delta-rich-editor
.ProseMirror th {
    font-weight: 600;
    background:
        rgba(127, 127, 127, 0.09);
}


.delta-rich-editor
.ProseMirror .selectedCell::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        rgba(190, 30, 45, 0.1);
}


.delta-rich-editor
.ProseMirror
.tableWrapper {
    width: 100%;
    max-width: 100%;

    overflow-x: auto;
    overflow-y: hidden;

    margin:
        10px
        0;

    padding-bottom: 6px;

    scrollbar-gutter:
        stable;

    overscroll-behavior-x:
        contain;
}

.delta-rich-editor
.ProseMirror
.tableWrapper
table {
    max-width: none;
}


.delta-rich-editor
.ProseMirror
.tableWrapper::-webkit-scrollbar {
    height: 10px;
}


.delta-rich-editor
.ProseMirror
.tableWrapper::-webkit-scrollbar-track {
    background:
        rgba(
            127,
            127,
            127,
            0.10
        );

    border-radius:
        999px;
}


.delta-rich-editor
.ProseMirror
.tableWrapper::-webkit-scrollbar-thumb {
    background:
        rgba(
            127,
            127,
            127,
            0.38
        );

    border-radius:
        999px;
}


.delta-rich-editor
.ProseMirror
.tableWrapper::-webkit-scrollbar-thumb:hover {
    background:
        rgba(
            127,
            127,
            127,
            0.55
        );
}


.delta-rich-editor
.ProseMirror
.column-resize-handle {
    position: absolute;
    top: 0;
    right: -2px;
    bottom: 0;
    width: 4px;
    pointer-events: none;
    background:
        rgba(190, 30, 45, 0.55);
}

/* ============================================================
 * Advanced Table Tools
 * ============================================================
 */

.delta-rich-editor__table-tools-panel {
    width: min(720px, 100%);
    max-width: 720px;
}


.delta-rich-editor__table-tools-panel
.delta-rich-editor__panel-header > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}


.delta-rich-editor__table-tools-panel
.delta-rich-editor__panel-header small {
    font-weight: 400;
    opacity: 0.72;
}


.delta-rich-editor__table-tools {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 14px;
}


.delta-rich-editor__table-tool-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 14px;
    border-bottom: 1px solid
        rgba(127, 127, 127, 0.18);
}


.delta-rich-editor__table-tool-section:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}


.delta-rich-editor__table-tool-section > strong {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.72;
}


.delta-rich-editor__table-tool-grid {
    display: grid;
    grid-template-columns:
        repeat(
            auto-fit,
            minmax(135px, 1fr)
        );
    gap: 7px;
}


.delta-rich-editor__table-tool-grid button {
    min-height: 34px;
    padding: 6px 9px;
    text-align: left;
}


.delta-rich-editor__table-style-grid {
    display: grid;
    grid-template-columns:
        repeat(
            auto-fit,
            minmax(135px, 1fr)
        );
    gap: 10px;
}


.delta-rich-editor__table-style-grid label {
    display: flex;
    flex-direction: column;
    gap: 5px;
}


.delta-rich-editor__table-style-grid label > span {
    font-size: 12px;
    font-weight: 600;
}


.delta-rich-editor__table-style-grid select,
.delta-rich-editor__table-style-grid input[type="color"] {
    width: 100%;
    min-height: 34px;
    box-sizing: border-box;
}


.delta-rich-editor__table-style-grid input[type="color"] {
    padding: 2px;
}


.delta-rich-editor__table-clear-cell-style {
    align-self: flex-start;
    margin-top: 2px;
}


.delta-rich-editor__table-tool-grid
button.is-danger {
    color: #a71927;
}


/*
 * Important for ENEM-style numeric tables:
 * do not force wrapping where it would make
 * values such as 12,5%, 3,14 or 1 250 unreadable.
 */

.delta-rich-editor
.ProseMirror td,
.delta-rich-editor
.ProseMirror th {
    overflow-wrap: anywhere;
}


.delta-rich-editor
.ProseMirror td p,
.delta-rich-editor
.ProseMirror th p {
    margin: 0;
}


.delta-rich-editor
.ProseMirror td p + p,
.delta-rich-editor
.ProseMirror th p + p {
    margin-top: 0.4em;
}

/* ============================================================
 * Large Question Authoring Workspace
 * ============================================================
 */

.question-authoring-dialog {
    box-sizing: border-box;
    overscroll-behavior: contain;
}


.question-authoring-dialog
.delta-rich-editor--context-support,

.question-authoring-dialog
.delta-rich-editor--context-shared-support {
    --delta-rich-editor-min-height:
        360px;
}


.question-authoring-dialog
.delta-rich-editor--context-prompt {
    --delta-rich-editor-min-height:
        200px;
}


.question-authoring-dialog
.delta-rich-editor--context-option {
    --delta-rich-editor-min-height:
        120px;
}


.question-authoring-dialog
.delta-rich-editor__toolbar {
    position: sticky;
    top: 0;

    z-index: 8;

    backdrop-filter:
        blur(12px);
}


.question-authoring-dialog
.delta-rich-editor__surface {
    min-height:
        var(
            --delta-rich-editor-min-height,
            260px
        );
}


.question-authoring-dialog
.delta-rich-editor__surface
.tiptap {
    min-height:
        var(
            --delta-rich-editor-min-height,
            260px
        );
}


/* ============================================================
 * Shared Delta Color Picker
 * ============================================================
 */

.delta-editor-color-picker {
    display: flex;
    flex-direction: column;
    gap: 12px;

    min-width: 280px;
}


.delta-editor-color-picker__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}


.delta-editor-color-picker__current {
    display: flex;
    align-items: center;
    gap: 6px;
}


.delta-editor-color-picker__current-swatch {
    width: 28px;
    height: 28px;

    flex: 0 0 auto;

    border:
        1px solid
        rgba(127, 127, 127, 0.45);

    border-radius: 6px;

    box-shadow:
        0 0 0 1px
        rgba(255, 255, 255, 0.25)
        inset;
}


.delta-editor-color-picker__current
input[type="text"] {
    width: 82px;

    min-height: 30px;

    box-sizing: border-box;

    padding:
        4px
        7px;

    font-family:
        ui-monospace,
        SFMono-Regular,
        Consolas,
        monospace;

    text-transform: uppercase;
}


.delta-editor-color-picker__favorite {
    width: 32px;
    height: 32px;

    padding: 0;

    font-size: 18px;

    cursor: pointer;
}


.delta-editor-color-picker__favorite.is-active {
    font-weight: 700;
}


.delta-editor-color-picker__section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}


.delta-editor-color-picker__section small {
    font-size: 11px;
    font-weight: 700;

    text-transform: uppercase;

    letter-spacing:
        0.04em;

    opacity: 0.7;
}


.delta-editor-color-picker__swatches {
    display: grid;

    grid-template-columns:
        repeat(
            9,
            26px
        );

    gap: 5px;
}


.delta-editor-color-picker__swatch {
    position: relative;

    width: 26px;
    height: 26px;

    padding: 0;

    border:
        1px solid
        rgba(127, 127, 127, 0.45);

    border-radius: 5px;

    cursor: pointer;

    box-shadow:
        0 0 0 1px
        rgba(255, 255, 255, 0.18)
        inset;
}


.delta-editor-color-picker__swatch:hover {
    transform:
        scale(1.12);

    outline:
        2px solid
        rgba(190, 30, 45, 0.42);

    outline-offset:
        1px;
}


.delta-editor-color-picker__actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 8px;
}


.delta-editor-color-picker__native {
    position: relative;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 34px;

    padding:
        0
        10px;

    border:
        1px solid
        rgba(127, 127, 127, 0.35);

    border-radius: 7px;

    cursor: pointer;

    overflow: hidden;
}


.delta-editor-color-picker__native
input[type="color"] {
    position: absolute;

    width: 1px;
    height: 1px;

    opacity: 0;

    pointer-events: none;
}


@media (
    max-width: 900px
) {
    .question-authoring-dialog {
        width:
            calc(
                100vw - 16px
            )
            !important;

        height:
            calc(
                100vh - 16px
            )
            !important;

        max-width:
            none
            !important;

        max-height:
            none
            !important;
    }


    .question-authoring-dialog
    .delta-rich-editor__toolbar {
        position: static;
    }
}

/* ============================================================
 * Delta Color System Integration
 * ============================================================
 */

.delta-rich-editor__color-button {
    position: relative;
    min-width: 34px;
}


.delta-rich-editor__color-indicator {
    position: absolute;
    left: 6px;
    right: 6px;
    bottom: 3px;

    height: 3px;

    border-radius: 999px;

    pointer-events: none;
}


.delta-rich-editor__color-panel {
    width: min(390px, calc(100vw - 32px));
}


.delta-rich-editor__color-picker-host {
    padding: 14px;
}


.delta-rich-editor__color-panel-footer {
    display: flex;
    justify-content: flex-end;

    padding:
        0
        14px
        14px;
}


.delta-rich-editor__table-color-control {
    display: flex;
    flex-direction: column;
    gap: 5px;
}


.delta-rich-editor__table-color-control > span {
    font-size: 12px;
    font-weight: 600;
}


.delta-rich-editor__table-color-control > button {
    display: flex;
    align-items: center;
    gap: 8px;

    min-height: 34px;

    padding:
        5px
        8px;

    text-align: left;
}


.delta-rich-editor__table-color-preview {
    width: 22px;
    height: 22px;

    flex: 0 0 auto;

    border:
        1px solid
        rgba(127, 127, 127, 0.42);

    border-radius: 4px;
}


.delta-rich-editor__table-color-picker {
    padding: 12px;

    border:
        1px solid
        rgba(127, 127, 127, 0.2);

    border-radius: 8px;

    background:
        rgba(127, 127, 127, 0.035);
}

/* ============================================================
 * Delta Advanced Custom Color Dialog
 * ============================================================
 */

.delta-editor-color-picker__more {
    min-height: 34px;

    padding:
        6px
        10px;

    border:
        1px solid
        rgba(127, 127, 127, 0.35);

    border-radius: 7px;

    background:
        rgba(127, 127, 127, 0.06);

    color: inherit;

    font: inherit;

    cursor: pointer;
}


.delta-editor-color-picker__more:hover {
    background:
        rgba(127, 127, 127, 0.12);
}


.delta-editor-color-picker__actions
button {
    min-height: 34px;

    padding:
        6px
        10px;

    border:
        1px solid
        rgba(127, 127, 127, 0.35);

    border-radius: 7px;

    background:
        rgba(127, 127, 127, 0.06);

    color: inherit;

    font: inherit;

    cursor: pointer;
}


.delta-editor-custom-color-backdrop {
    position: fixed;

    inset: 0;

    z-index: 100000;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 24px;

    box-sizing: border-box;

    background:
        rgba(
            0,
            0,
            0,
            0.58
        );

    backdrop-filter:
        blur(3px);
}


.delta-editor-custom-color-dialog {
    width:
        min(
            720px,
            calc(
                100vw - 32px
            )
        );

    max-height:
        calc(
            100vh - 32px
        );

    overflow: auto;

    box-sizing: border-box;

    border:
        1px solid
        rgba(127, 127, 127, 0.34);

    border-radius: 12px;

    background:
        #ffffff;

    color:
        #171717;

    box-shadow:
        0
        22px
        70px
        rgba(
            0,
            0,
            0,
            0.38
        );
}


.delta-editor-custom-color-dialog__header {
    position: sticky;

    top: 0;

    z-index: 2;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 16px;

    padding:
        16px
        18px;

    border-bottom:
        1px solid
        rgba(0, 0, 0, 0.12);

    background:
        rgba(
            255,
            255,
            255,
            0.97
        );
}


.delta-editor-custom-color-dialog__header
> div {
    display: flex;
    flex-direction: column;

    gap: 2px;
}


.delta-editor-custom-color-dialog__header
strong {
    font-size: 16px;
}


.delta-editor-custom-color-dialog__header
small {
    color:
        rgba(
            0,
            0,
            0,
            0.62
        );
}


.delta-editor-custom-color-dialog__header
button {
    width: 34px;
    height: 34px;

    flex: 0 0 auto;

    padding: 0;

    border:
        1px solid
        rgba(0, 0, 0, 0.16);

    border-radius: 7px;

    background:
        transparent;

    color: inherit;

    font-size: 20px;

    cursor: pointer;
}


.delta-editor-custom-color-dialog__body {
    display: grid;

    grid-template-columns:
        minmax(
            280px,
            1.25fr
        )
        minmax(
            220px,
            0.75fr
        );

    gap: 22px;

    padding: 20px;
}


.delta-editor-custom-color-dialog__visual {
    min-width: 0;

    display: flex;
    flex-direction: column;

    gap: 14px;
}


.delta-editor-custom-color-dialog__saturation {
    position: relative;

    width: 100%;

    aspect-ratio:
        1.55 / 1;

    min-height: 240px;

    overflow: hidden;

    border:
        1px solid
        rgba(0, 0, 0, 0.20);

    border-radius: 8px;

    cursor: crosshair;

    touch-action: none;

    user-select: none;
}


.delta-editor-custom-color-dialog__saturation-cursor {
    position: absolute;

    width: 14px;
    height: 14px;

    box-sizing: border-box;

    border:
        2px solid
        #ffffff;

    border-radius:
        50%;

    box-shadow:
        0
        0
        0
        1px
        rgba(
            0,
            0,
            0,
            0.75
        );

    transform:
        translate(
            -50%,
            -50%
        );

    pointer-events:
        none;
}


.delta-editor-custom-color-dialog__hue {
    display: flex;
    flex-direction: column;

    gap: 6px;
}


.delta-editor-custom-color-dialog__hue
> span {
    font-size: 12px;
    font-weight: 600;
}


.delta-editor-custom-color-dialog__hue
input[type="range"] {
    width: 100%;

    height: 18px;

    margin: 0;

    padding: 0;

    border-radius:
        999px;

    appearance: none;

    -webkit-appearance:
        none;

    background:
        linear-gradient(
            to right,
            hsl(0 100% 50%),
            hsl(60 100% 50%),
            hsl(120 100% 50%),
            hsl(180 100% 50%),
            hsl(240 100% 50%),
            hsl(300 100% 50%),
            hsl(360 100% 50%)
        );

    cursor: pointer;
}


.delta-editor-custom-color-dialog__hue
input[type="range"]::-webkit-slider-thumb {
    width: 18px;
    height: 24px;

    appearance: none;

    -webkit-appearance:
        none;

    border:
        2px solid
        #ffffff;

    border-radius: 5px;

    background:
        transparent;

    box-shadow:
        0
        0
        0
        1px
        rgba(
            0,
            0,
            0,
            0.7
        );
}


.delta-editor-custom-color-dialog__hue
input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 20px;

    border:
        2px solid
        #ffffff;

    border-radius: 5px;

    background:
        transparent;

    box-shadow:
        0
        0
        0
        1px
        rgba(
            0,
            0,
            0,
            0.7
        );
}


.delta-editor-custom-color-dialog__values {
    display: flex;
    flex-direction: column;

    gap: 14px;
}


.delta-editor-custom-color-dialog__hex {
    display: flex;
    flex-direction: column;

    gap: 5px;
}


.delta-editor-custom-color-dialog__hex
> span {
    font-size: 12px;
    font-weight: 700;
}


.delta-editor-custom-color-dialog__hex
input {
    min-height: 36px;

    box-sizing: border-box;

    padding:
        6px
        9px;

    border:
        1px solid
        rgba(0, 0, 0, 0.22);

    border-radius: 6px;

    font-family:
        ui-monospace,
        SFMono-Regular,
        Consolas,
        monospace;

    text-transform:
        uppercase;
}


.delta-editor-custom-color-dialog__values
fieldset {
    display: grid;

    grid-template-columns:
        repeat(
            3,
            minmax(
                0,
                1fr
            )
        );

    gap: 8px;

    margin: 0;

    padding:
        12px;

    border:
        1px solid
        rgba(0, 0, 0, 0.14);

    border-radius: 8px;
}


.delta-editor-custom-color-dialog__values
legend {
    padding:
        0
        5px;

    font-size: 12px;
    font-weight: 700;
}


.delta-editor-custom-color-dialog__values
fieldset
label {
    min-width: 0;

    display: flex;
    flex-direction: column;

    gap: 4px;
}


.delta-editor-custom-color-dialog__values
fieldset
label
span {
    overflow: hidden;

    font-size: 11px;

    text-overflow:
        ellipsis;

    white-space:
        nowrap;
}


.delta-editor-custom-color-dialog__values
input[type="number"] {
    width: 100%;

    min-width: 0;
    min-height: 34px;

    box-sizing: border-box;

    padding:
        5px
        7px;

    border:
        1px solid
        rgba(0, 0, 0, 0.20);

    border-radius: 6px;
}


.delta-editor-custom-color-dialog__comparison {
    grid-column:
        1 / -1;

    display: grid;

    grid-template-columns:
        repeat(
            2,
            minmax(
                0,
                1fr
            )
        );

    gap: 12px;
}


.delta-editor-custom-color-dialog__comparison
> div {
    display: flex;
    flex-direction: column;

    gap: 6px;
}


.delta-editor-custom-color-dialog__comparison
span {
    font-size: 12px;
    font-weight: 700;
}


.delta-editor-custom-color-dialog__comparison
div
div {
    min-height: 58px;

    border:
        1px solid
        rgba(0, 0, 0, 0.20);

    border-radius: 7px;
}


.delta-editor-custom-color-dialog__footer {
    position: sticky;

    bottom: 0;

    z-index: 2;

    display: flex;
    justify-content: flex-end;

    gap: 8px;

    padding:
        14px
        18px;

    border-top:
        1px solid
        rgba(0, 0, 0, 0.12);

    background:
        rgba(
            255,
            255,
            255,
            0.97
        );
}


.delta-editor-custom-color-dialog__footer
button {
    min-height: 36px;

    padding:
        7px
        14px;

    border:
        1px solid
        rgba(0, 0, 0, 0.18);

    border-radius: 7px;

    background:
        #ffffff;

    color:
        #171717;

    font: inherit;

    cursor: pointer;
}


.delta-editor-custom-color-dialog__footer
[data-custom-color-confirm] {
    border-color:
        #8f1d2c;

    background:
        #8f1d2c;

    color:
        #ffffff;

    font-weight: 600;
}


.delta-editor-custom-color-dialog__footer
button:hover {
    filter:
        brightness(
            0.96
        );
}


@media (
    max-width: 680px
) {
    .delta-editor-custom-color-backdrop {
        padding: 8px;
    }


    .delta-editor-custom-color-dialog {
        width: 100%;

        max-height:
            calc(
                100vh - 16px
            );
    }


    .delta-editor-custom-color-dialog__body {
        grid-template-columns:
            1fr;
    }


    .delta-editor-custom-color-dialog__comparison {
        grid-column:
            1;
    }


    .delta-editor-custom-color-dialog__saturation {
        min-height: 190px;
    }
}

/* ============================================================
 * Universal Rich Editor Capability Layout
 *
 * Every Delta Rich Editor context uses the same content engine
 * and must support the same rich-content structures.
 * Context changes presentation only.
 * ============================================================
 */

.delta-rich-editor {
    min-width: 0;
    max-width: 100%;
}


.delta-rich-editor__surface {
    min-width: 0;
    max-width: 100%;

    overflow: hidden;
}


.delta-rich-editor__surface
.ProseMirror {
    min-width: 0;
    max-width: 100%;

    box-sizing: border-box;
}


.delta-rich-editor__surface
.ProseMirror
.tableWrapper {
    display: block;

    width: 100%;
    max-width: 100%;

    min-width: 0;

    overflow-x: auto;
    overflow-y: hidden;

    box-sizing: border-box;

    padding-bottom: 8px;

    scrollbar-gutter: stable;

    overscroll-behavior-x: contain;

    -webkit-overflow-scrolling: touch;
}


.delta-rich-editor__surface
.ProseMirror
.tableWrapper
table {
    width: max-content;
    max-width: none;
}


/*
 * The capability contract is identical in every authoring
 * context. These selectors are intentionally grouped.
 */

.delta-rich-editor--context-support,
.delta-rich-editor--context-shared-support,
.delta-rich-editor--context-prompt,
.delta-rich-editor--context-option {
    min-width: 0;
    max-width: 100%;
}


.delta-rich-editor--context-support
.delta-rich-editor__surface,

.delta-rich-editor--context-shared-support
.delta-rich-editor__surface,

.delta-rich-editor--context-prompt
.delta-rich-editor__surface,

.delta-rich-editor--context-option
.delta-rich-editor__surface {
    min-width: 0;
    max-width: 100%;
}

.delta-rich-editor__table-size-control {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        auto;

    align-items: center;

    gap: 6px;
}


.delta-rich-editor__table-size-control
input {
    width: 100%;
    min-width: 0;
    min-height: 34px;

    box-sizing: border-box;

    padding:
        5px
        8px;
}


.delta-rich-editor__table-size-control
> span {
    font-size: 12px;

    opacity: 0.68;
}

/* ============================================================
 * Delta Table Layout
 * ============================================================
 */

.delta-rich-editor__table-layout-controls {
    display: grid;

    grid-template-columns:
        repeat(
            auto-fit,
            minmax(
                180px,
                1fr
            )
        );

    gap: 10px;

    margin-bottom: 10px;
}


.delta-rich-editor__table-layout-controls
label {
    display: flex;

    flex-direction: column;

    gap: 5px;
}


.delta-rich-editor__table-layout-controls
label > span {
    font-size: 12px;
    font-weight: 600;
}


.delta-rich-editor__table-layout-controls
select,
.delta-rich-editor__table-layout-controls
input {
    width: 100%;

    min-height: 34px;

    box-sizing: border-box;
}


/*
 * Width belongs to the table itself.
 */

.delta-rich-editor__surface
.ProseMirror
table[data-delta-table-width="50%"] {
    width: 50%;
}


.delta-rich-editor__surface
.ProseMirror
table[data-delta-table-width="75%"] {
    width: 75%;
}


.delta-rich-editor__surface
.ProseMirror
table[data-delta-table-width="100%"] {
    width: 100%;
}


.delta-rich-editor__surface
.ProseMirror
table[data-delta-table-width="fit-content"] {
    width: max-content;
}


/*
 * Alignment.
 */

.delta-rich-editor__surface
.ProseMirror
table[data-delta-table-alignment="left"] {
    margin-left: 0;
    margin-right: auto;
}


.delta-rich-editor__surface
.ProseMirror
table[data-delta-table-alignment="center"] {
    margin-left: auto;
    margin-right: auto;
}


.delta-rich-editor__surface
.ProseMirror
table[data-delta-table-alignment="right"] {
    margin-left: auto;
    margin-right: 0;
}

.delta-rich-editor__surface
.ProseMirror
table[data-delta-table-width] {
    max-width: none;
}

/* ============================================================
 * MathLive overlays
 * ============================================================
 */

math-field {
    position: relative;

    z-index: 20;
}


math-field::part(virtual-keyboard-toggle),
math-field::part(menu-toggle) {
    position: relative;

    z-index: 21;
}


/*
 * MathLive creates floating UI outside the editor surface.
 * Keep its keyboard, menus and popovers above Delta dialogs.
 */
.ML__keyboard,
.ML__keyboard-container,
.ML__popover,
.ML__menu,
.ML__context-menu,
math-virtual-keyboard {
    z-index: 1000000 !important;
}

/* ============================================================
 * Delta Image
 * ============================================================ */

.delta-rich-editor__image-button {
    display:
        inline-flex;

    align-items:
        center;

    gap:
        6px;

    white-space:
        nowrap;
}


.delta-rich-editor__image-button-icon {
    font-size:
        16px;

    line-height:
        1;
}


.delta-rich-editor__image-panel {
    width:
        min(
            720px,
            calc(100vw - 40px)
        );

    max-width:
        720px;
}


.delta-rich-editor__image-panel
.delta-rich-editor__panel-header > div {
    display:
        flex;

    flex-direction:
        column;

    gap:
        2px;
}


.delta-rich-editor__image-panel
.delta-rich-editor__panel-header small {
    font-weight:
        400;

    opacity:
        0.72;
}


.delta-rich-editor__image-form {
    display:
        flex;

    flex-direction:
        column;

    gap:
        16px;

    padding:
        16px;
}


.delta-rich-editor__image-file-section {
    display:
        flex;

    flex-direction:
        column;

    gap:
        7px;
}


.delta-rich-editor__image-file-actions {
    display:
        flex;

    align-items:
        center;

    flex-wrap:
        wrap;

    gap:
        10px;
}


.delta-rich-editor__image-file-actions
button {
    min-height:
        34px;

    padding:
        6px
        12px;
}


.delta-rich-editor__image-file-actions
[data-image-file-name] {
    min-width:
        0;

    overflow:
        hidden;

    color:
        #555555;

    font-size:
        12px;

    text-overflow:
        ellipsis;

    white-space:
        nowrap;
}


.delta-rich-editor__image-file-help {
    color:
        #666666;

    font-size:
        11px;
}


.delta-rich-editor__image-error {
    padding:
        10px
        12px;

    border:
        1px solid
        rgba(
            143,
            29,
            44,
            0.30
        );

    border-radius:
        6px;

    background:
        rgba(
            143,
            29,
            44,
            0.08
        );

    color:
        #7a1825;

    font-size:
        12px;
}


.delta-rich-editor__image-preview-wrapper {
    padding:
        14px;

    border:
        1px solid
        rgba(
            0,
            0,
            0,
            0.10
        );

    border-radius:
        7px;

    background:
        rgba(
            0,
            0,
            0,
            0.025
        );

    overflow:
        hidden;
}


.delta-rich-editor__image-preview {
    max-width:
        100%;
}


.delta-rich-editor__image-preview[data-alignment="left"] {
    margin-right:
        auto;

    margin-left:
        0;
}


.delta-rich-editor__image-preview[data-alignment="center"] {
    margin-right:
        auto;

    margin-left:
        auto;
}


.delta-rich-editor__image-preview[data-alignment="right"] {
    margin-right:
        0;

    margin-left:
        auto;
}


.delta-rich-editor__image-preview img {
    display:
        block;

    width:
        100%;

    height:
        auto;

    max-width:
        100%;

    border-radius:
        3px;

    object-fit:
        contain;
}


.delta-rich-editor__image-dimensions {
    margin-top:
        8px;

    color:
        #666666;

    font-size:
        11px;

    text-align:
        center;
}


.delta-rich-editor__image-fields {
    display:
        grid;

    grid-template-columns:
        1fr;

    gap:
        12px;
}


.delta-rich-editor__image-field {
    display:
        flex;

    flex-direction:
        column;

    gap:
        5px;
}


.delta-rich-editor__image-field > span,
.delta-rich-editor__image-width-field > span {
    font-size:
        12px;

    font-weight:
        600;
}


.delta-rich-editor__image-field input,
.delta-rich-editor__image-field textarea,
.delta-rich-editor__image-width-control input[type="number"] {
    box-sizing:
        border-box;

    width:
        100%;

    border:
        1px solid
        rgba(
            0,
            0,
            0,
            0.18
        );

    border-radius:
        5px;

    background:
        #ffffff;

    color:
        #171717;

    font:
        inherit;
}


.delta-rich-editor__image-field input {
    min-height:
        36px;

    padding:
        7px
        9px;
}


.delta-rich-editor__image-field textarea {
    min-height:
        58px;

    padding:
        8px
        9px;

    resize:
        vertical;
}


.delta-rich-editor__image-field small {
    color:
        #666666;

    font-size:
        11px;
}


.delta-rich-editor__image-layout {
    display:
        grid;

    grid-template-columns:
        minmax(
            220px,
            0.8fr
        )
        minmax(
            260px,
            1.2fr
        );

    gap:
        18px;

    align-items:
        end;
}


.delta-rich-editor__image-alignment {
    display:
        flex;

    flex-wrap:
        wrap;

    gap:
        10px;

    min-width:
        0;

    margin:
        0;

    padding:
        10px
        12px;

    border:
        1px solid
        rgba(
            0,
            0,
            0,
            0.12
        );

    border-radius:
        6px;
}


.delta-rich-editor__image-alignment legend {
    padding:
        0
        4px;

    font-size:
        12px;

    font-weight:
        600;
}


.delta-rich-editor__image-alignment label {
    display:
        inline-flex;

    align-items:
        center;

    gap:
        4px;

    font-size:
        12px;
}


.delta-rich-editor__image-width-field {
    display:
        flex;

    flex-direction:
        column;

    gap:
        7px;
}


.delta-rich-editor__image-width-control {
    display:
        grid;

    grid-template-columns:
        minmax(
            120px,
            1fr
        )
        70px
        auto;

    gap:
        8px;

    align-items:
        center;
}


.delta-rich-editor__image-width-control
input[type="range"] {
    width:
        100%;
}


.delta-rich-editor__image-width-control
input[type="number"] {
    min-height:
        34px;

    padding:
        5px
        7px;
}


.delta-rich-editor__image-presets {
    display:
        flex;

    align-items:
        center;

    flex-wrap:
        wrap;

    gap:
        6px;
}


.delta-rich-editor__image-presets > span {
    margin-right:
        4px;

    color:
        #555555;

    font-size:
        11px;

    font-weight:
        600;
}


.delta-rich-editor__image-presets button {
    min-width:
        50px;

    min-height:
        30px;

    padding:
        4px
        8px;
}


.delta-rich-editor__image-actions {
    display:
        flex;

    align-items:
        center;

    gap:
        8px;

    padding-top:
        4px;

    border-top:
        1px solid
        rgba(
            0,
            0,
            0,
            0.08
        );
}


.delta-rich-editor__image-actions-spacer {
    flex:
        1;
}


.delta-rich-editor__image-actions
.is-danger {
    color:
        #8f1d2c;
}


/* ============================================================
 * Image node inside question content
 * ============================================================ */

.delta-rich-editor__surface
.delta-rich-editor__image-node {
    display:
        block;

    box-sizing:
        border-box;

    max-width:
        100%;

    margin-top:
        14px;

    margin-bottom:
        14px;

    padding:
        0;

    border:
        1px solid
        transparent;

    border-radius:
        4px;
}


.delta-rich-editor__surface
.delta-rich-editor__image-node[data-alignment="left"] {
    margin-right:
        auto;

    margin-left:
        0;
}


.delta-rich-editor__surface
.delta-rich-editor__image-node[data-alignment="center"] {
    margin-right:
        auto;

    margin-left:
        auto;
}


.delta-rich-editor__surface
.delta-rich-editor__image-node[data-alignment="right"] {
    margin-right:
        0;

    margin-left:
        auto;
}


.delta-rich-editor__surface
.delta-rich-editor__image-node img {
    display:
        block;

    width:
        100%;

    height:
        auto;

    max-width:
        100%;

    margin:
        0;

    object-fit:
        contain;
}


.delta-rich-editor__surface
.delta-rich-editor__image-node.ProseMirror-selectednode {
    border-color:
        rgba(
            143,
            29,
            44,
            0.70
        );

    box-shadow:
        0
        0
        0
        2px
        rgba(
            143,
            29,
            44,
            0.10
        );
}


.delta-rich-editor__image-caption {
    margin-top:
        6px;

    color:
        #333333;

    font-size:
        9pt;

    line-height:
        1.25;

    text-align:
        left;
}


.delta-rich-editor__image-source {
    margin-top:
        3px;

    color:
        #666666;

    font-size:
        8pt;

    line-height:
        1.2;

    text-align:
        left;
}


.delta-rich-editor__image-caption[hidden],
.delta-rich-editor__image-source[hidden] {
    display:
        none;
}


@media (
    max-width:
        720px
) {
    .delta-rich-editor__image-layout {
        grid-template-columns:
            1fr;
    }


    .delta-rich-editor__image-actions {
        flex-wrap:
            wrap;
    }


    .delta-rich-editor__image-actions-spacer {
        display:
            none;
    }
}
