.prompt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
    animation: blackout 0.5s ease-in-out forwards;
}

.prompt-overlay.no-bg {
    animation: none;
    background-color: var(--background-color);
}

.prompt-overlay.fade-out {
    animation: fadeOut 0.3s ease-in-out forwards !important;
}

@keyframes fadeOut {
    from { opacity: 1; }
    to   { opacity: 0; transform: scale(.9);}
}

@keyframes blackout {
    0% {
        background-color: rgba(0, 0, 0, 0);
    }

    100% {
        background-color: rgba(0, 0, 0, 0.3);
    }
}

.prompt-big-dialog,
.prompt-dialog {
    color: var(--text-color);
    background-color: var(--background-color);
    border: 1px solid var(--border-light-color);
    border-radius: 15px;
    max-width: 400px;
    width: calc(100% - 40px);
    box-shadow: var(--shadow);
    margin: 10px;
    animation: showdialog 0.5s ease-in-out forwards;
    overflow: hidden;
}

.prompt-big-dialog .toolbar,
.prompt-dialog .toolbar {
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: absolute;
    top: 0px;
    right: 0px;
    left: 0px;
    pointer-events: none;
}

.prompt-big-dialog .toolbar .icon-button,
.prompt-dialog .toolbar .icon-button {
    width: 32px;
    height: 32px;
    font-size: x-large;
}

.prompt-big-dialog .toolbar hr,
.prompt-dialog .toolbar hr {
    border: 0;
    border-left: 1px solid var(--border-light-color)
}

.prompt-big-dialog .toolbar .toolbar-left,
.prompt-big-dialog .toolbar .toolbar-center,
.prompt-big-dialog .toolbar .toolbar-right,
.prompt-dialog .toolbar .toolbar-left,
.prompt-dialog .toolbar .toolbar-center,
.prompt-dialog .toolbar .toolbar-right{
    display: flex; gap: 15px;
    pointer-events: none;
}

.prompt-big-dialog .toolbar .toolbar-left *,
.prompt-big-dialog .toolbar .toolbar-center *,
.prompt-big-dialog .toolbar .toolbar-right *,
.prompt-dialog .toolbar .toolbar-left *,
.prompt-dialog .toolbar .toolbar-center *,
.prompt-dialog .toolbar .toolbar-right *{
    pointer-events: all;
}

.icon-button.dialog-window-control {
    background-color: var(--field-color);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: large !important;
}

.icon-button.dialog-window-control:hover {
    border-radius: 25%;
}

.icon-button.dialog-window-control:focus {
    outline: none;
}

.prompt-dialog.warn {
    animation: showdialogWarn 0.5s ease-in-out forwards !important;
}

.prompt-big-dialog {
    overflow: scroll;
    max-width: 100vw;
    width: 100vw;
    height: calc(100vh - 20px);
    margin: 20px;
    animation: showdialogBig 0.5s ease-in-out forwards;
}

.prompt-dialog.no-animation {
    animation: none !important;
}
.prompt-big-dialog.no-animation {
    border: 0;
    box-shadow: none;
    animation: none !important;
}

@keyframes showdialog {
    0% {
        transform: scale(0);
    }

    60% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes showdialogWarn {
    0% {
        transform: translateX(10px);
    }
    25% {
        transform: translateX(-10px);
    }
    50% {
        transform: translateX(10px);
    }
    75% {
        transform: translateX(-10px);
    }
    100% {
        transform: translateX(0px);
    }
}

@keyframes showdialogBig {
    0% {
        transform: translateX(calc(100% + 20px));
    }

    100% {
        transform: translateX(0%);
    }
}

.prompt-title {
    margin-bottom: 15px;
}

.prompt-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

input {
    background: var(--field-color);
    color: var(--text-color);
    width: calc(100% - 40px);
    height: 35px;
    padding: 0px 20px;
    margin-bottom: 15px;
    border: 1px solid var(--border-field-color);
    outline: none;
    border-radius: 15px;
}

select {
    width: 100%;
    max-width: 200px;
    height: 35px;
    border-radius: 15px;
    border: 1px solid var(--border-field-color);
    background: var(--field-color);
    color: var(--text-color);
    padding: 0px 10px;
    outline: none;
}


.joystick-container {
    width:140px;
    height:140px;
    border:1px solid var(--border-field-color);
    border-radius:14px;
    position:relative;
    box-shadow: var(--shadow-light);
    background-color: var(--field-color);
}

.joystick-handle {
    width:28px;
    height:28px;
    border-radius:50%;
    background:var(--button-color-2);
    position:absolute;
    left:56px;
    top:56px;
    transform:translate(0,0);
    box-shadow:var(--shadow-light);
}

input[type="range"] {
    width: 160px;
    padding: 0;
    border: 0;
    -webkit-appearance: none;
    height: 6px;
    border-radius: 6px;
    background: var(--border-light-color);
    outline: none;
    cursor: pointer;
}
input[type="range"]::-moz-range-thumb,
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--border-light-color);
    background: var(--button-color-2);
    cursor: pointer;
    box-shadow: var(--shadow-light);
}

