@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
        
        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }
        
        body { 
            font-family: 'Inter', sans-serif; 
            background-color: #5C4B99; /* Purple background from design */
            min-height: 100vh;
            display: flex;
            flex-direction: column; /* Stack main content and footer */
            align-items: center;
        }

        main {
            flex-grow: 1; /* Allows this section to grow and push the footer down */
            width: 100%;
            display: flex;
            align-items: flex-start; /* Changed from center to flex-start */
            justify-content: center;
            padding: 60px 20px 40px 20px; /* Increased top padding */
        }
        
        .container { 
            background: #ffffff;
            padding: 50px 40px 40px 40px; /* Increased top padding */
            border-radius: 12px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
            width: 100%;
            max-width: 550px;
            margin-top: 160px; /* Add margin from top of viewport */
        }
        
        .header {
            text-align: center;
            margin-top: 20px; /* Add top spacing */
            margin-bottom: 40px; /* Increased spacing */
        }
        
        .logo {
            width: 56px;
            height: 56px;
            background: linear-gradient(135deg, #8A2BE2, #4B0082);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 16px;
            color: white;
            font-size: 24px;
        }
        
        h1 { 
            font-size: 20px; /* Reduced size to prevent overflow */
            font-weight: 700;
            margin-bottom: 16px; /* Proper spacing */
            color: #4B0082;
            line-height: 1.2;
            text-transform: uppercase;
        }
        
        .subtitle { 
            font-size: 15px; 
            color: #6c757d; 
            line-height: 1.6;
        }
        
        /* This is the container for our dynamic content */
        #preferences-container {
            min-height: 150px; /* Prevents layout jump while loading */
        }
        
        .preference-group { 
            margin-bottom: 16px; 
            padding: 20px; 
            background: #f8f9fa; 
            border-radius: 8px; 
            border: 1px solid #e9ecef;
            display: flex; 
            align-items: flex-start; 
            gap: 16px;
        }
        
        .preference-group label { 
            display: contents; 
            cursor: pointer; 
        }
        
        .custom-checkbox input[type="checkbox"] { 
            display: none; 
        }
        
        .checkmark { 
            flex-shrink: 0; 
            width: 22px; 
            height: 22px; 
            background: #fff; 
            border: 1px solid #ced4da; 
            border-radius: 4px; 
            margin-top: 2px; 
            transition: all 0.2s ease; 
            display: flex; 
            align-items: center; 
            justify-content: center; 
        }
        
        .checkmark::after { 
            content: '✓'; 
            color: white; 
            font-size: 14px; 
            font-weight: 700; 
            opacity: 0; 
            transform: scale(0.5); 
            transition: all 0.2s ease-in-out; 
        }
        
        .custom-checkbox input[type="checkbox"]:checked + .checkmark { 
            background: #8A2BE2; 
            border-color: #8A2BE2; 
        }
        
        .custom-checkbox input[type="checkbox"]:checked + .checkmark::after { 
            opacity: 1; 
            transform: scale(1); 
        }
        
        .preference-content { 
            flex-grow: 1; 
        }
        
        .preference-title { 
            font-size: 14px; 
            font-weight: 700; 
            color: #212529; 
            margin-bottom: 4px; 
            text-transform: uppercase; 
        }
        
        .description { 
            font-size: 14px; 
            color: #6c757d; 
            line-height: 1.5; 
        }

        .button { 
            display: block; 
            width: 100%; 
            padding: 14px; 
            font-size: 16px; 
            font-weight: 600; 
            color: white; 
            background-color: #8A2BE2;
            border: none; 
            border-radius: 8px; 
            cursor: pointer; 
            text-align: center; 
            margin-top: 24px; 
            transition: background-color 0.3s ease;
        }
        
        .button:hover:not(:disabled) { 
            background-color: #6A1E9A; 
        }
        
        .button:disabled { 
            background-color: #c9a0dc; 
            cursor: not-allowed; 
        }
        
        .unsubscribe-all { 
            margin-top: 24px; 
            text-align: center; 
        }
        
        #unsubscribe-button { 
            background: none; 
            border: none; 
            color: #dc3545; 
            text-decoration: none; 
            font-size: 14px; 
            font-family: inherit; 
            cursor: pointer; 
            padding: 8px; 
        }
        
        #unsubscribe-button:hover { 
            text-decoration: underline; 
        }
        
        #message { 
            display: none; 
            padding: 14px; 
            border-radius: 8px; 
            margin-bottom: 24px; 
            text-align: center; 
            font-weight: 500; 
        }
        
        #message.success { 
            background-color: #d1e7dd; 
            color: #0f5132; 
            border: 1px solid #badbcc; 
        }
        
        #message.error { 
            background-color: #f8d7da; 
            color: #842029; 
            border: 1px solid #f5c2c7; 
        }
        
        #loading-state { 
            text-align: center; 
            color: #6c757d; 
            padding: 20px; 
        }
        footer {
    width: 550px;
}
.page-section.vertical-alignment--middle:not(.content-collection):not(.gallery-section):not(.user-items-list-section):not(.editmode-changing-rowcount).section-height--medium>.content-wrapper {
    padding-top: 0;
    padding-bottom: 0;
}