:root { background-color: #000000; }
        html, body { background-color: #000000 !important; }
        html.light, html.light body { background-color: #fafafa !important; }
        body { transition: background-color 0.3s ease; -webkit-tap-highlight-color: transparent; font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; overflow-x: hidden; overscroll-behavior-y: none; letter-spacing: -0.01em; }
        
        .pt-safe { padding-top: max(env(safe-area-inset-top), 12px); }
        .pb-safe { padding-bottom: max(env(safe-area-inset-bottom), 12px); }
        .top-safe-4 { top: max(env(safe-area-inset-top), 16px); } 

        ::-webkit-scrollbar { width: 8px; height: 4px; }
        ::-webkit-scrollbar-track { background: transparent; }
        ::-webkit-scrollbar-thumb { background: #d4d4d8; border-radius: 4px; }
        .dark ::-webkit-scrollbar-thumb { background: #27272a; }
        ::-webkit-scrollbar-thumb:hover { background: #a1a1aa; }
        .dark ::-webkit-scrollbar-thumb:hover { background: #3f3f46; }
        .hide-scrollbar::-webkit-scrollbar { display: none; }
        .hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
        .rich-content img { border-radius: 0.75rem; margin: 0.5rem auto; width: 100%; height: auto; max-height: 500px; object-fit: cover; display: block; }
        .rich-content iframe, .rich-content video { border-radius: 0.75rem; margin: 0.5rem auto; width: 100%; aspect-ratio: 16 / 9; }
        .editor-placeholder:empty:before { content: attr(data-placeholder); color: #71717a; pointer-events: none; display: block; }
        .dark .editor-placeholder:empty:before { color: #52525b; }
        
        .fast-fade { animation: fastFadeIn 0.15s ease-out forwards; }
        @keyframes fastFadeIn { from { opacity: 0.5; transform: scale(0.99); } to { opacity: 1; transform: scale(1); } }

        .spinner { border: 3px solid rgba(113, 113, 122, 0.3); border-radius: 50%; border-top: 3px solid #E21818; width: 20px; height: 20px; animation: spin 1s linear infinite; }
        .dark .spinner { border: 3px solid rgba(255,255,255,0.1); border-top: 3px solid #E21818; }
        @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

        #ptr-spinner { position: fixed; top: env(safe-area-inset-top); left: 50%; transform: translateX(-50%) translateY(-50px) rotate(0deg); width: 32px; height: 32px; border-radius: 50%; background: white; box-shadow: 0 4px 6px rgba(0,0,0,0.1); display: flex; align-items: center; justify-content: center; z-index: 100; opacity: 0; transition: opacity 0.2s, transform 0s; }
        .dark #ptr-spinner { background: #27272a; border: 1px solid #3f3f46; box-shadow: 0 4px 12px rgba(0,0,0,0.5); }
        #ptr-spinner.refreshing { transition: transform 0.3s ease, opacity 0.2s; transform: translateX(-50%) translateY(20px) rotate(360deg) !important; animation: ptr-spin 1s linear infinite; }
        @keyframes ptr-spin { 0% { transform: translateX(-50%) translateY(20px) rotate(0deg); } 100% { transform: translateX(-50%) translateY(20px) rotate(360deg); } }
        #ptr-spinner svg { color: #E21818; width: 20px; height: 20px; margin: auto; }