.sp-host #edit-view .hidden {
    display: none !important;
}

.sp-host #edit-view .loader-container {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 var(--space-6);
    text-align: center;
}

.sp-host #edit-view button {
    font-family: var(--font-sans);
}

.sp-host #edit-view .element-list-top-container {
    
    padding: var(--space-4);
}

.sp-host #edit-view .change-sections {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.sp-host .change-block .code-block-footer .change-selector {
    font-size: var(--text-small);
    font-weight: 500;
    color: var(--secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.sp-host .change-block .code-block-footer .change-selector:hover {
    text-decoration: underline;
}

.sp-host #edit-view .change-body .code-block-footer {
    justify-content: space-between;
}

.sp-host #edit-view .select-action:after,
.sp-host #edit-view .discard-action:after,
.sp-host #edit-view .revert-all-action:after {
    content: "";
    width: 20px;
    height: 20px;
    background: var(--secondary);
    mask-size: cover;
    mask-repeat: no-repeat;
    mask-position: center;
    position: absolute;
    top: 4px;
    left: 4px;
    pointer-events: none;
}

.sp-host #edit-view .select-action:after {
    mask-image: url(images/crosshair.svg);
}

.sp-host #edit-view .discard-action:after,
.sp-host #edit-view .revert-all-action:after {
    mask-image: url(images/trash.svg);
}

.sp-host #edit-view #edit_changes-name .element-name-label {
    cursor: default;
}

.sp-host #edit-view .change-block .property {
    color: var(--primary);
}

.sp-host #edit-view .change-block .line.removed,
.sp-host #edit-view .change-block .line.removed * {
    color: var(--secondary);
}

.sp-host #edit-view .change-block .line.removed {
    counter-increment: none;
}

.sp-host #edit-view .change-block .line.removed::before {
    content: none;
}

.sp-host #edit-view .change-block .styles-block {
    overflow: hidden;
}

.sp-host #edit-view .change-block .line.added,
.sp-host #edit-view .change-block .line.removed {
    z-index: 0;
}

.sp-host #edit-view .change-block .line.added,
.sp-host #edit-view .change-block .line.removed {
    padding-left: 20px;
}

.sp-host #edit-view .change-block .line.media-nested.added,
.sp-host #edit-view .change-block .line.media-nested.removed {
    padding-left: 40px;
}

.sp-host #edit-view .change-block .line.media-nested:not(.added):not(.removed) {
    padding-left: 20px;
}

.sp-host #edit-view .change-block .line.added::after,
.sp-host #edit-view .change-block .line.removed::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: calc(-1ch * var(--max-line-digits, 2) - 32px);
    right: -16px;
    z-index: -1;
    pointer-events: none;
}

.sp-host #edit-view .change-block .line.added::after {
    background: var(--diff-added-line-bg);
}

.sp-host #edit-view .change-block .line.removed::after {
    background: var(--diff-removed-line-bg);
}

.sp-host #edit-view .change-block .diff-gutter-marker {
    position: absolute;
    left: calc(-1ch * var(--max-line-digits, 2) - 24px);
    width: 1ch;
    text-align: center;
    color: var(--quaternary);
    font-family: var(--font-mono);
    pointer-events: none;
    user-select: none;
}

.sp-host #edit-view .change-block .line.added .diff-changed,
.sp-host #edit-view .change-block .line.added .diff-changed * {
    background: var(--diff-added-bg);
    color: var(--diff-added-fg);
}

.sp-host #edit-view .change-block .line.removed .diff-changed,
.sp-host #edit-view .change-block .line.removed .diff-changed * {
    background: var(--diff-removed-bg);
    color: var(--diff-removed-fg);
}

.sp-host #edit-view .keyword {
    color: var(--highlight-string);
}

.sp-host #edit-view .spinner {
    width: var(--space-6);
    height: var(--space-6);
    border-radius: 50%;
    border: 3.8px solid var(--primary);
    animation:
        spinner-bulqg1 0.8s infinite linear alternate,
        spinner-oaa3wk 1.6s infinite linear;
}

.sp-host #edit-view .hidden .spinner {
    animation: none;
}

