#pages {
    display: grid;
    height: 100%;
    grid-template-rows: auto 1fr auto;
    grid-template-areas:
        "main-header"
        "main-main"
        "main-footer";
}

#pages .main-header {
    grid-area: main-header;
    display: grid;
    grid-template-columns: 0.9fr auto 1fr auto;
    gap: 1rem;
}
@media (max-width: 1023px) {
    #pages .main-header {
        padding: 1rem 0.7rem 1rem 0.4rem;
    }
}
@media (min-width: 1024px) {
    #pages .main-header {
        padding: 1rem 2.4rem 1rem 1rem;
    }
}

#pages .search-wrapper {
    position: relative;
    min-width: 180px;
}
#pages .page-search {
    border-radius: 0.3rem;
    font-size: 0.875rem;
    padding: 0 4.7rem 0 0.54rem;
    height: 100%;
    width: 100%;
    background-color: var(--page-search);
    border: 1px solid var(--page-search-border);
    color: var(--page-search-font);
}
#pages .reset {
    position: absolute;
    top: 3px;
    bottom: 3px;
    right: 45px;
    cursor: pointer;
    border: none;
    border-radius: 50%;
    outline: none;
    width: 30px;
    background-color: var(--bg-3);
    background-repeat: no-repeat;
    background-position: center center;
    background-size: 40%;
    background-image: var(--icon-close);
}
@media (max-width: 1023px) {
    #pages .reset:active {
        background-color: var(--bg-4);
    }
}
@media (min-width: 1024px) {
    #pages .reset:hover {
        background-color: var(--bg-4);
    }
}

#pages .page-search-button {
    position: absolute; 
    top: 1px;
    bottom: 1px;
    right: 1px;
    border-radius: 3px;
    cursor: pointer; 
    border: none;
    outline: none;
    width: 42px;
    background-color: var(--bg-3);
    background-repeat: no-repeat;
    background-position: center center;
    background-size: 48%;
    background-image: var(--search-icon);
}


.add-page-btn {
    display: flex;
    width: 35px;
    border-radius: 0.3rem;
    cursor: pointer;
    background-color: var(--add-page-btn);
    position: relative;
}
.add-page-btn:hover {
    background-color: var(--add-page-btn-hover);
}
.add-page-btn .x1 {
    width: 2px;
    height: 16px;
    border-radius: 2px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: rotate(0deg) translate(-50%, -50%);
}
.add-page-btn .x2 {
    width: 16px;
    height: 2px;
    border-radius: 2px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: rotate(0deg) translate(-50%, -50%);
}
.add-page-btn .x1, .add-page-btn .x2 {
    background-color: var(--add-page-btn-svg-b-plus);
}

.del-pages-btn {
    display: flex;
    cursor: pointer;
    border-radius: 0.3rem;
    user-select: none;
}
@media (max-width: 1023px) {
    .del-pages-btn:active {
        background-color: var(--del-pages-btn-hover-active);
    }
}
@media (min-width: 1024px) {
    .del-pages-btn:hover {
        background-color: var(--del-pages-btn-hover-active);
    }
}

.del-pages-btn svg {
    width: 35px;
}
.del-pages-btn svg .a-trash, .del-pages-btn svg .b-trash {
    stroke: var(--del-pages-btn-svg);
}


#pages .main-main {
    grid-area: main-main;
    overflow-y: scroll;
}
@media (max-width: 1023px) {
    #pages .main-main {
        padding: 0 0.4rem 0.3rem 0.4rem;
    }
}
@media (min-width: 1024px) {
    #pages .main-main {
        padding: 0rem 1rem 0.3rem 1rem;
    }
}





.pages-grid {
    display: grid;
    row-gap: 0.3rem;
    color: var(--windows-font);
}

