.text-style-open {
    width: 100%
}

.text-editor-dialog {
    width: min(960px, 94vw);
    max-height: 92vh;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #10141d;
    color: var(--text)
}

.text-editor-dialog::backdrop {
    background: #05070cbf
}

.text-editor-layout {
    display: grid;
    grid-template-columns: minmax(280px, 370px) 1fr;
    gap: 22px;
    align-items: start
}

.text-editor-layout canvas {
    display: block;
    width: 100%;
    height: auto;
    touch-action: none;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: repeating-conic-gradient(#202633 0 25%, #171c27 0 50%) 50%/24px 24px
}

.text-style-form {
    display: grid;
    gap: 16px
}

.text-control-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px
}

.text-control-grid label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800
}

.text-control-grid input,
.text-control-grid select {
    width: 100%
}

.text-control-grid input[type=color] {
    height: 42px;
    padding: 3px
}

.text-control-grid output {
    color: var(--text);
    font-size: 11px
}

.text-control-grid .check-control {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 22px
}

.text-control-grid .check-control input {
    width: 18px;
    height: 18px
}

.text-editor-dialog [hidden] {
    display: none !important
}

@media(max-width:760px) {
    .text-editor-dialog {
        padding: 16px
    }

    .text-editor-layout {
        grid-template-columns: 1fr
    }

    .text-control-grid {
        grid-template-columns: 1fr 1fr
    }

    .text-editor-layout canvas {
        max-height: 42vh;
        object-fit: contain
    }
}

.text-editor-dialog {
    overflow: auto
}

.text-editor-preview {
    position: sticky;
    top: 0;
    z-index: 2;
    align-self: start
}

.text-style-form {
    min-width: 0
}

.text-control-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px
}

.text-control-group {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #0d1119
}

.text-control-group>summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 15px;
    cursor: pointer;
    list-style: none;
    color: var(--text);
    font-size: 13px;
    font-weight: 900
}

.text-control-group>summary::-webkit-details-marker {
    display: none
}

.text-control-toggle {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--accent);
    font-size: 20px;
    line-height: 1
}

.text-control-toggle::before {
    content: '+'
}

.text-control-group[open] .text-control-toggle::before {
    content: '−'
}

.text-control-group-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px;
    padding: 0 15px 15px;
    border-top: 1px solid var(--line)
}

.text-control-group-grid>label {
    margin-top: 12px
}

.text-save-status {
    margin: 0;
    padding: 10px 12px;
    border: 1px solid #28634f;
    border-radius: 10px;
    background: #17372e;
    color: #bffbe2
}

@media(max-width:760px) {
    .text-editor-preview {
        top: 0;
        padding: 4px 0 8px;
        background: #10141d
    }

    .text-editor-layout canvas {
        max-height: 32vh
    }

    .text-editor-preview .help {
        margin: 6px 0
    }

    .text-control-group-grid {
        grid-template-columns: 1fr 1fr
    }
}

.text-style-form .dialog-actions {
    position: sticky;
    bottom: -22px;
    z-index: 3;
    flex-wrap: wrap;
    padding: 12px 0 0;
    background: #10141d
}

.character-layer-group {
    border-color: #315e55
}

.character-layer-group>summary {
    background: #10231f
}

.character-layer-reset {
    align-self: end;
    margin-top: 12px;
    min-height: 42px
}

.character-layer-group .check-control {
    padding-top: 18px
}