.settings-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    padding: 1.5rem 2rem;
    z-index: 1;
}

.settings-header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-app-region: no-drag;
}

.back-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.12);
}

.header-content {
    flex: 1;
}

.page-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.35rem;
    background: linear-gradient(135deg, #06b6d4 0%, #8b5cf6 50%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-subtitle {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.65);
}

.settings-main {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.settings-block {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 1rem;
}

.settings-block h2 {
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.95);
}

.block-hint {
    margin: 0 0 0.8rem 0;
    font-size: 0.83rem;
    color: rgba(255, 255, 255, 0.62);
}

.mode-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 0.75rem;
}

.mode-btn {
    text-align: left;
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    transition: all 0.25s ease;
    -webkit-app-region: no-drag;
}

.mode-btn:hover {
    border-color: rgba(139, 92, 246, 0.8);
    background: rgba(139, 92, 246, 0.18);
}

.mode-btn.active {
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.22);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.25);
}

.mode-title {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.mode-desc {
    display: block;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.75);
}

.toggle-options {
    display: flex;
    gap: 0.75rem;
}

.field-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.field-row label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.88);
    font-weight: 600;
}

.field-row input[type="number"],
.field-row input[type="text"],
.field-row select {
    width: 96px;
    border-radius: 10px;
    border: 1px solid var(--sc-select-border);
    background-color: var(--sc-select-option-bg);
    color: var(--sc-select-text);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    padding: 0.5rem 0.65rem;
}

.field-row input[type="text"] {
    width: 180px;
    font-weight: 600;
}

.field-row select {
    width: 220px;
    font-weight: 700;
    cursor: pointer;
}

.field-row input[type="number"]:focus,
.field-row input[type="text"]:focus,
.field-row select:focus {
    outline: none;
    border-color: #06b6d4;
    box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.22);
}

.small-action-btn {
    border-radius: 10px;
    border: 1px solid rgba(6, 182, 212, 0.65);
    background: rgba(6, 182, 212, 0.15);
    color: white;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    padding: 0.55rem 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-app-region: no-drag;
}

.small-action-btn:hover {
    background: rgba(6, 182, 212, 0.25);
}

.subheading {
    margin: 0.9rem 0 0.55rem 0;
    font-size: 0.9rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.92);
}

.toggle-btn {
    min-width: 120px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.9);
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    padding: 0.7rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-app-region: no-drag;
}

.toggle-btn:hover {
    border-color: rgba(6, 182, 212, 0.8);
}

.toggle-btn.active {
    border-color: #06b6d4;
    background: rgba(6, 182, 212, 0.2);
    box-shadow: 0 0 14px rgba(6, 182, 212, 0.25);
}

.settings-footer {
    flex-shrink: 0;
    padding-top: 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
}

.status-text {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.65);
    margin: 0;
}

.continue-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 240px;
    padding: 0.9rem 1.6rem;
    border: none;
    border-radius: 50px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 50%, #f59e0b 100%);
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.35);
    -webkit-app-region: no-drag;
}

.continue-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

.continue-btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

.hidden {
    display: none;
}

@media (max-width: 800px) {
    .mode-options {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .settings-container {
        position: static;
        min-height: 100vh;
        display: block;
        padding: 1rem 0.85rem 1.25rem;
    }

    .settings-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        margin-bottom: 1rem;
    }

    .back-btn {
        padding: 0.5rem 0.95rem;
        font-size: 0.82rem;
    }

    .back-btn:hover {
        background: rgba(255, 255, 255, 0.05);
    }

    .header-content {
        width: 100%;
    }

    .page-title {
        font-size: 1.5rem;
        line-height: 1.2;
        margin-bottom: 0.25rem;
    }

    .page-subtitle {
        font-size: 0.8rem;
        line-height: 1.4;
    }

    .settings-main {
        display: block;
        flex: none;
        min-height: 0;
        overflow: visible;
        padding-right: 0;
    }

    .settings-block {
        padding: 0.85rem;
        margin-bottom: 0.85rem;
        border-radius: 12px;
    }

    .settings-block:last-of-type {
        margin-bottom: 0;
    }

    .settings-block h2 {
        font-size: 0.95rem;
        margin-bottom: 0.6rem;
    }

    .subheading {
        font-size: 0.85rem;
        margin: 0.85rem 0 0.5rem 0;
    }

    .block-hint {
        font-size: 0.78rem;
        margin-bottom: 0.7rem;
        line-height: 1.45;
    }

    .mode-btn {
        padding: 0.85rem;
    }

    .mode-title {
        font-size: 0.95rem;
    }

    .mode-desc {
        font-size: 0.78rem;
    }

    .toggle-options {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .toggle-btn {
        flex: 1 1 calc(50% - 0.25rem);
        min-width: 0;
        padding: 0.6rem 0.5rem;
        font-size: 0.78rem;
        text-align: center;
    }

    .toggle-btn:hover {
        border-color: rgba(255, 255, 255, 0.2);
    }

    .field-row {
        gap: 0.55rem;
        margin-bottom: 0.6rem;
    }

    .field-row label {
        flex: 1 1 100%;
        font-size: 0.85rem;
    }

    .field-row input[type="number"],
    .field-row input[type="text"],
    .field-row select {
        flex: 1 1 auto;
        width: auto;
        min-width: 0;
        font-size: 0.9rem;
        padding: 0.5rem 0.6rem;
    }

    .field-row input[type="text"] {
        flex: 1 1 60%;
        width: auto;
    }

    .field-row select {
        width: 100%;
    }

    .small-action-btn {
        flex: 0 0 auto;
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
    }

    .settings-footer {
        position: sticky;
        bottom: 0;
        margin: 1rem -0.85rem 0;
        padding: 0.85rem 0.85rem max(0.85rem, env(safe-area-inset-bottom));
        background: linear-gradient(to top, rgba(10, 10, 26, 1) 0%, rgba(10, 10, 26, 0.95) 70%, transparent 100%);
        gap: 0.5rem;
    }

    .status-text {
        font-size: 0.75rem;
        text-align: center;
        line-height: 1.35;
    }

    .continue-btn {
        width: 100%;
        max-width: 320px;
        padding: 0.85rem 1.25rem;
        font-size: 0.9rem;
    }

    .continue-btn:hover:not(:disabled) {
        transform: none;
    }
}

@media (max-width: 380px) {
    .settings-container {
        padding: 0.85rem 0.6rem 1rem;
    }

    .page-title {
        font-size: 1.35rem;
    }

    .toggle-btn {
        flex: 1 1 100%;
    }

    .settings-footer {
        margin: 0.85rem -0.6rem 0;
        padding-left: 0.6rem;
        padding-right: 0.6rem;
    }
}