@keyframes spinner-bulqg1 {
    0% {
        clip-path: polygon(50% 50%, 0 0, 50% 0%, 50% 0%, 50% 0%, 50% 0%, 50% 0%);
    }

    12.5% {
        clip-path: polygon(50% 50%, 0 0, 50% 0%, 100% 0%, 100% 0%, 100% 0%, 100% 0%);
    }

    25% {
        clip-path: polygon(50% 50%, 0 0, 50% 0%, 100% 0%, 100% 100%, 100% 100%, 100% 100%);
    }

    50% {
        clip-path: polygon(50% 50%, 0 0, 50% 0%, 100% 0%, 100% 100%, 50% 100%, 0% 100%);
    }

    62.5% {
        clip-path: polygon(50% 50%, 100% 0, 100% 0%, 100% 0%, 100% 100%, 50% 100%, 0% 100%);
    }

    75% {
        clip-path: polygon(50% 50%, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 50% 100%, 0% 100%);
    }

    100% {
        clip-path: polygon(50% 50%, 50% 100%, 50% 100%, 50% 100%, 50% 100%, 50% 100%, 0% 100%);
    }
}

@keyframes spinner-oaa3wk {
    0% {
        transform: scaleY(1) rotate(0deg);
    }

    49.99% {
        transform: scaleY(1) rotate(135deg);
    }

    50% {
        transform: scaleY(-1) rotate(0deg);
    }

    100% {
        transform: scaleY(-1) rotate(-135deg);
    }
}

.sp-host #edit-view #edit_css-body {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 126px);
}

.sp-host #edit-view #edit_css-sections {
    display: flex;
    flex-direction: column;
}

.sp-host #edit-view .edit-css-editor {
    flex: 0 0 auto;
    font-family: var(--font-mono);
    font-size: var(--text-small);
    line-height: 1.6;
    color: var(--primary);
    caret-color: var(--primary);
    
    padding: var(--space-3) 0;
    outline: none;
    counter-reset: line;
}

.sp-host #edit-view .edit-css-section {
    flex: 0 0 auto;
}

.sp-host #edit-view .edit-css-section-header {
    display: flex;
    align-items: center;
    height: 32px;
    padding: 0 var(--space-4);
    font-family: var(--font-sans);
    font-size: var(--text-small);
    font-weight: 500;
    color: var(--secondary);
    background: var(--material);
    border-top: 1px solid var(--stroke);
    border-bottom: 1px solid var(--stroke);
    user-select: none;
}

.sp-host #edit-view #edit_css-xo-note {
    flex: 0 0 auto;
    padding: var(--space-3) var(--space-4);
    border-top: 1px solid var(--stroke);
    color: var(--secondary);
    font-size: var(--text-small);
    line-height: 1.4;
    user-select: none;
}

.sp-host #edit-view .edit-css-editor .line {
    counter-increment: line;
    position: relative;
    
    padding-left: calc(1ch * var(--max-line-digits, 2) + var(--space-3) * 2 + var(--space-2));
    padding-right: var(--space-4);
    white-space: pre-wrap;
    word-break: break-word;
}

.sp-host #edit-view .edit-css-editor .line::before {
    content: counter(line);
    position: absolute;
    left: var(--space-2);
    top: 0;
    box-sizing: border-box;
    width: calc(1ch * var(--max-line-digits, 2) + var(--space-3) * 2);
    padding: 0 var(--space-3);
    text-align: right;
    color: var(--quaternary);
    user-select: none;
    pointer-events: none;
}

.sp-host #edit-view .edit-css-editor .property {
    color: var(--primary);
}

.sp-host #edit-view .edit-css-editor .line.invalid {
    text-decoration: line-through;
}

.sp-host #edit-view .edit-css-editor .line.invalid,
.sp-host #edit-view .edit-css-editor .line.invalid * {
    color: var(--quaternary);
}

.sp-host #edit-view .edit-css-editor .line.invalid::before {
    text-decoration: none;
}

.sp-host #edit-view .edit-css-editor .line.is-current-line::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    z-index: -1;
    pointer-events: none;
}

.sp-host .css-autocomplete {
    position: fixed;
    z-index: 9999;
    min-width: 160px;
    max-width: 280px;
    max-height: 200px;
    overflow-y: auto;
    scroll-padding: 4px;
    padding: 4px;
    background: var(--elevated);
    
    border-radius: calc(var(--radius-tiny) + 4px);
    box-shadow: var(--elevation-medium);
    font-family: var(--font-mono);
    font-size: var(--text-small);
    display: none;
}

.sp-host .css-autocomplete.is-open {
    display: block;
}

.sp-host .css-autocomplete-item {
    height: 24px;
    line-height: 24px;
    padding: 0 8px;
    border-radius: var(--radius-tiny);
    color: var(--secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sp-host .css-autocomplete-item.is-active {
    background: var(--surface);
    color: var(--primary);
}

.sp-host .css-autocomplete-match {
    font-weight: 500;
    color: var(--primary);
}
