:root {
    --primary-green: #42b746;
    --primary-green-hover: #359a39;
    --text-dark: #1f2937;
    --text-muted: #6b7280;
    --bg-gray: #f3f4f6;
    --border-color: #e5e7eb;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-gray);
    font-family: 'Inter', sans-serif;
    color: var(--text-dark);
    line-height: 1.5;
    padding: 1rem;
}

.settings-wrapper {
    max-width: 650px;
    margin: 1.5rem auto;
}

/* Nav Menu Headers */
.settings-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.nav-back-btn {
    color: var(--primary-green);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.nav-back-btn:hover {
    color: var(--primary-green-hover);
}

.nav-title {
    font-weight: 700;
    color: var(--text-dark);
    font-size: 1.1rem;
}

/* Structural Dashboard Cards */
.settings-card {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.section-heading {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    font-weight: 700;
    border-left: 3px solid var(--primary-green);
    padding-left: 8px;
}

/* Settings Control Rows */
.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid #f3f4f6;
    gap: 1.5rem;
}

.setting-row:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

.setting-row:first-of-type {
    padding-top: 0;
}

.link-row {
    cursor: pointer;
}

.link-row:hover .setting-label {
    color: var(--primary-green);
}

.setting-info {
    display: flex;
    flex-direction: column;
}

.setting-label {
    font-weight: 600;
    font-size: 0.95rem;
    color: #111827;
    transition: color 0.2s ease;
}

.setting-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.arrow-icon {
    color: #9ca3af;
    font-weight: bold;
    font-size: 1.1rem;
}

/* Button Stylings */
.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: #374151;
    padding: 0.4rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-outline:hover {
    background: #f9fafb;
}

/* iOS Style Switch Slider Components */
.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
    flex-shrink: 0;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #d1d5db;
    transition: .3s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px; width: 20px;
    left: 3px; bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

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

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

/* Legal Accordion Element Loops */
.legal-accordion {
    border-bottom: 1px solid #f3f4f6;
    padding: 0.75rem 0;
}

.legal-accordion:last-of-type {
    margin-bottom: 1rem;
}

.accordion-trigger {
    width: 100%;
    background: none;
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    color: #111827;
    cursor: pointer;
    padding: 0.25rem 0;
}

.accordion-trigger .chevron {
    font-size: 0.7rem;
    color: #9ca3af;
    transition: transform 0.2s ease;
}

.accordion-trigger.active .chevron {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease-out;
    font-size: 0.85rem;
    color: #4b5563;
}

.accordion-content.open {
    max-height: 350px;
    padding: 0.75rem 0;
}

.accordion-content p {
    margin-bottom: 0.5rem;
}

.accordion-content ul {
    padding-left: 1.25rem;
}

.accordion-content li {
    margin-bottom: 0.4rem;
}

.settings-footer {
    text-align: center;
    padding: 1.5rem 0;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Smart Media Target Filters */
@media(max-width: 480px) {
    body { padding: 0.5rem; }
    .settings-card { padding: 1rem; }
    .setting-row { gap: 1rem; }
}
.modal-overlay {
    position: fixed; /* Stays centered regardless of parent containers */
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex; 
    align-items: center; 
    justify-content: center; /* This forces perfect center alignment */
    z-index: 9999;
}

/* The Box */
.modal-box {
    background: white; padding: 25px; width: 90%; max-width: 400px;
    border-radius: 12px; box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.modal-box h3 { color: #42b746; margin-top: 0; }
.modal-desc { font-size: 0.9rem; color: #666; margin-bottom: 20px; }

/* Inputs */
.modal-input {
    width: 100%; padding: 12px; margin-bottom: 15px; border: 1px solid #ddd;
    border-radius: 6px; box-sizing: border-box; font-family: 'Inter', sans-serif;
}

/* Buttons */
.modal-actions { display: flex; gap: 10px; margin-top: 10px; }
.btn-confirm { 
    flex: 1; background: #ff4d4d; color: white; border: none; 
    padding: 12px; border-radius: 6px; cursor: pointer; font-weight: 600;
}
.btn-cancel { 
    flex: 1; background: #f0f0f0; border: none; 
    padding: 12px; border-radius: 6px; cursor: pointer;
}

.btn-confirm:hover { background: #e63939; }