.pages-grid > div {
    overflow: hidden;
    border-radius: 0.3rem;
    display: grid;
    padding: 0.7rem;
    column-gap: 0.7rem;
    box-shadow: 0 2px 2px 0 #00000033;
    position: relative;
    row-gap: 0.5rem;
    background-color: var(--pages-grid-div);
    background-image: url(../img/noise.png);
}
.pages-grid > div.open {
    background-color: var(--pages-grid-div-open);
    box-shadow: 0 0 0 2px var(--pages-grid-div-open-shadow) inset;
}
@media (max-width: 1023px) {
    .pages-grid > div {
        grid-template-areas:
        "page-name page-pin  page-del"
        "page-butt page-butt page-del";
        grid-template-columns: 1fr auto 1.4rem;
    }
}
@media (min-width: 1024px) {
    .pages-grid > div {
        grid-template-areas:
        "page-name page-pin  page-date page-del"
        "page-butt page-butt page-date page-del";
        grid-template-columns: 1fr auto 6rem 1.4rem;
    }
    .pages-grid > div:hover {
        background-color: var(--pages-grid-div-hover)
    }
}

@media (max-width: 1023px) {
    .pages-grid > div.open {
        grid-template-areas:
        "page-name page-pin  page-del "
        "page-butt page-butt page-del "
        "page-prop page-prop page-prop";
    }
}
@media (min-width: 1024px) {
    .pages-grid > div.open {
        grid-template-areas:
        "page-name page-pin  page-date page-del "
        "page-butt page-butt page-date page-del "
        "page-prop page-prop page-prop page-prop";
    }
}


.pages-grid > div.last-edited::before {
    content: "";
    position: absolute;
    left: 3px;
    top: 3px;
    z-index: 1;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: var(--pages-grid-div-last-edited-before);
}

#pages .pin {
    grid-area: page-pin;
    width: 15px;
    height: 16px;
    margin-top: -13px;
    cursor: pointer;
    background-repeat: no-repeat;
    background-position: center center;
    background-size: 84%;
    background-image: var(--pages-pin-off);
}
#pages [data-pin="1"] .pin {
    background-image: var(--pages-pin-on);
}
@media (min-width: 1024px) {
    #pages .pages-grid > div .pin {
        display: none;
    }
    #pages .pages-grid > div[data-pin="1"] .pin {
        display: block;
    }
    #pages .pages-grid > div:hover .pin {
        display: block;
    }
}


.page-buttons div {
    cursor: pointer;
    user-select: none;
    color: var(--page-buttons-div);
}
.page-buttons div:hover {
    color: var(--page-buttons-div-hover);
}
.pages-grid > div.open .page-prop-btn {
    color: var(--page-buttons-div-open);
}

.page-prop-save-btn {
    display: none;
}
.pages-grid > div.open .page-prop-save-btn {
    display: block;
}
.pages-grid > div.open .page-prop-save-btn.saved {
    color: var(--pages-grid-div-last-edited-before);
}

.pages-grid a.page-name {
    grid-area: page-name;
    width: fit-content;
    display: flex;
    margin-top: -5px;
    font-size: 1rem;
    min-height: 21px; /* for empty title */
    text-decoration: none;
    color: var(--a-page-name);
}
.pages-grid a.page-name:hover {
    color: var(--a-page-name-hover);
}


.page-buttons {
    grid-area: page-butt;
    display: flex;
    column-gap: 0.7rem;
    font-size: 0.9rem;
}
@media (min-width: 1024px) {
    .page-buttons {
        opacity: 0;
    }
    .pages-grid > div:hover .page-buttons {
        opacity: 1;
    }
    .pages-grid > div.open .page-buttons {
        opacity: 1;
    }
}
@media (max-width: 1023px) {
    .page-date {
        display: none;
    }
}
@media (min-width: 1024px) {
    .page-date {
        grid-area: page-date;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 0.8rem;
        color: var(--page-date);
    }
    .page-date.planned {
        color: var(--page-date-planned);
    }
}

.page-prop {
    display: none;
    grid-area: page-prop;
}
@media (max-width: 1023px) {
    .pages-grid > div.open .page-prop {
        display: grid;
    }
}
@media (min-width: 1024px) {
    .page-prop {
        grid-template-areas:
        "cTitle vTitle cTemplate vTemplate"
        "cURL   vURL   cDate     vDate"
        "cSEO   vSEO   cTime     vTime"
        "cDesc  vDesc  cEmpty    vEmpty";
        grid-template-columns: 6em minmax(240px, 100%) 6em minmax(240px, 100%);
        row-gap: 0.75rem;
        column-gap: 0.7rem;
    }
    .pages-grid > div.open .page-prop {
        display: grid;
        padding: 0.5rem 0 0.3rem 0;
    }
}