input[type="range"]::-moz-range-progress {
    height: 6px;
    border-radius: 5px;
    background: var(--highlight-color);
}

input[type="color"] {
    width: 40px;
    height: 40px;
    border-radius: 20px;
    padding: 0;
    border: 1px solid var(--border-field-color);
    cursor: pointer;
    box-shadow: var(--shadow-light);
    outline: none;
}

.prompt-buttons {
    display: flex;
    gap: 10px;
}

.prompt-button {
    padding: 5px 30px;
    border-radius: 15px;
    cursor: pointer;
    color: var(--text-color);
    border: 1px solid var(--border-light-color);
    background-color: transparent;
    outline: none;
}

.prompt-dialog select:focus,
.prompt-button:focus {
    border: 2px solid var(--highlight-color);
}

.prompt-button.submit {
    background-color: var(--highlight-color);
    border-color: var(--highlight-color);
    color: var(--button-color-2);
}

.table-selector-dialog {
    display: grid;
    grid-template-columns: repeat(6, 30px);
    grid-template-rows: repeat(4, 30px);
    gap: 4px;
    padding: 10px;
    justify-content: center;
    perspective: 800px;
}

.table-item-ex {
    background: var(--field-color);
    cursor: pointer;
    border-radius: 3px;
    transition: 0.3s;
    border: 1px solid var(--border-field-color);
    transition: border 0s, background 0s 0.2s, transform 0.5s, border-radius 0.5s;
}

.table-item-ex.highlighted {
    background: var(--highlight-color);
    border: 1px solid var(--highlight-color);
    transform: rotateY(180deg);
}

.table-selector-dialog > .table-item-ex:first-child {
    border-top-left-radius: 10px;
}
.table-selector-dialog > .table-item-ex.highlighted:first-child {
    border-top-left-radius: 3px;
    border-top-right-radius: 10px;
}

.table-selector-dialog > .table-item-ex:nth-child(6) {
    border-top-right-radius: 10px;
}
.table-selector-dialog > .table-item-ex.highlighted:nth-child(6) {
    border-top-right-radius: 3px;
    border-top-left-radius: 10px;
}

.table-selector-dialog > .table-item-ex:nth-child(19) {
    border-bottom-left-radius: 10px;
}
.table-selector-dialog > .table-item-ex.highlighted:nth-child(19) {
    border-bottom-left-radius: 3px;
    border-bottom-right-radius: 10px;
}

.table-selector-dialog > .table-item-ex:nth-child(24) {
    border-bottom-right-radius: 10px;
}
.table-selector-dialog > .table-item-ex.highlighted:nth-child(24) {
    border-bottom-right-radius: 3px;
    border-bottom-left-radius: 10px;
}

.prompt-dialog div.center {
    display: block;
    text-align: center;
    justify-content: center;
}

.prompt-dialog hr {
    border: 0;
    border-bottom: 1px solid var(--border-light-color);
    width: 75%;
}

.prompt-dialog a {
    color: var(--link-color);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
}

.prompt-dialog a:hover {
    text-decoration: underline;
}

.prompt-button-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin-top: 50px;
}

.prompt-button-list button,
.prompt-button-list button *,
.prompt-button-list button:focus {
    border: none;
    transition: 0s;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 3px;
    border-radius: 0px;
}

.prompt-button-list .icon {
    font-size: large;
}

