﻿.settings-backdrop
{
    position: fixed;
    z-index: 30;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.35);
}

.settings-backdrop[hidden]
{
    display: none;
}

.settings-dialog
{
    width: min(720px, 100%);
    max-height: min(720px, calc(100vh - 48px));
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--panel);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
}

.settings-header
{
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
}

.settings-header h2
{
    margin: 0;
    font-size: 18px;
}

.settings-close
{
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 6px;
    color: var(--text);
    background: transparent;
    cursor: pointer;
}

.settings-close:hover,
.settings-close:focus
{
    background: var(--panel-soft);
    outline: none;
}

.settings-close svg
{
    width: 18px;
    height: 18px;
}

.settings-body
{
    display: grid;
    grid-template-columns: 180px 1fr;
    min-height: 360px;
}

.settings-tabs
{
    padding: 10px;
    border-right: 1px solid var(--border);
    background: var(--panel-soft);
}

.settings-tab
{
    display: grid;
    grid-template-columns: 18px 1fr;
    gap: 8px;
    align-items: center;
    width: 100%;
    border: 0;
    border-radius: 6px;
    padding: 10px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    background: transparent;
    cursor: pointer;
    text-align: left;
}

.settings-tab:hover,
.settings-tab:focus,
.settings-tab.active
{
    background: var(--panel);
    outline: none;
}

.settings-tab svg
{
    width: 16px;
    height: 16px;
}

.settings-content
{
    padding: 18px;
}

.settings-panel
{
    display: none;
}

.settings-panel.active
{
    display: block;
}

.settings-row
{
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.settings-row:first-child
{
    padding-top: 0;
}

.settings-row-title
{
    font-size: 14px;
    font-weight: 700;
}

.settings-scope
{
    display: inline-block;
    margin-left: 6px;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 1px 7px;
    vertical-align: 1px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-dim);
    background: var(--panel-soft);
}

.settings-row-note
{
    margin-top: 4px;
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.45;
}

.switch
{
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

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

.switch span
{
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: #cbd5e1;
    cursor: pointer;
}

.switch span::before
{
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    border-radius: 50%;
    background: #ffffff;
    transition: transform 160ms ease;
}

.switch input:checked + span
{
    background: var(--accent);
}

.switch input:checked + span::before
{
    transform: translateX(20px);
}

.number-setting
{
    display: grid;
    grid-template-columns: 72px auto;
    gap: 8px;
    align-items: center;
    color: var(--text-dim);
    font-size: 13px;
    font-weight: 700;
}

.number-setting input
{
    width: 72px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px;
    font-family: inherit;
    font-size: 14px;
    color: var(--text);
    background: var(--panel);
}

.number-setting input:focus
{
    border-color: #8bcfc6;
    box-shadow: 0 0 0 3px #d7f3ec;
    outline: none;
}

.settings-select
{
    min-width: 120px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px;
    font-family: inherit;
    color: var(--text);
    background: var(--panel);
}

.color-swatch
{
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--accent);
}


@media (max-width: 860px)
{
    .settings-body
    {
        grid-template-columns: 1fr;
    }

    .settings-tabs
    {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }
}