.page-prop > div {
    font-size: 1rem;
    line-height: 27px;
    color: var(--page-prop-div);
}
/* Options */
.page-prop select {
    appearance: none;
    background-repeat: no-repeat;
    background-position: right .37rem center;
    background-size: 16px 12px;
}

.page-prop select {
    background-image: var(--select-icon);
}
@media (max-width: 1023px) {
    .page-prop > div:not(:first-child) {
        padding-top: 0.75rem;
    }
}
@media (min-width: 1024px) {
    .page-prop > div {
        text-align: right;
    }
    .page-prop .page-title { grid-area: cTitle; }
    .page-prop input[name=title] { grid-area: vTitle; }
    .page-prop .seo-title { grid-area: cSEO; }
    .page-prop input[name=seo_title] { grid-area: vSEO; }
    .page-prop .url { grid-area: cURL; }
    .page-prop input[name=url] { grid-area: vURL; }
    .page-prop .template { grid-area: cTemplate; }
    .page-prop select[name=template] { grid-area: vTemplate; }
    .page-prop .description { grid-area: cDesc; }
    .page-prop textarea { grid-area: vDesc; }
    .page-prop .date { grid-area: cDate; }
    .page-prop input[name=date] { grid-area: vDate; max-width: fit-content; }
    .page-prop .time { grid-area: cTime; }
    .page-prop input[name=time] { grid-area: vTime; max-width: fit-content; }
}


.pages-grid > div > input[type="checkbox"] {
    grid-area: page-del;
    display: flex;
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 0.25rem;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    appearance: none;
    border: 2px solid;
    background-color: var(--pages-grid-div-input);
    border-color: var(--pages-grid-div-input-border);
}
.pages-grid > div > input:checked {
    background-color: var(--pages-grid-div-input-checked);
    border-color: var(--pages-grid-div-input-checked-border);
    background-image: var(--check-icon);
}
.pages-grid > div > input:focus {
    box-shadow: 0 0 0 0.25rem var(--pages-grid-div-input-checked-focus);
}
@media (min-width: 1024px) {
    .pages-grid > div > input[type="checkbox"] {
        align-self: center;
    }
}

.page-prop input,
.page-prop textarea,
.page-prop select {
    border-radius: 4px;
    font-size: 0.94rem;
    padding: 0 0.54rem;
    min-height: 30px;
    height: 100%;
    background-color: var(--page-prop-input-textarea-select);
    border: 1px solid var(--page-prop-input-textarea-select-border);
    color: var(--page-prop-input-textarea-select-font);
}

.page-prop textarea {
    font-family: var(--sans-serif);
    font-size: 0.94rem;
    line-height: 1.3em;
    resize: vertical;
}

.page-prop select, .page-prop input[type=date], .page-prop input[type=time] {
    -moz-padding-start: 4px;
    -moz-padding-end: 4px;
}

#pages .main-footer {
    grid-area: main-footer;
    padding: 1rem;
    display: grid;
    column-gap: 1rem;
    grid-auto-flow: column;
    justify-content: space-between;
}

#pages .main-footer .pager::-webkit-scrollbar {
    height: 0;
}

#pages .main-footer .pager {
    scrollbar-width: none;
}

#pages .counters {
    display: grid;
    column-gap: 0.5rem;
    grid-auto-flow: column;
}
#pages .counters input {
    border-radius: 4px;
    font-size: 0.875rem;
    padding: 0 0.3rem;
    min-height: 30px;
    height: 100%;
    width: 3.2rem;
    text-align: center;
    background-color: var(--pages-counters-input);
    border: 1px solid var(--pages-counters-input-border);
    color: var(--pages-counters-input-font);
}
#pages .counters span {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    color: var(--pages-counters-span);
}