.prompt-button-list .selected-option {
    background-color: var(--hover-color);
    color: var(--text-color);
}

.prompt-search-input {
    background-color: var(--background-color) !important;
    border-radius: 0px !important;
    padding: 8px 48px 8px 15px !important;
    margin: 0px !important;
    border: none !important;
    border-bottom: 1px solid var(--border-light-color) !important;
    width: calc(100% - 48px - 8px)  !important;
    color: var(--title-color) !important;
}

.prompt-preview-list {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-y: auto;
    background: var(--background-color);
    font-size: 14px;

    text-rendering: geometricPrecision;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.prompt-preview-list li {
    background: var(--background-color);
    padding: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background-color 0s;
    margin: 5px;
    border-radius: 10px;
}
.prompt-preview-list li:hover {
    background-color: var(--hover-color);
}

.prompt-preview-list li .icon {
    font-size: 24px;
    max-width: 1ch;
    overflow: hidden;
}

.prompt-preview-list li .prompt-item-description {
    margin-top: 2px;
    font-size: 0.85rem;
}

.prompt-preview-list li .prompt-item-description .icon {
    font-size: 16px;
    vertical-align: middle;
}

.prompt-preview-list li .prompt-item-description .tag {
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 0.85rem;
}

.prompt-preview-list li .prompt-item-description .tag:nth-of-type(5n+1) { background-color: var(--quote-blue-bg); color: var(--quote-blue) }
.prompt-preview-list li .prompt-item-description .tag:nth-of-type(5n+2) { background-color: var(--quote-green-bg); color: var(--quote-green) }
.prompt-preview-list li .prompt-item-description .tag:nth-of-type(5n+3) { background-color: var(--quote-yellow-bg); color: var(--quote-yellow) }
.prompt-preview-list li .prompt-item-description .tag:nth-of-type(5n+4) { background-color: var(--quote-red-bg); color: var(--quote-red) }
.prompt-preview-list li .prompt-item-description .tag:nth-of-type(5n)   { background-color: var(--quote-purple-bg); color: var(--quote-purple) }

.prompt-preview-list li .icon.color-red    { color: var(--quote-red)    !important; }
.prompt-preview-list li .icon.color-orange { color: var(--quote-orange) !important; }
.prompt-preview-list li .icon.color-yellow { color: var(--quote-yellow) !important; }
.prompt-preview-list li .icon.color-green  { color: var(--quote-green)  !important; }
.prompt-preview-list li .icon.color-blue   { color: var(--quote-blue)   !important; }
.prompt-preview-list li .icon.color-purple { color: var(--quote-purple) !important; }
.prompt-preview-list li .icon.color-pink   { color: var(--quote-pink)   !important; }

.prompt-preview-list li.selected-option {
    background: var(--hover-color);
    color: var(--title-color);
}

.switch {
    position: relative;
    display: inline-block;
    min-width: 46px;
    height: 26px;
}

.switch input {
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--field-color);
    transition: 0.3s;
    border-radius: 999px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: var(--text-color);
    transition: 0.1s;
    border-radius: 50%;
    box-shadow: var(--shadow-light);
}

input:checked + .slider {
    background-color: var(--highlight-color);
}

input:checked + .slider:before {
    background-color:var(--button-color-2);
    transform: translateX(20px);
}

.switch-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.setting-group-title {
    user-select: none;
}

.switch-text {
    font-size: 14px;
    color: var(--title-color);
    display: block;
    user-select: none;
}

.switch-description {
    font-size: small;
    color: var(--text-color);
    opacity: .75;
    display: block;
    user-select: none;
}

.settings-body {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 0px 48px 0px 48px;
}

.main-page {
    max-height: 90vh;
    overflow-y: scroll;
    overflow-x: hidden;
    flex-grow: 1;
}

.setting {
    padding: 10px;
    background-color: var(--background-color-3);
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1px;
    box-shadow: var(--shadow-light);
}

.setting.top {
    border-radius: 15px 15px 0px 0px;
}

.setting.bottom {
    border-radius: 0px 0px 15px 15px;
    margin-bottom: 10px;
}

.setting.top.bottom {
    border-radius: 15px;
}

.setting input {
    max-width: 300px;
    margin: 0;
}

.setting.switch-wrapper {
    display: flex;
}

