.safdem-frontend-editor-shell,
.safdem-frontend-editor-shell * {
    box-sizing: border-box;
}

.safdem-frontend-editor-shell {
    background: #f8fafc;
    height: var(--safdem-editor-height, 100vh);
    margin: 1.25rem 0;
    max-width: 100%;
    min-height: 560px;
    position: relative;
    width: 100%;
}

.safdem-frontend-editor-shell--fullpage {
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    max-width: 100vw;
    width: 100vw;
}

body.admin-bar .safdem-frontend-editor-shell--viewport {
    height: calc(100vh - 32px);
}

.safdem-editor--frontend {
    border: 1px solid #c3c4c7;
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    height: 100%;
    line-height: 1.45;
    margin: 0;
    min-height: 0;
    overflow: hidden;
    width: 100%;
}

.safdem-editor--frontend .safdem-editor__toolbar {
    flex: 0 0 auto;
    min-height: 54px;
}

.safdem-editor--frontend .safdem-editor__title {
    color: #1d2327;
    flex: 0 1 auto;
    font-size: 16px;
    line-height: 1.25;
    margin-right: 5px;
    max-width: min(30vw, 360px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.safdem-editor--frontend .safdem-editor__body {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
}

.safdem-editor--frontend .safdem-map-column {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.safdem-editor--frontend .safdem-map {
    flex: 1 1 auto;
    height: auto;
    min-height: 320px;
}

.safdem-editor--frontend .safdem-coordinate-bar {
    flex: 0 0 auto;
}

.safdem-editor--frontend .safdem-sidebar {
    max-height: none;
    min-height: 0;
    overflow: auto;
}

.safdem-editor--frontend .button,
.safdem-login-required__button {
    -webkit-appearance: none;
    align-items: center;
    background: #f6f7f7;
    border: 1px solid #2271b1;
    border-radius: 3px;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
    color: #2271b1;
    cursor: pointer;
    display: inline-flex;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    justify-content: center;
    line-height: 2.15384615;
    min-height: 30px;
    padding: 0 10px;
    text-decoration: none;
    vertical-align: top;
    white-space: nowrap;
}

.safdem-editor--frontend .button:hover,
.safdem-editor--frontend .button:focus,
.safdem-login-required__button:hover,
.safdem-login-required__button:focus {
    background: #f0f0f1;
    border-color: #135e96;
    color: #0a4b78;
}

.safdem-editor--frontend .button-primary {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
}

.safdem-editor--frontend .button-primary:hover,
.safdem-editor--frontend .button-primary:focus {
    background: #135e96;
    border-color: #135e96;
    color: #fff;
}

.safdem-editor--frontend .button:disabled,
.safdem-editor--frontend .button[disabled] {
    background: #f0f0f1;
    border-color: #dcdcde;
    box-shadow: none;
    color: #a7aaad;
    cursor: default;
    opacity: 1;
}

.safdem-editor--frontend .button-link-delete {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    color: #b32d2e;
}

.safdem-editor--frontend .button-link-delete:hover,
.safdem-editor--frontend .button-link-delete:focus {
    background: #fff3f3;
    border-color: #b32d2e;
    color: #8a2424;
}

.safdem-editor--frontend input:not([type="checkbox"]):not([type="range"]):not([type="color"]),
.safdem-editor--frontend select,
.safdem-editor--frontend textarea {
    background: #fff;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    color: #2c3338;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    min-height: 34px;
    padding: 5px 8px;
}

.safdem-editor--frontend textarea {
    resize: vertical;
}

.safdem-editor--frontend input:focus,
.safdem-editor--frontend select:focus,
.safdem-editor--frontend textarea:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: 2px solid transparent;
}

.safdem-editor--frontend .description {
    color: #646970;
    font-size: 12px;
    margin: 4px 0 10px;
}

.safdem-editor--frontend [data-safdem-save-status][data-state="dirty"] {
    color: #996800;
    font-weight: 650;
}

.safdem-editor--frontend [data-safdem-save-status][data-state="saving"] {
    color: #135e96;
    font-weight: 650;
}

.safdem-editor--frontend [data-safdem-save-status][data-state="saved"] {
    color: #06752f;
    font-weight: 650;
}

.safdem-editor--frontend [data-safdem-save-status][data-state="error"] {
    color: #b32d2e;
    font-weight: 650;
}

.safdem-editor--frontend.has-unsaved-changes {
    box-shadow: inset 0 3px 0 #dba617;
}

.safdem-login-required {
    background: #fff;
    border: 1px solid #dcdcde;
    border-left: 4px solid #2271b1;
    margin: 1.25rem 0;
    padding: 16px 18px;
}

.safdem-login-required p {
    margin: 0 0 10px;
}

.safdem-login-required p:last-child {
    margin-bottom: 0;
}

.safdem-frontend-editor-shell:fullscreen,
.safdem-frontend-editor-shell:-webkit-full-screen,
.safdem-frontend-editor-shell.is-css-fullscreen {
    background: #f8fafc;
    height: 100vh !important;
    inset: 0;
    margin: 0 !important;
    max-height: none;
    max-width: none;
    min-height: 0;
    position: fixed;
    width: 100vw !important;
    z-index: 2147483000;
}

.safdem-frontend-editor-shell:fullscreen .safdem-editor--frontend,
.safdem-frontend-editor-shell:-webkit-full-screen .safdem-editor--frontend,
.safdem-frontend-editor-shell.is-css-fullscreen .safdem-editor--frontend {
    border: 0;
}

body.safdem-editor-fullscreen {
    overflow: hidden;
}

@media (max-width: 1180px) {
    .safdem-editor--frontend .safdem-editor__body {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(330px, 58%) minmax(210px, 42%);
    }

    .safdem-editor--frontend .safdem-map {
        height: auto;
        min-height: 0;
    }

    .safdem-editor--frontend .safdem-sidebar {
        border-left: 0;
        border-top: 1px solid #dcdcde;
        max-height: none;
    }
}

@media (max-width: 782px) {
    body.admin-bar .safdem-frontend-editor-shell--viewport {
        height: calc(100vh - 46px);
    }

    .safdem-frontend-editor-shell {
        min-height: 520px;
    }

    .safdem-editor--frontend .safdem-editor__toolbar {
        align-items: stretch;
        max-height: 35vh;
        overflow: auto;
    }

    .safdem-editor--frontend .safdem-editor__title {
        max-width: none;
        width: 100%;
    }

    .safdem-editor--frontend .safdem-save-hint {
        width: 100%;
    }

    .safdem-editor--frontend .safdem-editor__body {
        grid-template-rows: minmax(280px, 55%) minmax(220px, 45%);
    }

    .safdem-editor--frontend .safdem-coordinate-bar {
        align-items: flex-start;
        flex-direction: column;
        gap: 2px;
    }
}