#pages .main-footer .pager {
    display: grid;
    grid-auto-flow: column;
    column-gap: 0.5rem;
    overflow-x: auto;
    padding: 4px;
}

#pages .main-footer .pager > div {
    color: var(--pages-main-footer-pager-div-font);
    background-color: var(--pages-main-footer-pager-div-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 32px;
    border-radius: 0.7rem;
    font-size: 0.875rem;
    cursor: pointer;
    user-select: none;
}

#pages .main-footer .pager > div.active {
    color: var(--main-footer-pager-div-active-font);
    box-shadow: 0 0 0 0.25rem var(--pages-main-footer-pager-div-bg-active);
}

#pages .main-footer .pager > div:hover {
    color: var(--main-footer-pager-div-hover);
}

#pages .page-editor-bg {
    display: grid;
    position: relative;
    grid-row: 1/-1;
    grid-column: 1/-1;
    z-index: 9;
    background-color: var(--bg-4);
}
@media (min-width: 1024px) {
    #pages .page-editor-bg {
        padding: 1rem;
    } 
}
#pages .page-editor-bg.hidden {
    display: none;
}


#pages .page-editor-grid {
    background-color: var(--page-editor-grid);
    min-height: max-content; /*Hack*/
    display: grid;
    grid-template-rows: auto auto 1fr 1rem;
    grid-template-areas: 
        "page-editor-header page-editor-header"
        "page-editor-buttons page-editor-buttons"
        "page-editor tags"
        "bottom bottom";
}
#pages .page-editor-grid.mediateka {
    grid-template-rows: auto auto auto 1fr 1rem;
    grid-template-areas: 
        "page-editor-header page-editor-header"
        "page-editor-buttons page-editor-buttons"
        "page-editor-panel page-editor-panel"
        "page-editor tags"
        "bottom bottom";
}
@media (max-width: 1023px) {
    #pages .page-editor-grid {
        grid-template-columns: 1fr 0;
    }
    #pages .page-editor-grid.tags-opened {
        grid-template-columns: 1fr max-content;
    }
    #pages .tags {
        z-index: 3;
    }
}
@media (min-width: 1024px) {
    #pages .page-editor-grid {
        grid-template-columns: 1fr 0;
    }
    #pages .page-editor-grid.tags-opened {
        grid-template-columns: 1fr max-content;
    }
}
@media (min-width: 1024px) {
    #pages .page-editor-grid {
        border-radius: 5px;
    }
}

.page-editor-header {
    grid-area: page-editor-header;
    display: grid;
}
@media (max-width: 1023px) {
    .page-editor-header {
        grid-template-areas:
        "title close";
        grid-template-columns: 1fr auto;
        column-gap: 1rem;
        row-gap: 0.5rem;
        padding: 10px 10px 0 10px;
    }
}
@media (min-width: 1024px) {
    .page-editor-header {
        padding: 10px 10px 0 10px;
        grid-template-columns: max-content 1fr;
        column-gap: 1rem;
    }
}

.close-page-button {
    position: relative;
    cursor: pointer;
    width: 2rem;
    height: 2rem;
    border-radius: 3px;
    background-color: var(--bg-3);
    background-repeat: no-repeat;
    background-position: center center;
    background-size: 40%;
    background-image: var(--icon-close);
}
.close-page-button:hover {
    background-color: var(--bg-4);
}
@media (max-width: 1023px) {
    .close-page-button {
        grid-area: close;
    }
}

.save-page-button {
    cursor: pointer;
    color: var(--codemirror-replace);
}
.save-page-button:hover {
    color: var(--codemirror-replace-hover);
}
.save-page-button.saved {
    color: var(--saved);
}
.save-page-button.error {
    color: var(--error);
}

.page-editor-header a {
    color: var(--page-editor-header-a);
    text-decoration: none;
    width: fit-content;
    align-self: center;
}
.page-editor-header a:hover {
    color: var(--page-editor-header-a-hover);
    text-decoration: none;
}

@media (max-width: 1023px) {
    .page-editor-title {
        grid-area: title;
    }
}