@media screen and (max-width: 800px) {
    .settings-body {
        display: block;
        padding: 10px;
    }
}

.settings-body textarea {
    background: var(--field-color);
    border-radius: 10px;
    padding: 10px;
    color: var(--text-color);
    height: 20ch;
    border: 1px solid var(--border-field-color);
    outline: none;
    font-size: 12pt;
    resize: vertical;
}

h5.setting-subtitle {
    margin: 0;
    margin-bottom: 5px;
    font-weight: normal;
    font-size: 1em;
    color: var(--text-color-secondary);
}

.prompt-dialog .drop-area {
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    border-radius: 15px;
    cursor: pointer;
    padding: 20px;
    transition: all .3s;
    height: 300px;
    border: 2px dashed transparent;
}

.prompt-dialog .drop-area:hover {
    background-color: var(--hover-color);
}

.prompt-dialog .drop-area.dragover {
    background-color: var(--selection-color);
    border-color: var(--highlight-color);
    margin: 10px;
    border: 2px dashed var(--highlight-color);
}

.prompt-dialog .drop-area-text {
    text-align: center;

    .subtitle {
        font-size: 0.9em;
    }
}

.prompt-dialog + .drop-area:hover {
    padding: 0;
}

.prompt-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--quote-blue-bg);
    border-bottom: 1px solid var(--quote-blue);
    color: var(--text-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    box-sizing: border-box;
    z-index: 9999;
    font-family: sans-serif;
    animation: prompt-banner-open 0.5s cubic-bezier(0.25, 1.5, 0.5, 1.5) forwards;
}

@keyframes prompt-banner-open {
    0% {
        transform: translateY(-100%);
    }
    70% {
        transform: translateY(10%);
    }
    100% {
        transform: translateY(0%);
    }
}

/* .prompt-banner-left {
} */

.prompt-banner-right {
    display: flex;
    gap: 8px;
}

.prompt-text-button {
    background: transparent;
    border: none;
    color: var(--button-color);
    padding: 4px 8px;
    cursor: pointer;
    border-radius: 8px;
    transition: 0.2s;
}

.prompt-text-button:hover {
    background: var(--hover-color);
    color: var(--button-color);
}
.prompt-primary {
    background-color: var(--highlight-color);
    color: var(--button-color-2);
}
.prompt-icon-button {
    font-family: 'Material Symbols Rounded';
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: inherit;
}

.color-preview-dialog .dialog-window-control {
    background-color: #00000033;
    text-shadow: var(--shadow-light);
}

.color-preview-dialog .dialog-window-control:hover {
    background-color: var(--field-color);
    text-shadow: none;
}

.dialog-window-control.transparent-dialog-window-control {
    background-color: #00000000;
    text-shadow: var(--shadow-light);
}

.dialog-window-control.transparent-dialog-window-control:hover {
    background-color: var(--field-color);
    text-shadow: none;
}

.color-info-preview {
    width: 100%;
    height: 128px;
    box-shadow: var(--shadow);
}

.color-info-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 24px 8px;
}

.color-info-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.color-info-label {
    width: 80px;
    color: var(--text-color-secondary);
    font-size: 0.9em;
    text-align: right;
    user-select: none;
    cursor: help;
}

#color-scheme-colors {
    margin: 12px 0;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
}

.color-scheme-box {
    width: 24px;
    height: 24px;
    border-radius: 12px;
    cursor: pointer;
    transition: border-radius 0.3s;
}

.color-scheme-box:hover {
   border-radius: 6px;
}

#color-scheme-container {
    margin-top: 15px;
    padding-top: 15px;
}

.prompt-text-editor {
    background: var(--background-color);
    color: var(--text-color);
    width: 100%;
    border:none;
    outline: none;
    font-family: var(--font-editor), monospace;
    font-size: 14px;
    box-sizing: border-box;
    height: calc(100vh - 30px);
    padding: 64px 64px calc(50% - 64px) 64px;
    resize: none;
    font-size: 1em;
}

@media screen and (max-width: 800px) {
    .prompt-text-editor {
        padding: 64px 1px calc(50% - 64px) 1px;
    }
}

.prompt-text-editor::selection {
    background-color: var(--highlight-color);
    color: var(--button-color-2);
    font-weight: bold;
}