.page-editor-buttons {
    display: grid;
    grid-area: page-editor-buttons;
    grid-auto-flow: column;
    gap: 0.7em;
    justify-content: start;
    overflow-x: auto;
    overflow-y: hidden;
    font-size: 1rem;
}
@media (max-width: 1023px) {
    .page-editor-buttons {
        padding: 10px 10px;
    }
}
@media (min-width: 1024px) {
    .page-editor-buttons {
        padding: 10px 14px;
    }
}
.page-editor-buttons.hidden {
	display: none;
}


.open-mediateka {
    cursor: pointer;
    user-select: none;
    color: var(--open-mediateka);
}
.open-mediateka:hover {
    color: var(--open-mediateka-hover);
}

.tags-helper {
    cursor: pointer;
    user-select: none;
    color: var(--page-editor-buttons-a);
}
.tags-helper:hover {
    color: var(--page-editor-buttons-a-hover);
}

.codemirror-replace {
    cursor: pointer;
    user-select: none;
    color: var(--codemirror-replace);
}
.codemirror-replace:hover {
    color: var(--codemirror-replace-hover);
}


.page-editor-buttons a {
    color: var(--page-editor-buttons-a);
    text-decoration: none;
}
.page-editor-buttons a:hover {
    color: var(--page-editor-buttons-a-hover);
}


.page-editor-panel {
    display: grid;
    grid-area: page-editor-panel;
    padding:10px;
    position: relative;
    max-width: 100%;
}
.page-editor-panel.hidden {
    display: none;
}

.upload-progress {
    position: absolute;
    width: 0%;
    height: 3px;
    background-image: repeating-linear-gradient(90deg, #a800ff 0, tomato 50%, #a800ff 100%);
    animation: barberpole 3s linear infinite;
    background-size: 25% 25%;
}
@keyframes barberpole {
    100% {
        background-position: 100% 100%;
    }
}

.mediateka-grid {
    display: grid;
    grid-template-rows: auto auto;
    grid-template-columns: 1fr;
    row-gap: 10px;
    grid-template-areas:
      "mediateka-files-hscroll"
      "mediateka-buttons";
}
.mediateka-grid.hidden {
	display: none;
}

.mediateka-files-hscroll {
    grid-area: mediateka-files-hscroll;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
}

.mediateka-files-grid {
    display: grid;
    column-gap: 5px;
    grid-auto-columns: 130px;
    grid-auto-flow: column;
}

.file-block {
    height: 130px;
    background-color: var(--file-block);
    box-shadow: 0 2px 3px 0 #0000004d;
    border: 2px solid var(--file-block-border);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}
	
.file-block:hover {
	  border: 2px solid var(--file-block-border-hover);
}
.file-block.active-file {
    border: 2px solid var(--file-block-border-active-file);
}

.file-block img {
    object-fit: contain;
    width: 100%;
    height: 100%;
    display: block;
}

.file-block .media-name {
	font-size: 60%;
	position: absolute;
	padding: 0 2%;
	overflow: hidden;
    color: var(--file-block-media-name);
    word-break: break-all;
}

.file-block input[type="checkbox"] {
    position: absolute;
    right: 3px;
    top: 5px;
    z-index: 1;
    cursor: pointer;
    width: 1rem;
    height: 1rem;
    border-radius: 0.25rem;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    appearance: none;
    border: 2px solid;
    display: none;
    background-color: var(--file-block-input);
    border-color: var(--file-block-input-border);
}

.file-block:hover input[type="checkbox"] {
    display: block;
}

.file-block input[type="checkbox"]:checked {
    display: block;
}

.file-block input:checked {
    background-color: var(--file-block-input-checked);
    border-color: var(--file-block-input-checked-border);
    background-image: var(--check-icon);
}

.file-block .ext {
    position: absolute;
    z-index: 12;
    bottom: 3px;
    left: 3px;
    font-size: 12px; 
    padding: 1px 5px 1px 3px;
    border-radius: 3px;
    cursor: default;
    background-color: var(--file-block-ext);
    color: var(--file-block-ext-font); 
}

.mediateka-buttons {
    display: grid;
    grid-area: mediateka-buttons;
}
@media (max-width: 1023px) {
    .mediateka-buttons {
        grid-template-rows: auto;
        grid-template-columns: 1fr 1fr;
        gap: 0.9rem;
        grid-template-areas:
            "upload-files del-uploaded-files"
            "link-file link-file";
    }
}
@media (min-width: 1024px) {
    .mediateka-buttons {
        grid-template-columns: auto 1fr auto;
        column-gap:15px;
        grid-template-areas: "upload-files link-file del-uploaded-files";
    }
}
.upload-files {
    grid-area: upload-files;
    min-height: 2.5rem;
}
.mediateka-buttons .inputfile {
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    position: absolute;
    z-index: -1;
}
.mediateka-buttons .inputfile + label {
    height: 100%;
    padding: 0 0.7rem;
    display: flex;
    cursor: pointer;
    justify-content: center;
    align-items: center;
    border-radius: 4px;
    font-size: 1rem;
    line-height: 1;
    background-color: var(--mediateka-buttons-inputfile-label);
    color: var(--mediateka-buttons-inputfile-label-font);
}
.mediateka-buttons .inputfile:focus + label, .inputfile + label:hover {
    background-color: var(--mediateka-buttons-inputfile-label-focus-hover);
}

.link-file {
    grid-area: link-file;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas: "link-file-tag link-file-copy-btn";
    column-gap: 1rem;
    line-height: 2;
    min-height: 2.5rem;
    align-items: center;
    padding-left: 10px;
    padding-right: 4px;
    border-radius: 5px;
    font-size: 1rem;
    word-break: break-all;
    background-color: var(--link-file);
    color: var(--link-file-font);
}
.link-file a {
    color: var(--link-file-a);
}
.link-file-tag {
    grid-area: link-file-tag;
    line-height: 1.4;
}
.link-file-copy-btn {
    grid-area: link-file-copy-btn;
    cursor: pointer;
    z-index: 1;
    font-size: 0.8rem;
    padding: 0 0.4rem;
    border-radius: 0.2rem;
    display: flex;
    min-height: 2rem;
    height: calc(100% - 8px);
    user-select: none;
    justify-content: center;
    align-items: center;
    background-color: var(--link-file-copy-btn);
    color: var(--link-file-copy-btn-font);
}
.link-file-copy-btn:hover {
    background-color: var(--link-file-copy-btn-hover);
}

.del-uploaded-files {
    grid-area: del-uploaded-files;
    display: flex;
    justify-content: center;
    align-items: center;
    padding-left: 10px;
    padding-right: 10px;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    line-height: 1;
    background-color: var(--del-uploaded-files);
    color: var(--del-uploaded-files-font);
}
.del-uploaded-files:hover {
    background-color: var(--del-uploaded-files-hover);
}

.del-uploaded-files.disabled {
    background-color: var(--del-uploaded-files-disabled);
    color: var(--del-uploaded-files-disabled-font);
    cursor: context-menu;
}

#pages .tags {
    grid-area: tags;
    overflow-y: auto;
    scrollbar-width: none;
    background-color: var(--tags-bg);
    position: relative;
}

.tags-grid {
    display: grid;
    position: relative;
    padding: 0.3rem 0;
}

.tags-grid > div {
    padding: 7px 30px 7px 30px;
    color: var(--tags-font);
    font-size: 1rem;
    cursor: pointer;
}
.tags-grid > div:hover {
    background-color: var(--codemirror-bg);
}


.page-editor {
    grid-area: page-editor;
}
@media (max-width: 1023px) {
    .page-editor {
        grid-column: 1/-1;
    }
}
body .CodeMirror {
    min-height: 100%;
    max-height: 100%;
    height: 1rem;
    font-family: var(--monospace);
    font-weight: normal;
    font-size: 1.04rem;
}
body .CodeMirror-dialog input {
    font-family: var(--monospace);
    font-size: 100%;
}

body .CodeMirror-wrap pre.CodeMirror-line, body .CodeMirror-wrap pre.CodeMirror-line-like {
    word-wrap: break-word;
    white-space: pre-wrap;
    word-break: break-all;
}

/* Codemirror light theme Start */
.cm-s-default.CodeMirror {
    background-color: var(--codemirror-bg);
    color: var(--codemirror-text);
}
.cm-s-default .CodeMirror-gutters {
    background-color: var(--codemirror-bg);
    color: var(--codemirror-numbeslines);
    border: none;
}
/* Codemirror dark theme Start */
.cm-s-dark.CodeMirror {
    background-color: var(--codemirror-bg);
    color: var(--codemirror-text);
}
.cm-s-dark .CodeMirror-gutters {
    background-color: var(--codemirror-bg);
    color: var(--codemirror-numbeslines);
    border: none;
}
.cm-s-dark .CodeMirror-guttermarker,
.cm-s-dark .CodeMirror-guttermarker-subtle,
.cm-s-dark .CodeMirror-linenumber {
    color: var(--codemirror-numbeslines);
}
.cm-s-dark .CodeMirror-cursor {
    border-left: 1px solid #FFCC00;
}
.cm-s-dark div.CodeMirror-selected {
    background-color: #0663d2;
}
.cm-s-dark .cm-searching {
    background-color: rgb(112 112 100 / 30%);
}
.cm-s-dark.CodeMirror-focused div.CodeMirror-selected {
    background-color: #0663d2;
}
.cm-s-dark .CodeMirror-line::selection,
.cm-s-dark .CodeMirror-line>span::selection,
.cm-s-dark .CodeMirror-line>span>span::selection {
    background-color: rgba(128, 203, 196, 0.2);
}
.cm-s-dark .CodeMirror-line::-moz-selection,
.cm-s-dark .CodeMirror-line>span::-moz-selection,
.cm-s-dark .CodeMirror-line>span>span::-moz-selection {
    background-color: rgba(128, 203, 196, 0.2);
}
.cm-s-dark .CodeMirror-activeline-background {
    background-color: #2c2929b5;
}
.cm-s-dark .cm-keyword {
    color: #C792EA;
}
.cm-s-dark .cm-operator {
    color: #89DDFF;
}
.cm-s-dark .cm-variable-2 {
    color: #EEFFFF;
}
.cm-s-dark .cm-variable-3,
.cm-s-dark .cm-type {
    color: #f07178;
}
.cm-s-dark .cm-builtin {
    color: #FFCB6B;
}
.cm-s-dark .cm-atom {
    color: #F78C6C;
}
.cm-s-dark .cm-number {
    color: #FF5370;
}
.cm-s-dark .cm-def {
    color: #82AAFF;
}
.cm-s-dark .cm-string {
    color: #94af6e;
}
.cm-s-dark .cm-string-2 {
    color: #f07178;
}
.cm-s-dark .cm-comment {
    color: #546E7A;
}
.cm-s-dark .cm-variable {
    color: #f07178;
}
.cm-s-dark .cm-tag {
    color: #FF5370;
}
.cm-s-dark .cm-meta {
    color: #FFCB6B;
}
.cm-s-dark .cm-attribute {
    color: #C792EA;
}
.cm-s-dark .cm-property {
    color: #C792EA;
}
.cm-s-dark .cm-qualifier {
    color: #DECB6B;
}
.cm-s-dark .cm-variable-3,
.cm-s-dark .cm-type {
    color: #DECB6B;
}
.cm-s-dark .cm-error {
    color: rgba(255, 255, 255, 1.0);
    background-color: #FF5370;
}
.cm-s-dark .CodeMirror-matchingbracket {
    text-decoration: underline;
    color: white !important;
}
/* Codemirror dark theme End. */


#lbox-window {
    position: fixed;
    z-index: 999;
    cursor: pointer;
    background-color: var(--lbox-window);
    display: grid;
    height: 100vh;
    width: 100vw;
    grid-template-areas: "lightbox";
}
#lbox-window img, #lbox-window video, #lbox-window audio {
    max-width: 100%;
    max-height: 100%;
    box-shadow: 0 3px 7px 0 #0000004d;
    grid-area: lightbox;
    align-self: center;
    justify-self: center;
    overflow: hidden;
}

#lbox-window audio {
    width: 97%;
    height: 54px;
}