/* * ================================================================================================
 * PROMPTLAB VISUAL ARCHITECTURE SYSTEM - NO FILTER EDITION (FULL STABLE)
 * ================================================================================================
 */

/* * ================================================================================================
 * [SECTOR 00] COLOR PROTOCOL & GLOBAL VARS
 * ================================================================================================
 */
:root {
    /* 1. VARIÁVEIS DE UI (GLOBAIS) */
    --font-main: 'Plus Jakarta Sans', sans-serif;

    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
    --glass-bg: rgba(28, 28, 32, 0.4);
    --glass-solid: hsl(220, 10%, 8%);
    --popover-bg: rgba(25, 25, 30, 0.98);

    --blur: 25px;
    --radius-lg: 27px;
    --radius-sm: 15px;
    --transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);

    --bg-color: #000000;
    --text: #000000;
    --accent: #000000;

    --primary-logo: var(--accent);
    --secondary-ui: var(--text);

    /* Border Colors */
    --nav-border-color: rgba(255, 255, 255, 0.1);
    --card-border-color: rgba(255, 255, 255, 0.1);
}

/* * ================================================================================================
 * [GLOBAL] HIDE NATIVE CHECKBOXES (Custom toggles only)
 * ================================================================================================
 */
input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* * ================================================================================================
 * [GLOBAL] ENABLE COPY/PASTE MENU ON INPUTS
 * ================================================================================================
 */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="url"],
input[type="number"],
textarea,
input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="hidden"]):not([type="file"]):not([type="range"]):not([type="color"]) {
    -webkit-touch-callout: default !important;
    -webkit-user-select: text !important;
    user-select: text !important;
    touch-action: auto !important;
    pointer-events: auto !important;
}

/* Ensure inputs in any container can be selected */
body input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="hidden"]):not([type="file"]):not([type="range"]):not([type="color"]),
body textarea,
.app-view input:not([type="checkbox"]):not([type="radio"]),
.app-view textarea,
.product-form-group input,
.product-form-group textarea {
    -webkit-touch-callout: default !important;
    -webkit-user-select: text !important;
    user-select: text !important;
    touch-action: auto !important;
    pointer-events: auto !important;
}

/* * ================================================================================================
 * [GLOBAL] INVISIBLE SCROLLBAR (Phantom Mode)
 * ================================================================================================
 */
::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
    background: transparent;
}

html, body {
    scrollbar-width: none;
    -ms-overflow-style: none;
    overflow-x: hidden;
    max-width: 100vw;
}

html {
    overflow-x: hidden;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text);
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
    position: relative;
}

/* * ================================================================================================
 * [GLOBAL] TEXT SELECTION CONTROL
 * ================================================================================================
 */
/* Disable text selection on header/navbar */
.navbar,
.navbar *:not(input):not(textarea) {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Enable selection for input fields in header */
.navbar input,
.navbar textarea,
#header-search-input {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* Disable text selection on agenda only */
#view-agenda,
#view-agenda *:not(input):not(textarea) {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* PULL TO REFRESH UI */
#ptr-loader {
    position: absolute;
    top: -60px;
    left: 0;
    width: 100%;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--accent, #00ff9d);
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 100;
    pointer-events: none;
}

.ice-library-container {
    position: relative;
    /* Garante que o container deslize sobre o background */
    transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1); 
}

/* * ================================================================================================
 * [SECTOR 01] ANIMATION ENGINE
 * ================================================================================================
 */
@keyframes neonPulse { 0%, 100% { box-shadow: inset 0 0 0px #000; } 50% { box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.5); } }
@keyframes shine { to { background-position: -200% center; } }
@keyframes spin { 100% { transform: rotate(360deg); } }
@keyframes popIn { from { opacity: 0; transform: scale(0.95) translateY(-10px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes waterfallDrop { 0% { opacity: 0; transform: translateY(-8px); } 100% { opacity: 1; transform: translateY(0); } }
@keyframes hue-cycle { 0% { filter: hue-rotate(0deg); } 100% { filter: hue-rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { 0% { opacity: 0; transform: translateY(20px); } 100% { opacity: 1; transform: translateY(0); } }

/* * ================================================================================================
 * [SECTOR 02] PROMPTLAB ENVIRONMENTS (THEME MATRIX)
 * ================================================================================================
 */
html[data-theme="default-dark"] { --bg-color: #000000; --text: #ccff00; --accent: #828282; }
html[data-theme="cyber"]        { --bg-color: #000000; --text: #b1b2ff; --accent: #d946ef; }
html[data-theme="midnight"]     { --bg-color: #000721; --text: #2c278f; --accent: #0064cf; }
html[data-theme="forest"]       { --bg-color: #000500; --text: #b2b2b2; --accent: #22c55e; }
html[data-theme="wine"]         { --bg-color: #0a0002; --text: #00ffff; --accent: #fb7185; }
html[data-theme="royal"]        { --bg-color: #020005; --text: #39ff14; --accent: #a855f7; }
html[data-theme="ocean"]        { --bg-color: #000205; --text: #ffff00; --accent: #0ea5e9; }
html[data-theme="coffee"]       { --bg-color: #1c120f; --text: #ffeeb0; --accent: #ffae00; }
html[data-theme="sunset"]       { --bg-color: #100019; --text: #ff5500; --accent: #ff0055; }
html[data-theme="solar"]        { --bg-color: #0b0502; --text: #773900; --accent: #d35400; }

/* * ================================================================================================
 * [SECTOR 03] BASE RESET & ATMOSPHERE
 * ================================================================================================
 */
html {
    background-color: #000000;
    height: 100%;
    overflow-x: hidden;
    overscroll-behavior-x: none;
}
body::before {
    content: ""; position: fixed; top: 0; left: 0; width: 100%; height: 100%!important;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.07'/%3E%3C/svg%3E");
    opacity: 0.4; pointer-events: none; z-index: 80; mix-blend-mode: overlay;
}
body {
    background-color: var(--bg-color);
    color: var(--text);
    font-family: var(--font-main);
    margin: 0; min-height: 100vh; overflow-x: hidden;
    overscroll-behavior-x: none;
    transition: background-color 0.5s ease, color 0.3s ease;
}

/* Atmosphere */
.ambient-glow { position: fixed; top: -20%; left: 20%; width: 60%; height: 0%; background: radial-gradient(circle, var(--accent) 0%, transparent 70%); opacity: 0.12; filter: blur(80px); z-index: -1; pointer-events: none; transition: background 0.5s ease; }
.void-vignette { position: fixed; height:100dvh !important; inset: 0; pointer-events: none; z-index: 90; background: linear-gradient(90deg, #000000 0%, rgba(0,0,0,0.9) 10%, rgba(0,0,0,0) 25%, rgba(0,0,0,0) 75%, rgba(0,0,0,0.9) 90%, #000000 100%); opacity: 0.5; }

main, .nexus-container, .reader-container, .stream-container, .control-hub, .workspace-container, .settings-container, .pricing-container { position: relative; z-index: 95; }
.navbar { z-index: 100; }
.stream-container { position: relative; z-index: 1; }

.page-title {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin: -3rem 0 2.4rem 0;  
    color: var(--accent);
    text-shadow: 0 0 30px rgba(var(--accent-rgb), 0.3);
}

body {
    min-height: 100vh;
    min-height: 100dvh;
}

/* * ================================================================================================
 * [SECTOR 04] GLASSMORPHISM & UTILITY
 * ================================================================================================
 */
.glass { background: var(--glass-bg); backdrop-filter: blur(var(--blur)); -webkit-backdrop-filter: blur(var(--blur)); border-bottom: var(--glass-border); }
.glass-btn { background: rgba(var(--card-rgb), 0.5); border: var(--glass-border); color: var(--text); backdrop-filter: blur(8px); border-radius: var(--radius-sm); padding: 8px 16px; cursor: pointer; display: flex; align-items: center; gap: 8px; font-size: 0.85rem; transition: var(--transition); }
.glass-btn:hover { background: rgba(var(--card-rgb), 0.8); border-color: var(--accent); }
.hidden { display: none !important; }

/* * ================================================================================================
 * [SECTOR 05] TOP NAVIGATION
 * ================================================================================================
 */
/* [SECTOR 05] TOP NAVIGATION (iOS SAFE AREA AWARE) */
.navbar {
    position: fixed;
    /* [CORREÇÃO] Respeita a área segura do iPhone (Notch/Ilha) */
    top: max(20px, env(safe-area-inset-top));
    left: 50%;

    transform: translateX(-50%) translateZ(0);
    z-index: 9999;

    width: 82%;
    max-width: 400px;
    height: 57px !important;

    padding: 0 17px;
    border-radius: 32px;

    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur));
    -webkit-backdrop-filter: blur(var(--blur));
    border: 1px solid var(--nav-border-color);

    display: flex;
    justify-content: space-between;
    align-items: center;

    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    overflow: visible !important;

    /* [FIX] Allow button clicks without stopping page scroll */
    /* manipulation = allows pan/pinch but removes 300ms delay */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 1.25rem; letter-spacing: -0.5px; transform-style: preserve-3d; margin-left: 4px; }
.brand > * { isolation: isolate; transform: translateZ(0); will-change: transform, filter, opacity; }
.brand span { cursor: pointer; user-select: none; transition: all 0.3s ease; color: var(--primary-logo) !important; }
.brand span:hover { opacity: 0.8; text-shadow: 0 0 15px var(--accent); }

.logo-icon { width: 37px; height: 37px; margin-right: -7px; position: relative; top: -1.5px; display: block; cursor: default; transition: all 0.3s ease; will-change: transform, filter; }

.nav-tools { 
    position: relative;
    display: flex; 
    align-items: center; 
    height: 100%;       
    gap: 0.8rem; 
    
    /* [CORREÇÃO CRÍTICA] */
    /* Tem de ser superior ao 150 do .library-controls-container */
    z-index: 200 !important; 
    
    /* [TRUQUE DE FANTASMA] */
    /* Deixa os cliques passarem através do vazio para chegar à lista em baixo */
    pointer-events: none;
}

.nav-tools > * {
    pointer-events: auto;
    /* [INSTANT RESPONSE] Click without stopping scroll */
    touch-action: manipulation;
}

#switch-btn {
    margin: 0 !important;
    top: auto !important;
    left: auto !important;
    transform-origin: center center;
    position: relative;
    z-index: 500 !important;
}

/* Separador Vertical */
.separator { 
    width: 1px; 
    height: 20px; /* Altura controlada */
    background: rgba(255,255,255,0.1); 
    margin: 0 4px; 
}
.tool-wrapper { 
    position: relative; 
    display: flex;          /* [FIX 1] Flex garante centro */
    align-items: center;    /* [FIX 1] Centro vertical */
    justify-content: center;
    height: 40px;           /* Altura fixa igual aos botões */
    width: 40px;            /* Largura fixa */
}
.nav-btn { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); color: var(--text); padding: 5px 10px; font-size: 0.8rem; border-radius: var(--radius-sm); cursor: pointer; display: flex; align-items: center; gap: 8px; }
.nav-btn:hover { background: rgba(255,255,255,0.1); border-color: var(--accent); }

/* [SECTOR 05] TOP NAVIGATION - AUTH MENU */

#auth-menu {
    width: 220px;     
    min-width: 200px;   
    max-height: 500px;  
}
.auth-header { font-size: .9rem; font-weight: 700; margin-bottom: 1rem; text-align: center; color: var(--text); }
.auth-input { width: 100%; padding: 10px; margin-bottom: 10px; background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.1); border-radius: 6px; color: #fff; font-family: var(--font-main); font-size: 0.85rem; box-sizing: border-box; transition: 0.3s; }
.auth-input:focus { outline: none; border-color: var(--accent); }
.submit-btn { width: 100%; padding: 10px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); color: rgba(255,255,255,0.7); border-radius: 6px; font-weight: 600; cursor: pointer; margin-top: 5px; transition: 0.3s; font-size: 0.85rem; }
.submit-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.auth-switch { text-align: center; margin-top: 10px; font-size: 0.75rem; opacity: 0.6; }
.auth-switch span { color: var(--accent); cursor: pointer; font-weight: 600; text-decoration: underline; margin-left: 4px; }


/* * ================================================================================================
 * [SECTOR 06] HEADER SEARCH FIELD & FILTER DROPDOWN
 * ================================================================================================
 */

/* Search field - hidden by default */
#header-search-field {
    display: none;
    align-items: center;
    flex: 1;
    position: relative;
    height: 100%;
    padding: 0 5px;
    gap: 6px;
}

#header-search-field.hidden {
    display: none !important;
}

/* When search is active via body class */
body.search-mode .brand {
    display: none !important;
}

body.search-mode #switch-btn {
    display: none !important;
}

body.search-mode #header-search-field {
    display: flex !important;
}

/* Close button */
.search-close-btn {
    background: transparent;
    border: none;
    padding: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--text);
    opacity: 0.5;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.search-close-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

#header-search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    font-family: var(--font-main);
    font-size: 15px;
    padding: 0;
    padding-left: 20px;
    min-width: 0;
    height: 100%;
    /* Cursor azul como o do chat */
    caret-color: #0b84fe;
}

#header-search-input::placeholder {
    color: #8e8e93;
    opacity: 1;
}

/* Search Input Display - cursor personalizado */
#search-input-display {
    flex: 1;
    display: flex;
    align-items: center;
    position: relative;
    height: 100%;
    padding-left: 20px;
    min-width: 0;
    overflow: hidden;
}

.search-text-content {
    color: var(--text);
    font-family: var(--font-main);
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-text-content.empty::before {
    content: attr(data-placeholder);
    color: var(--text);
    opacity: 0.4;
}

/* Cursor piscante da pesquisa */
.search-cursor {
    display: inline-block;
    width: 2px;
    height: 18px;
    background: #0b84fe;
    margin-left: 2px;
    animation: search-blink-caret 1s step-end infinite;
    flex-shrink: 0;
    vertical-align: middle;
    order: 1;
}

/* Cursor à esquerda quando vazio (antes do placeholder) */
.search-text-content.empty ~ .search-cursor {
    order: -1;
    margin-left: 0;
    margin-right: 2px;
}

@keyframes search-blink-caret {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Esconde cursor quando não está em foco */
#header-search-field:not(.focused) .search-cursor {
    display: none;
}

.filter-arrow-btn {
    background: transparent;
    border: none;
    padding: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    color: var(--text);
    opacity: 0.5;
}

.filter-arrow-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

.filter-arrow-btn svg {
    stroke: currentColor;
    transition: transform 0.3s ease;
}

.filter-arrow-btn.open svg {
    transform: rotate(180deg);
}

/* Filter Dropdown Menu */
.filter-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    width: 220px;
    background: rgba(15, 15, 18, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 14px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
    z-index: 10000;
    opacity: 1;
    visibility: visible;
    transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.filter-dropdown.hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(-10px);
    pointer-events: none;
}

.filter-section {
    margin-bottom: 12px;
}

.filter-section:last-child {
    margin-bottom: 0;
}

.filter-label {
    display: block;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.35);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.filter-values {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.filter-chip {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-main);
}

.filter-chip:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

.filter-chip.active {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}

.filter-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 12px 0;
}

/* Filter Range Slider */
.filter-range-wrapper {
    position: relative;
    width: 100%;
    height: 20px;
    display: flex;
    align-items: center;
}

.filter-track-bg {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.filter-track-fill {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 4px;
    background: var(--accent);
    border-radius: 2px;
    pointer-events: none;
}

.filter-range-wrapper input[type="range"] {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    pointer-events: none;
    margin: 0;
    padding: 0;
}

.filter-range-wrapper input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: #1a1a1a;
    border: 2px solid var(--accent);
    cursor: grab;
    pointer-events: auto;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    transition: transform 0.15s ease;
}

.filter-range-wrapper input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    background: var(--accent);
}

.filter-range-wrapper input[type="range"]::-moz-range-thumb {
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: #1a1a1a;
    border: 2px solid var(--accent);
    cursor: grab;
    pointer-events: auto;
}

.filter-range-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.3);
}

/* Partners Toggle Button */
.filter-toggle-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-main);
}

.filter-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.06);
}

.filter-toggle-btn.active {
    border-color: var(--accent);
    color: var(--accent);
}

.toggle-indicator {
    width: 32px;
    height: 18px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 9px;
    position: relative;
    transition: background 0.2s ease;
}

.toggle-indicator::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    transition: all 0.2s ease;
}

.filter-toggle-btn.active .toggle-indicator {
    background: var(--accent);
}

.filter-toggle-btn.active .toggle-indicator::after {
    left: 16px;
    background: #000;
}

/* Hide header search on mobile when library controls are shown */
body.mode-agenda #header-search-field {
    display: none;
}


/* * ================================================================================================
 * [SECTOR 07] CONTROL HUB & SEARCH PILL (LEGACY - KEEP FOR COMPATIBILITY)
 * ================================================================================================
 */

.search-bar-container {
    /* 1. LAYOUT & POSITION */
    position: relative;
    z-index: 101;
    display: flex;
    align-items: center;
    
    /* [AJUSTE] Altura aumentada para 40px (Padrão UI/Dock) */
    height: 40px; 
    padding: 0 10px; /* Padding limpo */
    
    /* 2. AESTHETICS */
    background: rgba(var(--card-rgb), 0.4);
    border-radius: 50px;
    border: var(--glass-border) !important;
    box-shadow: 0 7px 10px rgba(0,0,0,0.7);
    
    /* 3. ENGINE */
    overflow: visible !important; 
    transform: translateZ(0); 
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* HOVER STATE (ACTIVE INTERACTION) */
.search-bar-container:hover { 
    transform: scale(1.084); 
    border: 2px solid var(--accent) !important; 
    /* Merged shadow logic: likely want a subtle glow or clean look. 
       I kept the '0px' one as it seems to be your latest preference to avoid strong glow. 
       Change 0px to 15px if you want a glow. */
    box-shadow: 0 0 0px var(--accent) !important; 
    background: rgba(var(--card-rgb), 0.8); 
}

.search-bar-container:hover input { 
    font-size: 0.9em; 
}
 


#scope-trigger-btn {
    border-radius: 50px 0 0 50px !important; 
    margin-left: 0px; 
    padding-left: 12px;
}

#scope-trigger-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50px 0 0 50px !important; 
}

.control-hub { text-align: center; padding-top: 100px; max-width: 700px; margin: 0 auto; position: relative; z-index: 100; }

.input-wrapper { flex-grow: 1; display: flex; align-items: center; padding: 0 16px; color: var(--text); opacity: 0.8; }
.input-wrapper input { width: 100%; background: transparent; border: none; outline: none; color: var(--text); padding-left: 10px; font-size: 1rem; transition: font-size 0.3s; }
.actions-row { display: flex; justify-content: flex-end; margin-top: 1.2rem; margin-bottom: 1.3rem; max-width: 700px; margin-left: auto; margin-right: auto; padding: 0 4px; }

#sort-btn {
    color: var(--text) !important;
    opacity: 0.3; 
    border: 1px solid transparent; 
    background: transparent;
    transition: all 0.3s ease;
}

#sort-btn.active {
    opacity: 1;
    color: var(--accent) !important; 
    border-color: var(--accent);    
    background: rgba(var(--card-rgb), 0.1); 
    box-shadow: 0 0 15px rgba(var(--accent-rgb), 0.15); 
    transform: scale(1.02);
}

#scope-trigger-btn {
    border-radius: 50px 0 0 50px; 
    margin-left: -1px; 
}

#scope-trigger-btn:hover {
    background: rgba(255, 255, 255, 0.00); 
    border-radius: 50px 20px 20px 50px; 
}

/* * ================================================================================================
 * [SECTOR 08] POPUP MENUS
 * ================================================================================================
 */
.popover-menu { position: absolute; top: 100%; right: 0; background: var(--popover-bg); border: var(--glass-border); border-radius: var(--radius-lg); backdrop-filter: blur(30px); box-shadow: 0 20px 40px rgba(0,0,0,0.5); z-index: 99999 !important; transform-origin: top right; animation: popIn 0.2s cubic-bezier(0.1, 0.9, 0.2, 1); pointer-events: auto; }

.scope-selector { position: relative; height: 100%; display: flex; align-items: center; justify-content: center; border-right: 1px solid rgba(255,255,255,0.1); z-index: 102; }
.scope-trigger { background: transparent; border: none; padding: 0 16px; height: 100%; outline: none; cursor: pointer; font-weight: 600; font-family: var(--font-main); display: flex; align-items: center; justify-content: center; color: var(--text); opacity: 0.7; transition: opacity 0.3s ease, text-shadow 0.3s ease; }
.scope-trigger:hover { opacity: 1; text-shadow: 0 0 12px rgba(255,255,255,0.4); }

#scope-dropdown .scope-menu {
    position: absolute !important;
    top: 35px !important;    
    left: 25px !important;   
    right: auto !important;  
    width: 80px !important;
    min-width: 80px !important;
    max-width: 80px !important;
    padding: 8px 4px !important; 
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: rgba(21, 21, 21, 0.92) !important;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.8);
    backdrop-filter: blur(20px);
    z-index: 99999;
}
.scope-option { padding: 6px 10px; background: transparent; border: none; color: rgba(255,255,255,0.5); cursor: pointer; font-size: 0.85rem; transition: all 0.2s; text-align: center; display: flex; justify-content: center; align-items: center; opacity: 0; }
.scope-menu:not(.hidden) .scope-option { animation: waterfallDrop 0.3s cubic-bezier(0.3, 1.2, 0.2, 1) forwards; }
.scope-option.active { background: rgba(27, 27, 27, 0.8); border: 1px solid rgba(255,255,255,0.1); color: var(--accent); opacity: 1; font-weight: 600; box-shadow: none; border-radius: 6px; }

#current-scope-label {
    color: var(--accent) !important; 
    font-weight: 700; 
}

.scope-trigger svg {
    stroke: var(--accent)!important; 
    opacity: 1 !important;
}

/* * ================================================================================================
 * [SECTOR 10] FEED STREAM
 * ================================================================================================
 */

.stream-container { max-width: 1000px !important; margin: 0 auto 5rem; padding: 250px 1.5rem 180px; }

@keyframes infinity-zoom {
    0% { opacity: 0; transform: scale(2); }
    100% { opacity: 1; transform: scale(1); }
}

/* Em style.css */
@keyframes deep-arrival {
    0% { opacity: 0; transform: translateY(100px); } /* Sem scale() */
    100% { opacity: 1; transform: translateY(0); }   /* Sem scale() */
}

/* Loading screen - desativado (não necessário com zero-flash) */
#home-loading-screen {
    display: none !important;
}

.article-row {
    --shadow-y: 0;
    --focus-intensity: 0;

    box-shadow:
        0 calc(1px * var(--shadow-y)) 10px rgba(0, 0, 0, 1),
        0 0 calc(0px * var(--focus-intensity)) rgba(0, 255, 255, calc(0.5 * var(--focus-intensity))) !important;

    /* [FIX] Sem transição durante animação de entrada */
    transition: none;
    will-change: transform, box-shadow, opacity;

    /* [FIX] Esconde artigos por defeito até a animação começar */
    opacity: 0;
    visibility: hidden;
    /* [FIX] Posição inicial da animação Curved Slide - evita flash */
    transform: scale(0.1) translate(900px, 200px) translateZ(0);

    /* Mantém as propriedades base originais da classe .article-row abaixo */
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 0.9rem 1.22rem 1.02rem;
    margin: 0 auto 1rem auto;
    width: 97%;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--card-border-color);
    border-radius: var(--radius-lg);
    transform-style: preserve-3d;
    backface-visibility: hidden;
}

/* [FIX] Após animação de entrada, suaviza transições durante scroll */
.kinetic-awake .article-row {
    transition: transform 0.08s linear, opacity 0.08s linear !important;
}


/* Remove conflito de foco nativo */

.article-row:focus,

.article-row:focus-visible {

    border: none !important;

    outline: none !important;

}

/* Estado expandido - aumenta padding */
.article-row[data-expanded="true"] {
    padding: 0.99rem 1.25rem 1.12rem;
}

/* Profile Signal Unit Styles (matching article-row) */
.profile-signal-unit {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    margin-bottom: 1.5rem;
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--card-border-color);
    border-radius: var(--radius-lg);
    transform-style: preserve-3d;
    backface-visibility: hidden;
    cursor: pointer;
    /* Shadow - slightly lighter */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7);
    transition: box-shadow 0.1s linear, transform 0.1s linear, opacity 0.3s ease;
    will-change: transform, box-shadow, opacity;
}

.profile-signal-unit:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.8);
}

.p-signal-content {
    display: flex;
    flex-direction: column;
}

.p-signal-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
    margin-bottom: 0.5rem;
}

.p-signal-meta {
    font-size: 0.8rem;
    opacity: 0.5;
    transition: margin-top 0.3s ease;
}

.arrival-stage {
    opacity: 0;
    transform: translateY(100px) scale(0.9);
    animation: stage-entry 1.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes stage-entry {
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.middle-article {
    transform: translateY(0);
    will-change: transform;
    transition: transform 1.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.middle-article.gravity-on {
    animation: zero-gravity 6s ease-in-out infinite;
}

@keyframes zero-gravity {
    0% { transform: translateY(0); }
    50% { transform: translateY(-15px); } 
    100% { transform: translateY(0); }
}

.article-content { display: flex; flex-direction: column; width: 100%; cursor: pointer; }

.article-title { font-size: 1.1rem; font-weight: 600; margin: 0 0 0.5rem 0; }

.article-meta { font-size: .8rem; opacity: 0.5; }

.meta-author-link {
    color: #888;
    font-weight: 600;
}

.article-author-corner { position: absolute; bottom: 8px; right: 16px; font-size: 0.8rem; font-weight: 400; opacity: 0.7; color: var(--accent); text-shadow: 0 0 5px var(--accent); border-radius: 0; border: none; background: transparent; }



/* * ================================================================================================
 * [SECTOR 11] READER MODE & OTHER PAGES
 * ================================================================================================
 */
.reader-container { max-width: 900px; margin: 0 auto; padding: 2rem 1rem 5rem; }
.reader-content { padding: 3rem; border-radius: var(--radius-lg); animation: fadeIn 0.5s ease; position: relative; }
.reader-header h1 { font-size: 2.5rem; margin: 1rem 0; line-height: 1.2; letter-spacing: -1px; color: var(--text); }
.meta-row, .reader-meta-subtitle { font-size: 0.85rem; color: #888; display: flex; align-items: center; gap: 8px; text-transform: uppercase; letter-spacing: 1px; }
.reader-divider { border: 0; height: 1px; background: rgba(255,255,255,0.1); margin: 2rem 0; }
.reader-body { font-size: 1.15rem; line-height: 1.8; color: var(--text); white-space: pre-wrap; font-family: 'Plus Jakarta Sans', sans-serif; text-align: left; }

/* Reader Edit Mode - Lock all styles to prevent layout shift */
body.reader-edit-mode #reader-title[contenteditable="true"],
body.reader-edit-mode #reader-body[contenteditable="true"] {
    background: transparent !important;
    outline: none !important;
    border: none !important;
    padding: 0 !important;
    margin: inherit !important;
    box-shadow: none !important;
    caret-color: var(--accent);
    -webkit-appearance: none !important;
    appearance: none !important;
    -webkit-user-modify: read-write-plaintext-only;
}

body.reader-edit-mode #reader-title[contenteditable="true"]:focus,
body.reader-edit-mode #reader-body[contenteditable="true"]:focus {
    background: transparent !important;
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}

/* Ensure title keeps its original margin */
body.reader-edit-mode .reader-header h1[contenteditable="true"] {
    margin: 1rem 0 !important;
}

/* Extra padding top in edit mode */
body.reader-edit-mode .reader-container {
    padding-top: 3rem !important;
}


/* * ================================================================================================
 * [SECTOR 12] OBSIDIAN DOCK & THE ARCHITECT BUTTON (V2.1 - VISIBILITY PATCH)
 * ================================================================================================
 */

/* No ficheiro style.css, substitui o bloco .obsidian-nav por este: */

.obsidian-nav {
    position: fixed;
    left: 50%;
    bottom: 20px;

    /* [ESTABILIDADE FÍSICA] */
    transform: translate3d(-50%, 100%, 0);
    will-change: transform;

    width: 91%;
    max-width: 400px;
    height: 57px;

    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--nav-border-color);
    border-radius: 32px;

    display: none;
    justify-content: space-evenly;
    align-items: center;
    gap: 8px; /* Espaçamento entre ícones */

    /* [LAYER NUCLEAR] Z-Index Máximo + Isolamento */
    z-index: 2147483647 !important;
    isolation: isolate;

    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.4s ease;
    opacity: 0;

    /* [TOUCH] manipulation allows buttons to respond without 300ms delay */
    touch-action: manipulation;

    /* Garante captura de eventos */
    pointer-events: auto !important;

    /* Remove highlight nativo */
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

/* Estado Visível */
body.user-logged-in .obsidian-nav {
    display: flex !important;
    opacity: 1;
    transform: none;
}

/* Hide dock when chat keyboard is open */
body.user-logged-in .obsidian-nav.dock-hidden {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Hide dock automatically when ANY keyboard is open */
body:has(#chatKeyboard.open) .obsidian-nav {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Hide dock and custom keyboard when NATIVE keyboard is open */
/* EXCEÇÃO: Não esconder quando a agenda avançada está aberta (inline form) */
.obsidian-nav.native-kb-hidden,
#chatKeyboard.native-kb-hidden,
body.native-keyboard-open:not(.agenda-open) .obsidian-nav,
body.native-keyboard-open:not(.agenda-open) #chatKeyboard {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Hide dock when editing in reader mode (keyboard open) */
body.reader-edit-mode:has(#reader-body:focus) .obsidian-nav,
body.reader-edit-mode:has(#reader-title:focus) .obsidian-nav {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* 3. Nav Items */
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--accent) !important;
    opacity: 1;
    transition: all 0.3s ease;
    width: 50px;
    position: relative;

    /* [INSTANT RESPONSE] manipulation removes 300ms tap delay */
    touch-action: manipulation;

    /* [ANTI-SELECTION] Previne todos os efeitos de seleção/highlight */
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    outline: none !important;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;

    /* [CLEAN] Remove any background/border */
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.nav-item *,
.nav-item *::before,
.nav-item *::after {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    outline: none !important;
}

/* [NUCLEAR CLEAN] Reset EVERYTHING on nav icons */
.nav-item:not(.hero-btn) {
    -webkit-tap-highlight-color: transparent !important;
    -webkit-touch-callout: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

.nav-item:not(.hero-btn) .nav-icon {
    all: unset !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    -webkit-tap-highlight-color: transparent !important;
    -webkit-touch-callout: none !important;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.nav-item:not(.hero-btn) .nav-icon svg {
    width: 22.5px !important;
    height: 22.5px !important;
    stroke: var(--accent) !important;
    stroke-width: 2.1px !important;
    fill: none !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    -webkit-tap-highlight-color: transparent !important;
}

#products-normal-btn .nav-icon svg {
    width: 27px !important;
    height: 27px !important;
    stroke-width: 1.995px !important;
    transform: scaleX(1.11) !important;
}

#products-normal-btn.active .nav-icon svg {
    transform: translateY(-3px) scaleX(1.11) scale(1.13) !important;
}

.nav-item[data-target="view-home"] .nav-icon svg,
.nav-item[data-target="view-chat"] .nav-icon svg,
.nav-item[data-target="view-profile"] .nav-icon svg {
    stroke-width: 2.31px !important;
}

.nav-item[data-target="view-agenda"] .nav-icon svg {
    stroke-width: 2.205px !important;
}

.nav-item:focus,
.nav-item:focus-visible,
.nav-item:active {
    outline: none !important;
    -webkit-tap-highlight-color: transparent;
}

.nav-item .nav-icon svg {
    width: 22.5px;
    height: 22.5px;
    stroke-width: 2.1px;

    /* Transição suave */
    transition: transform 0.25s linear, stroke-width 0.25s linear !important;

    stroke: var(--accent) !important;
    transform-origin: center center;
    transform: translateY(-1px); /* Posição base */
}

.nav-label { display: none; } 

.nav-item.active {
    opacity: 1;
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}

.nav-item.active .nav-icon {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
    -webkit-tap-highlight-color: transparent !important;
}

/* Remove focus ring from nav items (links) */
.obsidian-nav a:focus,
.obsidian-nav a:focus-visible,
.obsidian-nav .nav-item:focus,
.obsidian-nav .nav-item:focus-visible {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
    -webkit-tap-highlight-color: transparent !important;
}

.nav-item.active .nav-icon svg {
    /* Posição final da animação: base (-1.05px) + subida (1px) = -2.05px */
    transform: translateY(-2.05px) scale(1.13) !important;
    stroke-width: 2.5px;
    stroke: var(--accent) !important;
    background: transparent !important;
    /* Nota: drop-shadow removido - causa quadrado escuro no Safari/iOS */
}

/* [FIX] Cubo (products) - compensar centro visual mais baixo */
.nav-item[data-target="view-products"].active .nav-icon svg {
    transform-origin: center 40%;
    transform: translateY(-1.65px) scale(1.13) !important; /* Sobe 0.4px menos que os outros */
}

/* [FIX] Casa (home) e Livro (agenda) - subir +0.4px e +3% tamanho quando ativos */
.nav-item[data-target="view-home"].active .nav-icon svg,
.nav-item[data-target="view-agenda"].active .nav-icon svg {
    transform: translateY(-2.45px) scale(1.16) !important; /* -2.05px - 0.4px extra, 1.13 + 0.03 scale */
}

/* Active icon uses text color when setting is enabled */
body.active-icon-accent .nav-item.active .nav-icon svg {
    stroke: var(--text) !important;
}

/* [FIX] Remove qualquer fundo/borda visível nos nav-items */
.nav-item,
.nav-item *,
.nav-item::before,
.nav-item::after,
.nav-item .nav-icon,
.nav-item .nav-icon::before,
.nav-item .nav-icon::after {
    background-color: transparent !important;
    -webkit-tap-highlight-color: rgba(0,0,0,0) !important;
    -webkit-touch-callout: none !important;
}

/* [SAFARI/iOS FIX] Remove tap highlight e focus outline nos nav-items */
/* Fonte: https://css-tricks.com/snippets/css/remove-gray-highlight-when-tapping-links-in-mobile-safari/ */
.obsidian-nav,
.obsidian-nav *,
.obsidian-nav *::before,
.obsidian-nav *::after {
    -webkit-tap-highlight-color: rgba(0,0,0,0) !important;
    -webkit-tap-highlight-color: transparent !important;
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    user-select: none !important;
}

.obsidian-nav .nav-item,
.obsidian-nav .nav-item:hover,
.obsidian-nav .nav-item:active,
.obsidian-nav .nav-item:focus,
.obsidian-nav .nav-item:focus-visible,
.obsidian-nav .nav-item.active,
.obsidian-nav a,
.obsidian-nav a:hover,
.obsidian-nav a:active,
.obsidian-nav a:focus,
.obsidian-nav a:focus-visible {
    background: none !important;
    background-color: transparent !important;
    background-image: none !important;
    border: none !important;
    border-color: transparent !important;
    outline: none !important;
    outline-width: 0 !important;
    outline-style: none !important;
    outline-color: transparent !important;
    box-shadow: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    text-decoration: none !important;
}

/* [SAFARI SVG FIX] */
.obsidian-nav .nav-item .nav-icon,
.obsidian-nav .nav-item .nav-icon svg {
    background: transparent !important;
    background-color: transparent !important;
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}

.obsidian-nav .nav-item .nav-icon svg,
.obsidian-nav .nav-item .nav-icon svg path,
.obsidian-nav .nav-item .nav-icon svg rect,
.obsidian-nav .nav-item .nav-icon svg circle,
.obsidian-nav .nav-item .nav-icon svg line {
    fill: transparent !important;
    background: transparent !important;
}

/* 4. Hero Button */
.nav-item.hero-btn {
    opacity: 1 !important;
    overflow: visible;
    width: 60px;
    height: 60px;
    background: transparent;
    border-radius: 50%;
    transform: translateY(-25px);
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* [SECTOR 12] HERO BUTTON CORE */
.nav-item.hero-btn .nav-icon-hero {
    width: 45px;
    height: 45px;
    background: var(--glass-bg) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.6px solid var(--nav-border-color);

    border-radius: var(--radius-sm);

    /* SHADOW PROTOCOL: VETOR CORRIGIDO PARA ROTAÇÃO 45º */
    /* -4px (Esq) + -4px (Cima) = Sombra no Canto Superior Esquerdo */
    /* Quando o botão roda 45º, este canto torna-se o TOPO absoluto */
    box-shadow: 2px 2.5px 7px rgba(0,0,0,0.9) !important;

    transform: rotate(45deg);
    transition: 0.3s;

}

.nav-item.hero-btn .nav-icon-hero svg {
    stroke: var(--accent) !important;
    transform: rotate(-45deg);
    width: 26px;
    height: 26px;
    stroke-width: 2.3px;
}

.nav-item.hero-btn:hover .nav-icon-hero {
    transform: rotate(45deg) scale(1.05);
    border-color: var(--accent);
    box-shadow: 0 0 15px rgba(var(--accent-rgb), 0.2);
    background: var(--glass-bg) !important;
}

.nav-item.hero-btn.active {
    transform: translateY(-26.5px);
}

.nav-item.hero-btn.active .nav-icon-hero {
    border: 1.73px solid var(--nav-border-color);
}

.nav-item.hero-btn.active .nav-icon-hero svg {
    shadow: 50%;
    stroke-width: 3px;
    width: 28px;
    height: 28px;
}

/* 5. EFEITO DE DIMMING (Quando menus abrem por cima) */
.dock-dimmed {
    opacity: 0.4 !important;
    filter: blur(4px);
    pointer-events: none;
    transform: translateX(-50%) translateY(10px) !important;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ============================================
   SPLIT DOCK MODE (GitHub-style)
   ============================================ */

/* Dock Container - wraps both dock elements */
.dock-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2147483647 !important;
    display: none;
    justify-content: center;
    align-items: center;
    gap: 65px;
    pointer-events: none;

    /* Same width as header (.navbar) */
    width: 92%;
    max-width: 480px;
}

body.user-logged-in .dock-container {
    display: flex;
}

/* Unified mode (default): dock inside container */
body:not(.split-dock-mode) .dock-container .obsidian-nav {
    position: static !important;
    left: auto !important;
    bottom: auto !important;
    transform: none !important;
    pointer-events: auto;
    width: 100%;
    max-width: none;
}

/* Unified mode: hide floating chat, show inline chat */
body:not(.split-dock-mode) .nav-floating-chat {
    display: none !important;
}

body:not(.split-dock-mode) .nav-item-chat-unified {
    display: flex !important;
}

/* ===== SPLIT DOCK MODE ===== */

/* Split dock mode: show floating chat, hide inline chat */
body.split-dock-mode .nav-item-chat-unified {
    display: none !important;
}

body.split-dock-mode .nav-floating-chat {
    display: flex !important;
}

/* Main dock adjustments for split mode - reset ALL positioning */
body.split-dock-mode .dock-container .obsidian-nav {
    position: static !important;
    left: auto !important;
    bottom: auto !important;
    transform: none !important;
    flex: 0 0 auto;
    width: auto !important;
    max-width: none !important;
    padding: 0 17px;
    pointer-events: auto;
    margin: 0;
}

/* Floating Chat Button */
.nav-floating-chat {
    display: none;
    align-items: center;
    justify-content: center;
    width: 57px;
    height: 57px;
    min-width: 57px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--nav-border-color);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    text-decoration: none;
    pointer-events: auto;
    transition: all 0.3s ease;

    /* Anti-selection - NUCLEAR */
    -webkit-tap-highlight-color: transparent !important;
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
    touch-action: manipulation;
    outline: none !important;
    -webkit-user-drag: none !important;
}

/* Bloqueia seleção em TODOS os elementos internos do botão do chat */
.nav-floating-chat *,
.nav-floating-chat *::before,
.nav-floating-chat *::after {
    -webkit-tap-highlight-color: transparent !important;
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    user-select: none !important;
    outline: none !important;
}

.nav-floating-chat .nav-icon {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    pointer-events: none;
}

.nav-floating-chat .nav-icon svg {
    width: 24px !important;
    height: 24px !important;
    stroke: var(--accent) !important;
    stroke-width: 2px !important;
    fill: none !important;
    transform-origin: center center;
    transform: translateY(0.9px); /* Posição base */
    transition: transform 0.3s ease-out, stroke-width 0.3s ease-out !important;
}

.nav-floating-chat:active {
    transform: scale(0.95);
}

.nav-floating-chat.active {
    transform: scale(1.04);
    transition: transform 0.3s ease-out !important;
}

.nav-floating-chat.active .nav-icon svg {
    stroke-width: 2.5px !important;
    transform: translateY(-0.1px) scale(1.03) !important; /* Sobe 1px quando ativo, -3% scale */
}

/* Active icon accent for floating chat - sempre usa --text quando chat ativo */
body.active-icon-accent .nav-floating-chat.active .nav-icon svg {
    stroke: var(--text) !important;
}

/* Hide dock container when keyboard is open */
/* EXCEÇÃO: Não esconder quando a agenda avançada está aberta (inline form) */
body:has(#chatKeyboard.open) .dock-container,
body.native-keyboard-open:not(.agenda-open) .dock-container {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Dock dimmed state for split dock */
body.split-dock-mode .dock-dimmed {
    transform: translateY(10px) !important;
}

.nav-floating-chat.dock-dimmed {
    opacity: 0.4 !important;
    filter: blur(4px);
    pointer-events: none;
    transform: translateY(10px) !important;
}

/* ============================================
   END SPLIT DOCK MODE
   ============================================ */

/* * ================================================================================================
 * [SECTOR 13] MAGIC & RESPONSIVE
 * ================================================================================================
 */
#magic-mini-menu { 
    display: none !important; 
    position: absolute; 
    top: 125%; left: 50%; transform: translateX(-50%); width: 140px; background: rgba(20, 20, 25, 0.95); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 12px; padding: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.9); backdrop-filter: blur(10px); z-index: 999; flex-direction: column; gap: 8px; opacity: 0; visibility: hidden; pointer-events: none; transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); 
}

.magic-header { display: flex; justify-content: space-between; align-items: center; font-size: 0.65rem; font-weight: 700; letter-spacing: 1px; color: rgba(255,255,255,0.4); }
#magic-kill-switch { display: none !important; }
.magic-slider-wrapper input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; background: var(--accent); border-radius: 50%; box-shadow: 0 0 5px var(--accent); }

.logo-icon, .brand span, .page-title, .article-title, h1, 
#p-avatar, .meta-read-time-tag, .metric-label-text, 
a:not(.nav-item), .icon-only-btn, .icon-only-btn svg {
    stroke: var(--accent) !important; 
    fill: none !important; 
    transition: stroke 0.2s ease, opacity 0.2s ease;
}

.logo-icon svg { stroke: var(--accent) !important; }

body, p, h2, h3, .article-meta, .nav-btn, .scope-trigger, .glass-btn, input, .author-row {
    color: var(--text) !important;
    border-color: var(--text);
}
.nav-btn svg { stroke: var(--text) !important; }

@media (max-width: 600px) {
    .reader-content { padding: 1.5rem; }
    .reader-header h1 { font-size: 1.8rem; }
    .magic-text-dropdown-container, #magic-text-trigger { display: none !important; }
}
@media (max-width: 549px) { #upload-btn-wrapper { display: none !important; } main { transform: scale(0.92); transform-origin: top center; } }
@media (max-width: 400px) { .obsidian-nav { width: 95%; bottom: 10px; height: 65px; } }
@media (max-width: 380px) { .nav-item.hero-btn .nav-icon { width: 40px; height: 40px; margin-bottom: 20px; } }

/* * ================================================================================================
 * [SECTOR 15] BIO-MECHANICS (4-LIMB CHAOS)
 * ================================================================================================
 */
.bio-limb { transform-origin: 50px 80px; will-change: transform; }
.limb-top-left { animation: bio-twitch 7.1s ease-in-out infinite; }
.limb-top-right { animation: bio-twitch 8.3s ease-in-out infinite reverse; }
.limb-btm-left { animation: bio-twitch 6.7s ease-in-out infinite; animation-delay: 0.2s; }
.limb-btm-right { animation: bio-twitch 7.7s ease-in-out infinite reverse; animation-delay: 0.5s; }

@keyframes bio-twitch {
    0%   { transform: rotate(0deg); }
    12%  { transform: rotate(2deg); }   
    24%  { transform: rotate(0deg); }   
    35%  { transform: rotate(-1.5deg);} 
    45%  { transform: rotate(0deg); }   
    60%  { transform: rotate(1.5deg); }   
    72%  { transform: rotate(2.5deg); } 
    85%  { transform: rotate(-2deg); }  
    100% { transform: rotate(0deg); }
}

#btn-connect-action { opacity: 0; transform: translateY(10px); pointer-events: none; transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
#btn-connect-action.verified { opacity: 1; transform: translateY(0); pointer-events: auto; }



/* * ================================================================================================
 * [SECTOR 98] STAR DROPDOWN (NAVBAR TWIN)
 * ================================================================================================
 */
#star-dropdown {
    position: fixed !important;
    top: 70px !important;
    right: 15% !important; 
    z-index: 2147483647 !important; 
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none; 
    background: rgba(15, 15, 20, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 20px 50px rgba(0,0,0,0.8);
    border-radius: 20px;
    padding: 10px;
    min-width: 180px;
    transition: all 0.2s ease;
}

#star-dropdown.visible {
    opacity: 1 !important;
    transform: translateY(0) !important;
    pointer-events: auto !important; 
    display: flex !important;
    flex-direction: column;
    gap: 5px;
}

.dropdown-item {
    position: relative;
    z-index: 2147483648 !important; 
    pointer-events: auto !important;
    cursor: pointer !important;
    background: transparent;
    padding: 10px 15px;
    border-radius: 12px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255,255,255,0.5);
}

.dropdown-item:hover {
    background: rgba(255,255,255,0.1);
}

.dropdown-item:active {
    color: var(--text) !important;
    background: rgba(255, 255, 255, 0.1) !important;
    transform: scale(0.98);
    transition: none; 
}

.dropdown-item:active svg {
    stroke: rgba(255,255,255,0.5) !important;
}  

.dropdown-divider {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 4px 8px;
}

/* * ================================================================================================
 * [SECTOR 99] BOOT SCREEN
 * ================================================================================================
 */
#boot-screen { position: fixed; inset: 0; background-color: #000000; z-index: 999999; display: flex; justify-content: center; align-items: center; transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1); pointer-events: all; }
#boot-screen.vanish { opacity: 0; pointer-events: none; }
#boot-screen::after { content: ''; width: 40px; height: 40px; border: 2px solid rgba(255,255,255,0.1); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }

/* * ================================================================================================
 * [SECTOR 99] COMPOSE MODAL
 * ================================================================================================
 */
#compose-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(5px);
    z-index: 10000;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
#compose-overlay.active { opacity: 1; pointer-events: all; }

.compose-glass {
    width: 100%; max-width: 500px;
    background: var(--glass-bg);
    border: 1px solid var(--accent);
    box-shadow: 0 0 30px rgba(var(--accent-rgb), 0.2);
    border-radius: 24px; padding: 24px;
    transform: translateY(20px); transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
#compose-overlay.active .compose-glass { transform: translateY(0); }

.compose-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.compose-header h3 { margin: 0; color: var(--accent); font-size: 1.2rem; }
#close-compose { background: transparent; border: none; color: var(--text); cursor: pointer; opacity: 0.7; }
#close-compose:hover { opacity: 1; transform: rotate(90deg); transition: 0.3s; }

.compose-input, .compose-textarea {
    width: 100%; background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1); border-radius: 12px;
    padding: 12px; margin-bottom: 12px;
    color: var(--text); font-family: var(--font-main);
    outline: none; transition: 0.3s;
}
.compose-input:focus, .compose-textarea:focus { border-color: var(--accent); }
.compose-textarea { min-height: 120px; resize: none; }

.compose-actions { display: flex; justify-content: flex-end; }
.compose-actions .glass-btn { 
    background: var(--accent); color: #000; border: none; 
    display: flex; gap: 8px; align-items: center; padding: 10px 20px; 
}
.compose-actions .glass-btn:hover { box-shadow: 0 0 15px var(--accent); }


/* ================================================================================================
 * [SECTOR 99] SMART BUTTON - UNIFIED STYLES
 * ================================================================================================ */

/* Base Smart Button */
#smart-btn {
    margin: 0 !important;
    top: auto !important;
    left: auto !important;
    transform-origin: center center;
    position: relative;
    z-index: 500 !important;
    background: transparent;
    border: none;
    padding: 0;
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
}

/* Smart Button Wrapper */
#smart-btn-wrapper,
.tool-wrapper:has(#smart-btn) {
    z-index: 500 !important;
    position: relative;
}

/* Avatar Glow (inner circle) */
#smart-btn .avatar-glow {
    width: 35px;
    height: 35px;
    background: transparent;
    border: 2px solid var(--accent);
    border-radius: 50%;
    box-shadow: none;
    transition: box-shadow 0.3s ease;
    position: relative;
    z-index: 10;
    pointer-events: none;
}

#smart-btn:hover .avatar-glow {
    box-shadow: 0 0 0px var(--accent), 0 0 0px var(--accent), 0 0 0px var(--accent);
}

/* Gradient User Button Variant */
#smart-btn.gradient-user-btn {
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    background: transparent !important;
    box-shadow: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: none !important;
    padding: 0 !important;
    z-index: 1500;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}

#smart-btn.gradient-user-btn svg {
    stroke: white !important;
    width: 20px;
    height: 20px;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
    transition: transform 0.4s ease !important;
}

#smart-btn.gradient-user-btn:hover {
    transform: scale(1);
    box-shadow: none !important;
}

#smart-btn.gradient-user-btn.active {
    transform: scale(0.1);
    filter: brightness(0.8);
    box-shadow: 0 0 1px rgb(252, 253, 255) !important;
}

/* --- LOGO KINETICS --- */
.logo-icon {
    transform-origin: center center;
    cursor: pointer;
    will-change: transform;
    transition: transform 1s ease-out, filter 1s ease;
}

.logo-icon svg {
    animation: logo-breathe 5s ease-in-out infinite;
    transform-origin: center center;
    display: block; 
}

.logo-implode {
    transform: scale(0.7) !important;
    filter: drop-shadow(0 0 0px var(--accent));
    transition: transform .3s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}

.logo-explode {
    transform: scale(2.1) !important;
    filter: drop-shadow(0 0 0px var(--accent));
    transition: transform .5s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

@keyframes logo-breathe {
    0%, 100% { transform: scale(1); opacity: 0.9; }
    50% { transform: scale(1.2); opacity: 1; }
}

.logo-tap {
    transform: scale(0.85) !important; 
    transition: transform .18s ease;
}


/* --- FOCUS OVERLAY (Login Focus) --- */
#focus-overlay {
    position: fixed; 
    inset: 0; 
    width: 100%; 
    height: 100%;
    background: rgba(0, 0, 0, 0.5); 
    z-index: 9998; 
    opacity: 0; 
    pointer-events: none; 
    transition: opacity 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    backdrop-filter: blur(2px); 
}

#focus-overlay.active {
    opacity: 1;
    pointer-events: auto; 
}

.nav-dimmed {
    opacity: 0.5 !important;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* [CORREÇÃO FINAL: REMOÇÃO DE REGRAS DUPLICADAS AQUI] */
/* A regra que escondia a dock foi removida desta secção. */

.dock-dimmed {
    opacity: 0.4 !important;      
    filter: blur(4px);            
    pointer-events: none;         
    transform: translateX(-50%) translateY(10px) !important; 
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@media screen and (max-width: 768px) {
    input[type="text"], 
    input[type="email"], 
    input[type="password"], 
    input[type="search"], 
    input[type="number"],
    textarea, 
    select,
    .auth-input, 
    .kinetic-input, 
    .cortex-search, 
    .compose-input, 
    .compose-textarea,
    .chat-input {
        font-size: 16px !important;
    }
}

#search-input {
    /* [AJUSTE] Dimensão igual à da Dock (16px / 1rem) */
    font-size: 16px !important; 
    
    color: var(--text) !important; 
    opacity: 1 !important;         
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    font-family: var(--font-main);
}

#search-input::placeholder {
    color: #8e8e93;
    opacity: 1;
    font-size: 16px !important; /* Placeholder sincronizado */
}

.time-filter-wrapper { 
    position: relative; 
    height: 100%; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    border-left: 1px solid rgba(255,255,255,0.1); 
}

.icon-only-btn { 
    background: transparent; 
    border: none; 
    padding: 0 16px; 
    cursor: pointer; 
    color: var(--text); 
    opacity: 0.7; 
    transition: 0.2s; 
    display: flex; 
    align-items: center; 
}
.icon-only-btn:hover { opacity: 1; filter: drop-shadow(0 0 5px var(--text)); }

/* * ================================================================================================
 * [MOTOR DO SLIDER DUPLO]
 * ================================================================================================
 */

.titanium-menu {
    width: 205px !important;      
    min-height: 70px !important; 
    max-height: 40px !important;
    height: 40px !important;
    position: absolute;
    right: 10px;      
    top: 40px;         
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important; 
    gap: 18px;        
    padding: 24px;     
    border: 1px solid rgba(255,255,255,0.15);
    box-shadow: 0 30px 40px rgba(0,0,0,0.6)!important; 
    border-radius: 31px !important; 
    backdrop-filter: blur(15px) !important;
    z-index: 1000;
    background: rgba(21, 21, 21, 0.84) !important;
}

.range-wrapper {
    width: 100% !important;
    margin: 7px 0 !important;
}

.titanium-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    width: 100%;
}

.titanium-label { 
    font-size: 0.65rem; 
    font-weight: 700; 
    letter-spacing: 1.5px; 
    color: rgba(255,255,255,0.4); 
    text-transform: uppercase; 
}

.titanium-values { 
    font-family: 'Plus Jakarta Sans', sans-serif; 
    font-size: 0.8rem; 
    color: var(--accent); 
    font-weight: 700; 
}

.titanium-footer {
    display: flex;
    justify-content: space-between;
    width: 105%;
    margin-top: 0px;
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(255,255,255,0.3); 
}

#time-filter-menu, 
.titanium-menu {
    /* 1. COMANDO CRÍTICO: Diz ao browser "Ignora gestos de scroll aqui" */
    touch-action: none !important;
    
    /* 2. Contenção física: Impede que o movimento se propague ao body */
    overscroll-behavior: contain !important;

    /* (Mantém o que já tinhas) */
    -webkit-tap-highlight-color: transparent !important;
    outline: none !important;
    user-select: none;
}

.range-wrapper {
    position: relative;
    width: 100%;
    height: 2px; 
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 5px;
    z-index: 1;
}

.track-bg {
    position: absolute;
    top: 50%; transform: translateY(-50%);
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    z-index: 1;
    pointer-events: none;
}

.track-fill {
    position: absolute;
    top: 50%; transform: translateY(-50%);
    height: 4px;
    background: var(--accent);
    border-radius: 2px;
    z-index: 2;
    pointer-events: none;
}

.range-wrapper input[type="range"] {
    position: absolute;
    top: 50%; transform: translateY(-50%);
    width: 100%; height: 100%;
    z-index: 10;
    -webkit-appearance: none !important;
    appearance: none !important;
    background: transparent !important;
    border: none !important;
    margin: 0 !important; padding: 0 !important;
    pointer-events: none; 
    box-shadow: none !important;
    outline: none !important;
}

.range-wrapper input[type="range"]:focus,
.range-wrapper input[type="range"]:active {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}

.range-wrapper input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 100%;
    background: transparent !important; 
    border: none;
    cursor: pointer;
}

.range-wrapper input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none !important;
    appearance: none !important;
    height: 17px;
    width: 17px;
    border-radius: 50%;
    background-color: #181818 !important;
    border: 2.5px solid var(--accent); 
    box-shadow: 0 0 0px var(--accent);
    margin-top: -8px; 
    cursor: grab;
    pointer-events: auto;
    position: relative;
    z-index: 20;
    transform: scale(1); 
}

.range-wrapper input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2); 
    background-color: var(--accent) !important;
}

.range-wrapper input[type="range"]::-moz-range-thumb {
    height: 20px; width: 20px;
    border-radius: 50%;
    background: #121212;
    border: 2px solid var(--accent);
    cursor: grab;
    pointer-events: auto;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.range-wrapper input[type="range"]::-moz-range-track {
    background: transparent !important; 
    height: 100%;
}

.ticks {
    position: absolute;
    width: 93.67%;
    display: flex;
    justify-content: space-between;
    top: 0px; 
    padding: 0 2px;
    z-index: 0;
    pointer-events: none;
}
.tick { color: rgba(255,255,255,0.1); font-size: 0.6rem; font-weight: bold; }

/* --- SMOOTH DROPDOWN TRANSITIONS --- */
#scope-dropdown .scope-menu, 
#time-filter-menu,
#auth-menu,             
#interface-container,   
#star-dropdown.visible  
{
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    transition: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
    pointer-events: auto;
}

#scope-dropdown .scope-menu.hidden, 
#time-filter-menu.hidden,
#auth-menu.hidden,           
#interface-container.hidden, 
#star-dropdown               
{
    display: flex !important; 
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(-10px) !important; 
    pointer-events: none !important;
}

/* --- SEARCH BAR REACTOR --- */



.search-bar-container.compact-mode {
    background: rgba(--accent) !important; 
    border-color: var(--text);
    box-shadow: 0 00px 00px rgba(0,0,0,0.99);
    transform: scale(0.98);
}

.search-bar-container.compact-mode input {
    opacity: 0.7; 
}

/* * ================================================================================================
 * [SPA SYSTEM] SINGLE PAGE APPLICATION VIEWS - ZERO FLASH
 * ================================================================================================
 */
.app-view {
    display: none !important;
    opacity: 1 !important; /* Sempre opaco - sem transição de fade */
    width: 100%;
    pointer-events: none;
    /* [FIX] Sempre transparente para prevenir flash quando fog está ativo */
    background: transparent !important;
}

.app-view.active-view {
    display: block !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* Todas as views descem 25px, excepto agenda, chat, account e profile */
.app-view:not(#view-agenda):not(#view-chat):not(#view-account):not(#view-profile) {
    padding-top: 35px;
}

/* Account - conteúdo scrolla até ao topo (atrás do header) */
/* NOTA: Profile foi movido para profile.css */
#view-account {
    padding-top: 0 !important;
}

/* Produtos e criar produto - mais espaço do header */
#view-products,
#view-product-create,
#view-product-edit {
    padding-top: 40px !important;
    padding-bottom: 200px !important;
}

/* Views inativas ficam escondidas instantaneamente */
.app-view:not(.active-view) {
    display: none !important;
}

/* =============================================================================
 * [HOME VIEW] Usa scroll normal de documento para compatibilidade com animação kinetic
 * ============================================================================= */

/* Home ativa - scroll normal de documento */
#view-home.active-view {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    background: transparent !important;
}

/* Home inativa - escondida instantaneamente */
#view-home:not(.active-view) {
    display: none !important;
}

/* Feed scale - aumenta 5% */
#view-home .stream-container {
    transform: scale(1.05);
    transform-origin: top center;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

main {
    min-height: 100vh;
    position: relative;
    /* [FIX] Sempre transparente para prevenir flash quando fog está ativo */
    background: transparent !important;
    /* [FULLWIDTH] Estender às bordas do ecrã */
    width: 100vw;
    margin-left: calc(-50vw + 50%);
}

.action-btn { 
    background: transparent; 
    border: 1px solid var(--accent); 
    color: var(--accent); 
    padding: 8px 24px; 
    border-radius: 50px; 
    cursor: pointer; 
    transition: 0.3s; 
    font-weight: 700; 
    text-transform: uppercase; 
    font-size: 0.75rem; 
    letter-spacing: 1px;
    margin-top: 10px;
}
.action-btn:hover { 
    box-shadow: 0 0 20px rgba(var(--accent-rgb), 0.4); 
    transform: translateY(-2px);
}
.action-btn.following { 
    background: var(--accent); 
    color: #000; 
}

/* * ================================================================================================
 * [SECTOR 100] NEON SYNTAX OVERRIDE
 * ================================================================================================
 */
body.magic-text-active input, 
body.magic-text-active textarea,
body.magic-text-active .kinetic-input {
    -webkit-text-fill-color: #e0f7fa !important;
    color: #e0f7fa !important;
    text-shadow: 0 0 5px #00C9FF, 0 0 10px #00C9FF;
    border-color: #92FE9D !important;
    box-shadow: 0 0 15px rgba(146, 254, 157, 0.2);
    transition: all 0.5s ease;
}

body.magic-text-active input::placeholder,
body.magic-text-active textarea::placeholder {
    -webkit-text-fill-color: rgba(224, 247, 250, 0.5) !important;
    text-shadow: none;
}


/* [ARCHITECT FIX: PROFILE BASE] - Movido para profile.css */

/* [INDEPENDENT SCROLL] Products - esconde com visibility para preservar scroll */
#view-products:not(.active-view) {
    display: block !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -9999 !important;
}

#view-products.active-view {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100% !important;
    height: 100% !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding-top: calc(50px + env(safe-area-inset-top, 0px)) !important;
    padding-bottom: calc(120px + env(safe-area-inset-bottom, 0px)) !important;
    visibility: visible !important;
    pointer-events: auto !important;
    /* [FOG] Fundo opaco para bloquear a névoa */
    background: var(--bg) !important;
    z-index: 5600;
}

/* Account view - garantir interactividade imediata */
#view-account {
    /* [FIX] Sempre transparente para prevenir flash quando fog está ativo */
    background: transparent !important;
}
#view-account.active-view {
    display: block !important;
    pointer-events: auto;
}

#view-account.active-view * {
    pointer-events: auto;
}

/* * ================================================================================================
 * [SECTOR 101] iOS-STYLE SETTINGS SUBSECTIONS
 * ================================================================================================
 */
.settings-subsections {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0;
    margin-top: 20px;
    /* Garante que é clicável imediatamente */
    pointer-events: auto;
}

.settings-subsection {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    /* Mobile touch optimization */
    touch-action: manipulation;
}

.settings-subsection:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

.subsection-header {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px 16px;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s ease;
    /* Mobile touch optimization - removes 300ms delay */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    user-select: none;
    -webkit-user-select: none;
}

.subsection-header:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* Disable hover effects on touch devices */
@media (hover: none), (pointer: coarse) {
    .settings-subsection:hover {
        border-color: rgba(255, 255, 255, 0.08);
    }
    .subsection-header:hover {
        background: transparent;
    }
}

.subsection-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.subsection-icon svg {
    width: 18px;
    height: 18px;
    stroke: white;
    stroke-width: 2;
    fill: none;
}

.subsection-title {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
}

.subsection-chevron {
    width: 18px;
    height: 18px;
    stroke: var(--text);
    opacity: 0.4;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.settings-subsection.expanded .subsection-chevron {
    transform: rotate(90deg);
}

.subsection-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.settings-subsection.expanded .subsection-content {
    max-height: 800px;
}

/* Appearance section needs more height for the live preview */
.settings-subsection[data-section="appearance"].expanded .subsection-content {
    max-height: 1400px;
}

/* Features section needs more height for all animation controls and agenda hours */
.settings-subsection[data-section="features"].expanded .subsection-content {
    max-height: 1800px;
}

/* WhatsApp section needs more height for AI Auto-Reply */
.settings-subsection[data-section="whatsapp"].expanded .subsection-content {
    max-height: 2200px;
}

/* Account Profile Edit Section */
.account-profile-edit {
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.account-profile-edit #avatar-area {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 2px dashed rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
}

.account-profile-edit #avatar-area:hover {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
}

.account-profile-edit #avatar-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

.account-profile-edit #avatar-preview[src]:not([src=""]) {
    display: block;
}

.account-profile-edit #avatar-icon {
    width: 36px;
    height: 36px;
    stroke: var(--text);
    opacity: 0.4;
}

.account-profile-edit #avatar-preview[src]:not([src=""]) + #avatar-icon {
    display: none;
}

.account-profile-edit .kinetic-group {
    width: 100%;
}

.account-profile-edit .kinetic-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text);
    opacity: 0.5;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.account-profile-edit .kinetic-input {
    width: 100%;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text);
    font-family: var(--font-main);
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.account-profile-edit .kinetic-input:focus {
    border-color: transparent;
    background: rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 0 12px rgba(var(--accent-rgb, 74, 144, 164), 0.5);
}

.account-profile-edit textarea.kinetic-input {
    min-height: 80px;
    resize: none;
}

.account-profile-edit .btn-save {
    width: 100%;
    padding: 14px;
    background: var(--accent);
    border: none;
    border-radius: 10px;
    color: #000;
    font-family: var(--font-main);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
}

.account-profile-edit .btn-save:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.subsection-inner {
    padding: 0 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Settings Item Styles */
.settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s ease;
}

/* Hover only on devices with pointer (mouse) - not on touch */
@media (hover: hover) and (pointer: fine) {
    .settings-item:hover {
        background: rgba(255, 255, 255, 0.05);
    }
}

.settings-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.settings-item-icon {
    width: 20px;
    height: 20px;
    stroke: var(--text);
    opacity: 0.6;
}

.settings-item-label {
    font-size: 0.85rem;
    color: var(--text);
    opacity: 0.9;
}

.settings-item-value {
    font-size: 0.8rem;
    color: var(--text);
    opacity: 0.4;
    display: flex;
    align-items: center;
    gap: 6px;
}

.settings-item-arrow {
    width: 16px;
    height: 16px;
    stroke: var(--text);
    opacity: 0.3;
}

/* iOS-style Toggle Switch */
.settings-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 26px;
    cursor: pointer;
    flex-shrink: 0;
}

.settings-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 13px;
    transition: background 0.3s ease;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.settings-toggle input:checked + .toggle-slider {
    background: var(--accent);
}

.settings-toggle input:checked + .toggle-slider::after {
    transform: translateX(18px);
}

/* Balance Display */
.token-balance-display {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(var(--accent-rgb), 0.1);
    border-radius: 8px;
}

.token-balance-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent);
}

/* Plan Badge */
.plan-badge {
    padding: 4px 10px;
    background: linear-gradient(135deg, var(--accent), rgba(var(--accent-rgb), 0.7));
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #000;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Dangerous Actions */
.settings-item.danger {
    color: #ff453a;
}

.settings-item.danger .settings-item-label {
    color: #ff453a;
    opacity: 1;
}

.settings-item.danger .settings-item-icon {
    stroke: #ff453a;
    opacity: 1;
}

/* Version Info */
.settings-version {
    text-align: center;
    padding: 20px;
    font-size: 0.75rem;
    color: var(--text);
    opacity: 0.3;
}

/* Divider inside settings */
.settings-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    margin: 8px 0;
}

/* Settings Action Button */
.settings-action-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.02);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s ease;
    margin-top: 4px;
    /* Mobile touch optimization */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

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

.settings-action-btn .settings-item-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.settings-action-btn .settings-item-label {
    font-size: 0.85rem;
    color: var(--text);
    opacity: 0.9;
}

.settings-action-btn .settings-item-desc {
    font-size: 0.7rem;
    color: var(--text);
    opacity: 0.4;
}

.settings-action-btn svg {
    stroke: var(--text);
    opacity: 0.3;
    flex-shrink: 0;
}

.settings-action-btn.danger .settings-item-label {
    color: #ff453a;
}

.settings-action-btn.danger svg {
    stroke: #ff453a;
}

/* Settings Item (display row) */
.settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
    margin-top: 4px;
}

.settings-item .settings-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.settings-item .settings-item-label {
    font-size: 0.85rem;
    color: var(--text);
    opacity: 0.9;
}

.settings-item .settings-item-desc {
    font-size: 0.7rem;
    color: var(--text);
    opacity: 0.4;
}

/* Settings Mini Button */
.settings-mini-btn {
    padding: 6px 14px;
    background: rgba(var(--accent-rgb), 0.15);
    border: 1px solid var(--accent);
    border-radius: 6px;
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.settings-mini-btn:hover {
    background: var(--accent);
    color: #000;
}

/* Theme Selector Buttons */
.settings-theme-selector {
    display: flex;
    gap: 6px;
}

.theme-btn {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--text);
    opacity: 0.5;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-btn:hover {
    opacity: 0.8;
    background: rgba(255, 255, 255, 0.08);
}

.theme-btn.active {
    opacity: 1;
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}

/* Color Picker */
.settings-color-picker {
    display: flex;
    gap: 8px;
}

.color-swatch {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.color-swatch:hover {
    transform: scale(1.15);
}

.color-swatch.active {
    border-color: white;
    box-shadow: 0 0 0 2px var(--bg-color), 0 0 10px currentColor;
}

/* Settings About Section */
.settings-about {
    text-align: center;
    padding: 24px 0 12px;
}

.settings-version {
    font-size: 0.75rem;
    color: var(--text);
    opacity: 0.3;
}

/* * ================================================================================================
 * [SECTOR 102] APPEARANCE VISUAL CONTROL SYSTEM
 * ================================================================================================
 */

/* Presets Bar */
.appearance-presets {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.presets-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.presets-orbs {
    display: flex;
    gap: 8px;
    flex: 1;
    overflow-x: auto;
    scrollbar-width: none;
}

.presets-orbs::-webkit-scrollbar {
    display: none;
}

.preset-orb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    position: relative;
}

.preset-orb:hover {
    transform: scale(1.15);
    border-color: rgba(255, 255, 255, 0.5);
}

.preset-orb.active {
    border-color: var(--accent);
    box-shadow: 0 0 8px rgba(var(--accent-rgb), 0.5);
}

.preset-orb-add {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 2px dashed rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.4);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.preset-orb-add:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--accent);
    color: var(--accent);
}

/* Mode Toggle (Colors / Effects) */
.appearance-mode-toggle {
    display: flex;
    gap: 4px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.15);
}

.mode-toggle-btn {
    flex: 1;
    padding: 8px 0;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mode-toggle-btn:hover {
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.05);
}

.mode-toggle-btn.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent);
}

/* Color Tabs */
.color-tabs {
    display: flex;
    gap: 2px;
    padding: 6px 16px;
    background: rgba(0, 0, 0, 0.1);
    overflow-x: auto;
    scrollbar-width: none;
}

.color-tabs::-webkit-scrollbar {
    display: none;
}

.color-tab {
    padding: 6px 8px;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.color-tab:hover {
    color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.05);
}

.color-tab.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent);
}

/* Color Panes */
.color-panes {
    padding: 12px 16px;
}

.color-pane {
    display: none;
    flex-direction: column;
    gap: 12px;
}

.color-pane.active {
    display: flex;
}

/* Appearance Panel */
.appearance-panel {
    padding: 0;
}

.appearance-panel.hidden {
    display: none;
}

#effects-panel {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#effects-panel.hidden {
    display: none;
}

/* Slider Groups */
.slider-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.slider-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.slider-val {
    font-size: 0.65rem;
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent);
    font-weight: 600;
}

/* HSL Sliders */
.hsl-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    outline: none;
}

.hsl-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #1a1a1a;
    border: 2px solid var(--accent);
    cursor: grab;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    transition: transform 0.15s ease;
}

.hsl-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: var(--accent);
}

.hsl-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #1a1a1a;
    border: 2px solid var(--accent);
    cursor: grab;
}

/* Hue Track - Rainbow Gradient */
.hue-track {
    background: linear-gradient(to right,
        #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000
    );
}

/* Saturation Track */
.sat-track {
    background: linear-gradient(to right,
        #555 0%, #888 50%, var(--accent) 100%
    );
}

/* Brightness Track - White to Black */
.bright-track {
    background: linear-gradient(to right,
        #fff 0%, #888 50%, #000 100%
    );
}

/* FX Intensity Group */
.fx-intensity-group {
    padding: 0 4px;
    margin-top: 4px;
}

/* Appearance Main Tabs (Standard / Advanced) */
.appearance-main-tabs {
    display: flex;
    gap: 0;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    margin: 12px 16px;
    padding: 3px;
}

.appearance-main-tab {
    flex: 1;
    padding: 10px 0;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.appearance-main-tab:hover {
    color: rgba(255, 255, 255, 0.7);
}

.appearance-main-tab.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent);
}

/* Appearance Main Content */
.appearance-main-content {
    display: none;
}

.appearance-main-content.active {
    display: block;
}

/* Theme Balls Grid (Legacy) */
.theme-balls-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    padding: 16px;
}

.theme-ball {
    aspect-ratio: 1;
    width: 100%;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.theme-ball:hover {
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.theme-ball.active {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.3), 0 4px 15px rgba(0, 0, 0, 0.3);
}

.theme-ball:active {
    transform: scale(0.95);
}

/* ============================================
   PREVIEW SECTION TABS (Below Standard/Advanced)
   ============================================ */
.preview-section-tabs {
    display: flex;
    gap: 4px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    justify-content: center;
}

.preview-section-tabs::-webkit-scrollbar {
    display: none;
}

.preview-section-tab {
    padding: 6px 12px;
    background: transparent;
    border: none;
    border-radius: 0;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.65rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.preview-section-tab:hover {
    color: rgba(255, 255, 255, 0.7);
}

.preview-section-tab.active {
    color: var(--text);
}

/* ============================================
   STANDARD TAB - Side by Side Layout
   ============================================ */
.standard-layout {
    display: flex;
    gap: 20px;
    padding: 16px;
    align-items: flex-start;
    justify-content: center;
}

.standard-preview {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}

.preview-frame-small {
    position: relative;
    width: 101px;
    height: 220px;
    border-radius: 16px;
    overflow: hidden;
    background: var(--bg-color);
    border: 2px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    flex-shrink: 0;
}

.preview-frame-small .preview-frame {
    transform: scale(0.27);
    transform-origin: top left;
}

/* Small Theme Balls */
.theme-balls-grid-small {
    display: grid;
    grid-template-columns: repeat(4, 36px);
    gap: 10px;
    align-content: start;
    justify-content: center;
    padding: 4px 0;
    min-height: 220px;
    width: 174px;
}

.theme-ball-small {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-ball-small:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.theme-ball-small.active {
    box-shadow: 0 0 0 2px var(--accent), 0 2px 12px rgba(0, 0, 0, 0.4);
}

.theme-ball-small:active {
    transform: scale(0.9);
}

/* Theme ball number */
.theme-ball-number {
    font-size: 10px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    user-select: none;
}

/* Current Theme Ball (Save Slot) */
.theme-ball-current {
    position: relative;
    border-color: rgba(255, 255, 255, 0.3);
}

.theme-ball-current.active {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.3);
}

/* ============================================
   ADVANCED COMPACT GRID LAYOUT
   ============================================ */
.advanced-grid-compact {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 4px 0;
    width: 174px;
    min-height: 220px;
}

.advanced-row {
    width: 100%;
}

/* Row 1: Mini Magnet Track */
.advanced-row-track {
    height: 32px;
    margin-bottom: 20px;
}

.mini-magnet-track {
    display: flex;
    gap: 2px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 3px;
    overflow-x: auto;
    scrollbar-width: none;
}

.mini-magnet-track::-webkit-scrollbar {
    display: none;
}

.mini-magnet-btn {
    flex: 1;
    min-width: 22px;
    height: 26px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.5px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0 2px;
}

.mini-magnet-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

.mini-magnet-btn.active {
    background: var(--accent);
    color: #000;
}

/* ============================================
   APPEARANCE COMPACT CONTROLS (Simplified)
   ============================================ */
.appearance-compact-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px 16px;
}

.appearance-compact-controls .mini-magnet-track {
    width: 100%;
}

.appearance-sliders {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Rows 2-4: Compact Sliders */
.advanced-row-slider {
    height: 26px;
    display: flex;
    align-items: center;
    margin-top: 0;
}

.advanced-row-slider:first-of-type {
    margin-top: -8px;
}

input[type="range"].compact-hsl-slider {
    width: 100%;
    height: 24px;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background: transparent !important;
    cursor: pointer;
    outline: none;
    border: none !important;
}

/* WebKit - Hue Track */
input[type="range"].compact-hsl-slider.hue-track::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 3px;
    border: none;
    background: linear-gradient(to right,
        hsl(0, 100%, 50%),
        hsl(60, 100%, 50%),
        hsl(120, 100%, 50%),
        hsl(180, 100%, 50%),
        hsl(240, 100%, 50%),
        hsl(300, 100%, 50%),
        hsl(360, 100%, 50%)
    ) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

/* WebKit - Saturation Track */
input[type="range"].compact-hsl-slider.sat-track::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 3px;
    border: none;
    background: linear-gradient(to right,
        hsl(var(--current-hue, 0), 0%, 50%),
        hsl(var(--current-hue, 0), 100%, 50%)
    ) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

/* WebKit - Brightness Track */
input[type="range"].compact-hsl-slider.bright-track::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 3px;
    border: none;
    background: linear-gradient(to right,
        #fff,
        hsl(var(--current-hue, 0), 100%, 50%),
        #000
    ) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

/* WebKit - Thumb Base */
input[type="range"].compact-hsl-slider::-webkit-slider-thumb {
    -webkit-appearance: none !important;
    appearance: none !important;
    width: 16px;
    height: 16px;
    border-radius: 50% !important;
    border: 2px solid rgba(255, 255, 255, 0.9) !important;
    margin-top: -5px;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4) !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

/* WebKit - Hue Thumb - shows current hue color */
input[type="range"].compact-hsl-slider.hue-track::-webkit-slider-thumb {
    background: hsl(var(--current-hue, 0), 100%, 50%) !important;
}

/* WebKit - Saturation Thumb - shows current saturation level */
input[type="range"].compact-hsl-slider.sat-track::-webkit-slider-thumb {
    background: hsl(var(--current-hue, 0), var(--thumb-sat, 100%), 50%) !important;
}

/* WebKit - Brightness Thumb - shows current brightness level */
input[type="range"].compact-hsl-slider.bright-track::-webkit-slider-thumb {
    background: hsl(var(--current-hue, 0), var(--thumb-sat, 100%), var(--thumb-light, 50%)) !important;
}

input[type="range"].compact-hsl-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5) !important;
}

input[type="range"].compact-hsl-slider:active::-webkit-slider-thumb {
    transform: scale(0.95);
}

/* Firefox - Hue Track */
input[type="range"].compact-hsl-slider.hue-track::-moz-range-track {
    height: 6px;
    border-radius: 3px;
    border: none;
    background: linear-gradient(to right,
        hsl(0, 100%, 50%),
        hsl(60, 100%, 50%),
        hsl(120, 100%, 50%),
        hsl(180, 100%, 50%),
        hsl(240, 100%, 50%),
        hsl(300, 100%, 50%),
        hsl(360, 100%, 50%)
    );
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

/* Firefox - Saturation Track */
input[type="range"].compact-hsl-slider.sat-track::-moz-range-track {
    height: 6px;
    border-radius: 3px;
    border: none;
    background: linear-gradient(to right,
        hsl(var(--current-hue, 0), 0%, 50%),
        hsl(var(--current-hue, 0), 100%, 50%)
    );
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

/* Firefox - Brightness Track */
input[type="range"].compact-hsl-slider.bright-track::-moz-range-track {
    height: 6px;
    border-radius: 3px;
    border: none;
    background: linear-gradient(to right,
        #fff,
        hsl(var(--current-hue, 0), 100%, 50%),
        #000
    );
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

/* Firefox - Thumb Base */
input[type="range"].compact-hsl-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.9);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    transition: transform 0.15s ease;
}

/* Firefox - Hue Thumb */
input[type="range"].compact-hsl-slider.hue-track::-moz-range-thumb {
    background: hsl(var(--current-hue, 0), 100%, 50%);
}

/* Firefox - Saturation Thumb */
input[type="range"].compact-hsl-slider.sat-track::-moz-range-thumb {
    background: hsl(var(--current-hue, 0), var(--thumb-sat, 100%), 50%);
}

/* Firefox - Brightness Thumb */
input[type="range"].compact-hsl-slider.bright-track::-moz-range-thumb {
    background: hsl(var(--current-hue, 0), var(--thumb-sat, 100%), var(--thumb-light, 50%));
}

input[type="range"].compact-hsl-slider::-moz-range-thumb:hover {
    transform: scale(1.15);
}

.compact-slider-val {
    font-size: 9px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    width: 28px;
    text-align: right;
}

/* Row 5: Advanced Balls */
.advanced-row-balls {
    margin-top: 8px;
}

.advanced-balls-container {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.advanced-ball {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.advanced-ball:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.advanced-ball.active {
    box-shadow: 0 0 0 2px var(--accent), 0 2px 12px rgba(0, 0, 0, 0.4);
}

.advanced-ball:active {
    transform: scale(0.9);
}

.advanced-ball-number {
    font-size: 10px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    user-select: none;
}

/* ============================================
   APPEARANCE LIVE PREVIEW SECTION
   ============================================ */
.appearance-preview-section {
    margin-top: 16px;
    padding: 0 16px 16px 16px;
}

.preview-header {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

.preview-title {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
}

.preview-nav-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.preview-nav-pill {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.65rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.preview-nav-pill:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
}

.preview-nav-pill.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #000;
}

.preview-frame-container {
    position: relative;
    width: 100%;
    height: 280px;
    border-radius: 16px;
    overflow: hidden;
    background: var(--bg-color);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.preview-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 375px;
    height: 812px;
    transform-origin: top left;
    transform: scale(0.345);
    pointer-events: none;
    overflow: hidden;
    background: var(--bg-color);
}

.preview-content {
    width: 100%;
    height: 100%;
    position: relative;
}

/* Preview Navigation Bar */
.preview-navbar {
    position: absolute;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    width: 82%;
    height: 57px;
    background: var(--glass-bg);
    border: 1px solid var(--nav-border-color);
    border-radius: 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 17px;
    box-sizing: border-box;
}

.preview-brand {
    display: flex;
    align-items: center;
    gap: 8px;
}

.preview-logo {
    width: 28px;
    height: 28px;
    background: var(--accent);
    border-radius: 50%;
    opacity: 0.8;
}

.preview-brand-text {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent);
}

.preview-tools {
    display: flex;
    gap: 8px;
}

.preview-tool-btn {
    width: 28px;
    height: 28px;
    background: var(--glass-bg);
    border: 1px solid var(--nav-border-color);
    border-radius: 50%;
}

/* Preview Bottom Dock */
.preview-dock {
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    width: 85%;
    height: 62px;
    background: var(--glass-bg);
    border: 1px solid var(--nav-border-color);
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0 10px;
    box-sizing: border-box;
}

.preview-dock-item {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
}

.preview-dock-item.active {
    opacity: 1;
}

.preview-dock-item svg {
    width: 20px;
    height: 20px;
    stroke: var(--text);
}

.preview-dock-hero {
    width: 44px;
    height: 44px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-dock-hero svg {
    width: 20px;
    height: 20px;
    stroke: #000;
}

/* Preview Main Content Area */
.preview-main {
    position: absolute;
    top: 130px;
    left: 0;
    right: 0;
    bottom: 110px;
    padding: 0 16px;
    overflow: hidden;
}

/* Preview Home Cards */
.preview-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.preview-card {
    background: var(--glass-bg);
    border: 1px solid var(--card-border-color);
    border-radius: 16px;
    padding: 14px;
}

.preview-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.preview-card-avatar {
    width: 36px;
    height: 36px;
    background: var(--glass-bg);
    border: 1px solid var(--card-border-color);
    border-radius: 50%;
}

.preview-card-meta {
    flex: 1;
}

.preview-card-author {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}

.preview-card-time {
    font-size: 0.6rem;
    color: var(--text);
    opacity: 0.4;
}

.preview-card-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
    line-height: 1.3;
}

.preview-card-excerpt {
    font-size: 0.7rem;
    color: var(--text);
    opacity: 0.5;
    line-height: 1.4;
}

/* Preview Library View */
.preview-agenda-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    padding: 0 4px;
}

.preview-lib-tab {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    font-size: 0.6rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
}

.preview-lib-tab.active {
    background: var(--accent);
    color: #000;
}

/* Preview Chat View */
.preview-chat-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.preview-message {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 0.7rem;
    line-height: 1.4;
}

.preview-message.ai {
    background: var(--glass-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text);
    align-self: flex-start;
}

.preview-message.user {
    background: var(--accent);
    color: #000;
    align-self: flex-end;
}

/* Preview Profile View */
.preview-profile-header {
    text-align: center;
    padding: 20px 0;
}

.preview-profile-avatar {
    width: 70px;
    height: 70px;
    background: var(--glass-bg);
    border: 2px solid var(--accent);
    border-radius: 50%;
    margin: 0 auto 12px;
}

.preview-profile-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.preview-profile-bio {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
}

.preview-profile-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 16px;
}

.preview-stat {
    text-align: center;
}

.preview-stat-val {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent);
}

.preview-stat-label {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
}

/* Preview Reader View */
.preview-reader {
    padding-top: 10px;
}

.preview-reader-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 8px;
    line-height: 1.2;
}

.preview-reader-meta {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 16px;
}

.preview-reader-content {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
}

.preview-reader-content p {
    margin: 0 0 12px 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TEXT GLOW EFFECT (fx-cyan)
   ═══════════════════════════════════════════════════════════════════════════ */

body.fx-cyan .article-title,
body.fx-cyan .card-title,
body.fx-cyan .p-signal-title,
body.fx-cyan .reader-title,
body.fx-cyan .preview-card-title,
body.fx-cyan .preview-reader-title {
    text-shadow: 0 0 8px var(--title), 0 0 16px var(--accent), 0 0 24px rgba(var(--accent-rgb), 0.4) !important;
    transition: text-shadow 0.3s ease;
    filter: drop-shadow(0 0 6px var(--accent)) !important;
}

body.fx-cyan .article-body,
body.fx-cyan .reader-content,
body.fx-cyan .reader-body,
body.fx-cyan .card-summary,
body.fx-cyan .article-excerpt,
body.fx-cyan .article-description,
body.fx-cyan .post-content,
body.fx-cyan .content-text,
body.fx-cyan .article-text,
body.fx-cyan .reader-text {
    text-shadow: 0 0 4px var(--text), 0 0 8px rgba(var(--accent-rgb), 0.5) !important;
    transition: text-shadow 0.3s ease;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TEXT ACCENT COLOR EFFECT (fx-cyan) - Todo o texto com cor accent
   Exclui: Agendas
   ═══════════════════════════════════════════════════════════════════════════ */

/* Texto geral da plataforma */
body.fx-cyan:not(.mode-agenda) h1,
body.fx-cyan:not(.mode-agenda) h2,
body.fx-cyan:not(.mode-agenda) h3,
body.fx-cyan:not(.mode-agenda) h4,
body.fx-cyan:not(.mode-agenda) h5,
body.fx-cyan:not(.mode-agenda) h6,
body.fx-cyan:not(.mode-agenda) p,
body.fx-cyan:not(.mode-agenda) span,
body.fx-cyan:not(.mode-agenda) label,
body.fx-cyan:not(.mode-agenda) a,
body.fx-cyan:not(.mode-agenda) li,
body.fx-cyan:not(.mode-agenda) td,
body.fx-cyan:not(.mode-agenda) th,
body.fx-cyan:not(.mode-agenda) .text,
body.fx-cyan:not(.mode-agenda) .title,
body.fx-cyan:not(.mode-agenda) .subtitle,
body.fx-cyan:not(.mode-agenda) .description,
body.fx-cyan:not(.mode-agenda) .label,
body.fx-cyan:not(.mode-agenda) .name,
body.fx-cyan:not(.mode-agenda) .content {
    color: var(--accent) !important;
}

/* Elementos específicos da UI */
body.fx-cyan:not(.mode-agenda) .section-title,
body.fx-cyan:not(.mode-agenda) #section-title,
body.fx-cyan:not(.mode-agenda) .product-name,
body.fx-cyan:not(.mode-agenda) .product-description,
body.fx-cyan:not(.mode-agenda) .product-price,
body.fx-cyan:not(.mode-agenda) .kb-item-title,
body.fx-cyan:not(.mode-agenda) .kb-item-summary,
body.fx-cyan:not(.mode-agenda) .contact-name,
body.fx-cyan:not(.mode-agenda) .contact-phone,
body.fx-cyan:not(.mode-agenda) .message-text,
body.fx-cyan:not(.mode-agenda) .chat-message,
body.fx-cyan:not(.mode-agenda) .ios-row-title,
body.fx-cyan:not(.mode-agenda) .ios-row-subtitle,
body.fx-cyan:not(.mode-agenda) .ios-section-title,
body.fx-cyan:not(.mode-agenda) .settings-title,
body.fx-cyan:not(.mode-agenda) .card-header-title {
    color: var(--accent) !important;
}

/* Excluir inputs, textareas, placeholders e botões */
body.fx-cyan input,
body.fx-cyan textarea,
body.fx-cyan select,
body.fx-cyan input::placeholder,
body.fx-cyan textarea::placeholder {
    color: inherit !important;
}

/* Excluir SVGs e ícones */
body.fx-cyan svg,
body.fx-cyan .nav-icon,
body.fx-cyan .icon {
    color: inherit !important;
}

/* ===========================================
   KINETIC FEED ANIMATION
   =========================================== */

/* Estado quando animação está desativada */
body.kinetic-disabled .article-row {
    opacity: 1 !important;
    transform: scale(0.9) translate(0, 0) !important;
    visibility: visible !important;
}

/* Focus visual quando artigo está centrado */
.article-row.active-focus {
    z-index: 100;
}







/* [PATCH 2060: INTERACTION SAFEGUARD] */

/* 1. Garante que o Track é clicável */
.library-controls-container {
    z-index: 150 !important; /* Acima do stream, abaixo da Navbar */
    pointer-events: none !important; /* Container invisível ao toque */
}

.magnet-track, 
.magnet-track * {
    pointer-events: auto !important; /* Botões clicáveis */
}

/* 2. Correção da Stream (Evita que tape a Dock) */
.ice-stream {
    height: 100% !important; /* Remove 100dvh forçado que quebrava o scroll */
    padding-bottom: 120px !important; /* Espaço para a Dock */
    pointer-events: none; /* Padrão: não interativo */
}

.ice-stream.active-stream {
    pointer-events: auto !important; /* Ativa interação apenas no visível */
    z-index: 10 !important;
}

/* 3. Fail-safe para o estado de arrasto */
body.is-dragging .magnet-track {
    pointer-events: auto !important; /* REVERSÃO: Nunca bloquear o menu totalmente */
    opacity: 0.5;
}

/* 4. Correção do Overlay da Agenda (Estava a bloquear toques invisíveis) */
.agenda-overlay:not(.hidden) {
    pointer-events: auto !important;
}
.agenda-overlay.hidden {
    pointer-events: none !important;
    display: none !important;
}

/* Chat button visível mesmo quando agenda avançada está aberta */
/* body.agenda-open .nav-floating-chat - removido para permitir acesso ao chat */

/* * ================================================================================================
 * [SECTOR] FOG BACKGROUND EFFECT
 * Efeito de névoa animada inspirado na página de login
 * ================================================================================================
 */

/* * ================================================================================================
 * [SECTOR] DYNAMIC FOG EFFECT - 3 Camadas com animações independentes
 * Efeito névoa dinâmico com movimento mais orgânico
 * ================================================================================================
 */

.bg-fog-dynamic {
    position: fixed;
    inset: 0;
    z-index: 5500; /* Above settings overlay (5000) but below dock */
    overflow: hidden;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transform: translateZ(0);
    will-change: opacity;
    isolation: isolate;
}

.bg-fog-dynamic.visible {
    opacity: 1 !important;
    visibility: visible !important;
}

.dynamic-fog-layer {
    position: absolute;
    width: 300%;
    height: 300%;
    top: -100%;
    left: -100%;
    opacity: 0.85;
    will-change: transform, opacity;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: translateZ(0);
    filter: blur(30px);
    -webkit-filter: blur(30px);
}

.dynamic-fog-layer-1 {
    background:
        radial-gradient(ellipse 80% 50% at 20% 40%, rgba(var(--accent-rgb), 0.25) 0%, transparent 45%),
        radial-gradient(ellipse 60% 40% at 70% 60%, rgba(var(--accent-rgb), 0.18) 0%, transparent 45%);
    animation: dynamicFogDrift1 6s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.dynamic-fog-layer-2 {
    background:
        radial-gradient(ellipse 70% 60% at 80% 30%, rgba(var(--accent-rgb), 0.2) 0%, transparent 45%),
        radial-gradient(ellipse 50% 50% at 30% 70%, rgba(var(--accent-rgb), 0.15) 0%, transparent 45%);
    animation: dynamicFogDrift2 8s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.dynamic-fog-layer-3 {
    background:
        radial-gradient(ellipse 90% 70% at 50% 50%, rgba(var(--accent-rgb), 0.12) 0%, transparent 55%);
    animation: dynamicFogDrift3 10s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes dynamicFogDrift1 {
    0%, 100% { transform: translate(0%, 0%); }
    20% { transform: translate(18%, 12%); }
    40% { transform: translate(8%, -15%); }
    60% { transform: translate(-12%, 10%); }
    80% { transform: translate(-5%, -8%); }
}

@keyframes dynamicFogDrift2 {
    0%, 100% { transform: translate(0%, 0%); }
    25% { transform: translate(-15%, 10%); }
    50% { transform: translate(12%, 18%); }
    75% { transform: translate(10%, -12%); }
}

@keyframes dynamicFogDrift3 {
    0%, 100% { transform: translate(0%, 0%); opacity: 0.6; }
    25% { transform: translate(-10%, 15%); opacity: 0.8; }
    50% { transform: translate(15%, -8%); opacity: 0.7; }
    75% { transform: translate(-8%, -12%); opacity: 0.9; }
}

/* Pausa animação durante scroll */
body.scroll-active .dynamic-fog-layer {
    animation-play-state: paused !important;
}

/* Hide vignette when dynamic fog effect is active */
body.dynamic-fog-active .void-vignette {
    opacity: 0 !important;
    pointer-events: none;
}

body.dynamic-fog-active main,
body.dynamic-fog-active #view-home,
body.dynamic-fog-active .stream-container,
body.dynamic-fog-active .app-view {
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
}

/* * ================================================================================================
 * [SECTOR 99] HEADER VISIBILITY TOGGLE
 * ================================================================================================
 */

/* Hide header when toggle is off */
body.header-hidden .navbar {
    display: none !important;
}

/* Adjust content when header is hidden */
body.header-hidden #view-products.active-view {
    padding-top: calc(-10px + env(safe-area-inset-top, 0px)) !important;
}

body.header-hidden #view-products .products-container {
    margin-top: -40px !important;
}

/* Catalog/Library - increase padding when header is hidden */
body.header-hidden #view-library {
    padding-top: 25px !important;
}

/* Create/Edit pages - reduce padding when header is hidden */
body.header-hidden #view-product-create .product-edit-container,
body.header-hidden #view-product-edit .product-edit-container,
body.header-hidden #view-kb-create .product-edit-container,
body.header-hidden #view-kb-edit .product-edit-container {
    padding: 10px 25px 20px 25px !important;
}

/* Settings pages - reduce padding when header is hidden */
body.header-hidden .ios-settings-page {
    padding-top: 120px !important;
}

/* * ================================================================================================
 * [SECTOR 100] TRANSPARENT UI MODE TOGGLE
 * ================================================================================================
 */

/* DEFAULT: UI Transparente ACTIVO (body.transparent-ui) */
/* Os estilos transparentes já estão aplicados no CSS base */

/* QUANDO DESACTIVADO: Restaura fundos sólidos (cor do tema sem transparência) */
body:not(.transparent-ui) .navbar {
    background: var(--glass-solid) !important;
    backdrop-filter: blur(var(--blur)) !important;
    -webkit-backdrop-filter: blur(var(--blur)) !important;
}

body:not(.transparent-ui) .obsidian-nav {
    background: var(--glass-solid) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
}

body:not(.transparent-ui) #smart-btn.gradient-user-btn {
    background: transparent !important;
}

body:not(.transparent-ui) #smart-btn .avatar-glow {
    background: transparent !important;
    border: 2px solid var(--accent) !important;
}

body:not(.transparent-ui) .nav-item.hero-btn .nav-icon-hero {
    background: var(--glass-solid) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border: 1.6px solid var(--nav-border-color) !important;
    box-shadow: 2px 2.5px 7px rgba(0,0,0,0.9) !important;
}

/* Ring button (switch-btn / trigger) - cinzento */
#switch-btn.ring-btn {
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: 2px solid #666666 !important;
    box-shadow: none !important;
}

/* * ================================================================================================
 * GLOBAL CURSOR OVERLAY - Cursor visual para todos os inputs
 * ================================================================================================
 */

.global-input-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

.global-cursor-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    overflow: hidden;
    box-sizing: border-box;
}

.global-text-content {
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--text, #fff);
    font: inherit;
}

.global-text-content.empty::before {
    content: attr(data-placeholder);
    color: rgba(255, 255, 255, 0.4);
}

/* Cursor piscante global - igual ao do chat */
.global-text-cursor {
    position: absolute;
    width: 2px;
    height: 18px;
    background: #0b84fe;
    animation: blink-global-caret 1s step-end infinite;
    pointer-events: none;
}

@keyframes blink-global-caret {
    0%, 50% { opacity: 1; }
    50.01%, 100% { opacity: 0; }
}

/* Input ativo com cursor - esconder texto nativo e placeholder */
.global-kb-active {
    color: transparent !important;
    caret-color: transparent !important;
}

.global-kb-active::placeholder {
    color: transparent !important;
    opacity: 0 !important;
}

/* Input ativo sem overlay - mostra cursor nativo azul */
.no-overlay-active {
    caret-color: #0b84fe !important;
}

/* Estado de arrastar cursor */
.global-cursor-overlay.dragging-cursor .global-text-cursor {
    animation: none !important;
    opacity: 1 !important;
    background: #0b84fe;
    box-shadow: 0 0 8px rgba(11, 132, 254, 0.6);
}

/* * ================================================================================================
 * PRODUCTS SECTION - Estrutura de Produtos para Assistência AI
 * ================================================================================================
 */

.products-container {
    padding: 20px;
    padding-bottom: 120px;
    max-width: 100%;
    margin-top: -40px;
}

.products-grid {
    display: flex;
    flex-direction: column;
    gap: 17.5px;
    padding-top: 13px;
}

.product-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 28px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.2);
    /* [SCALE] Diminui 4% a escala dos cartões */
    transform: scale(0.96);
}

.product-card:active {
    transform: scale(0.94);
}

.product-image {
    margin: 16px;
    margin-bottom: 0;
    height: 180px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    position: relative;
}

.product-image::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    box-shadow: inset 0 0 15px 5px rgba(0, 0, 0, 0.35), inset 0 0 3px 1px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    z-index: 1;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
}

.product-content {
    padding: 24px;
    padding-bottom: 16px;
}

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}

.product-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
    flex: 1;
    line-height: 1.3;
}

.product-category {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent);
    background: rgba(99, 102, 241, 0.15);
    padding: 4px 8px;
    border-radius: 6px;
    white-space: nowrap;
}

.product-description {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7) !important;
    margin: 0 0 16px 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-details {
    display: flex;
    gap: 20px;
    margin-bottom: 5px;
}

.product-detail {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.product-detail.price-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.price-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.edit-icon-btn {
    background: transparent;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
}

.detail-label {
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.4);
}

.detail-value {
    font-size: 15px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7) !important;
}

.product-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.product-tag {
    font-size: 11px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    background: rgba(0, 0, 0, 0.3);
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.product-actions {
    display: flex;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin-top: 0;
}

.product-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-main);
    font-size: 14px;
    font-weight: 500;
}

.product-action-btn:hover {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.03);
}

.product-action-btn:active {
    background: rgba(255, 255, 255, 0.05);
}

.products-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 80px 20px;
}

.products-grid:has(.product-card) .products-empty-state {
    display: none;
}

.products-empty-state .empty-icon {
    color: var(--text);
    opacity: 0.12;
    margin-bottom: 20px;
}

.products-empty-state .empty-title {
    font-size: 17px;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 8px 0;
}

.products-empty-state .empty-description {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    opacity: 1;
    margin: 0;
    max-width: 260px;
    line-height: 1.5;
}

/* ================================================================================================
 * PRODUCT EDIT SECTION
 * ================================================================================================
 */
.product-edit-container {
    padding: 20px;
    padding-bottom: 120px;
    max-width: 100%;
}

.product-edit-header {
    margin-bottom: 24px;
}

.product-edit-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

#view-reader .reader-body {
    line-height: 1.7;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.85);
}

/* Product Images Grid */
.product-images-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.product-image-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
}

.product-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-image-item .remove-image {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.product-image-item:hover .remove-image,
.product-image-item:active .remove-image {
    opacity: 1;
}

.product-image-add {
    aspect-ratio: 1;
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px dashed rgba(255, 255, 255, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: rgba(255, 255, 255, 0.4);
}

.product-image-add:hover,
.product-image-add:active {
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.25);
    color: rgba(255, 255, 255, 0.6);
}

.product-image-add span {
    font-size: 12px;
    font-weight: 500;
}

.product-image-add.hidden {
    display: none;
}

.photo-count {
    font-weight: 400;
    color: rgba(255, 255, 255, 0.4);
    font-size: 12px;
}

/* Delete button */
.product-form-btn.delete {
    background: transparent;
    color: #FF453A;
    border: 1px solid rgba(255, 255, 255, 0.15);
    margin-top: 14px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.product-form-btn.delete:active {
    background: rgba(255, 69, 58, 0.1);
}

/* Product Modal */
.product-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 50px 16px 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.product-modal.active {
    opacity: 1;
    visibility: visible;
}

.product-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9999;
}

.product-modal-container {
    position: relative;
    z-index: 10000;
    width: 100%;
    max-width: 360px;
    background: var(--glass-solid);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transform: translateY(-30px);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s ease;
    margin-bottom: 20px;
    flex-shrink: 0;
}

.product-modal.active .product-modal-container {
    transform: translateY(0);
    opacity: 1;
}

.product-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--card-border-color);
}

.product-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

.product-modal-close {
    background: transparent;
    border: none;
    color: var(--text);
    opacity: 0.5;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.product-modal-close:active {
    opacity: 1;
}

.product-form {
    padding: 12px 16px;
}

.product-form-group {
    margin-bottom: 16px;
}

.product-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.product-form-group input,
.product-form-group textarea {
    width: 100%;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03) !important;
    border: none !important;
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.75) !important;
    -webkit-text-fill-color: rgba(255, 255, 255, 0.75) !important;
    font-family: var(--font-main);
    font-size: 16px;
    line-height: 1.5;
    transition: var(--transition);
    box-sizing: border-box;
    box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.55) !important;
    -webkit-appearance: none;
    appearance: none;
    /* Enable copy/paste menu */
    -webkit-touch-callout: default !important;
    -webkit-user-select: text !important;
    user-select: text !important;
    touch-action: auto !important;
    pointer-events: auto !important;
}

.product-form-group input:focus,
.product-form-group textarea:focus {
    background: rgba(255, 255, 255, 0.06) !important;
    outline: 2px solid rgba(255, 255, 255, 0.5) !important;
    outline-offset: -1px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.7) !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
}

.product-form-group input::placeholder,
.product-form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.2) !important;
    -webkit-text-fill-color: rgba(255, 255, 255, 0.2) !important;
    opacity: 1 !important;
}

.product-form-group textarea {
    resize: none;
    min-height: 70px;
    overflow-y: hidden;
    box-sizing: border-box;
}

/* Form Select Styles */
.product-form-group select,
.kb-form-group select {
    width: 100%;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03) !important;
    border: none !important;
    border-radius: 12px;
    color: var(--text);
    font-size: 14px;
    transition: all 0.2s ease;
    box-sizing: border-box;
    box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.6) !important;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.4)' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 18px !important;
    padding-right: 40px;
}

.product-form-group select:focus,
.kb-form-group select:focus {
    background-color: rgba(255, 255, 255, 0.06) !important;
    outline: 2px solid rgba(255, 255, 255, 0.5) !important;
    outline-offset: -1px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.7) !important;
}

.product-form-group select option,
.kb-form-group select option {
    background: #1a1a1a;
    color: #fff;
    padding: 12px;
}

/* Auto-expand textarea - infinite expansion */
#product-description {
    min-height: 70px;
    overflow-y: hidden;
}

/* Import JSON textarea - ensure it works */
#import-json {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
    pointer-events: auto !important;
    touch-action: auto !important;
    -webkit-touch-callout: default !important;
    min-height: 200px;
    max-height: 400px;
    resize: vertical;
    font-family: monospace;
    font-size: 13px;
}

.product-form-actions {
    margin-top: 12px;
    padding-bottom: 13px;
}

.product-form-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-family: var(--font-main);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.product-form-btn.save {
    background: transparent;
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.15);
    margin-top: 11px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.product-form-btn.save:active {
    transform: scale(0.98);
    opacity: 0.9;
}













/* --- GLOBAL FOG PERSISTENCE FIX --- */
#global-fog-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0; /* Fica atrás do conteúdo, mas à frente do background preto */
    pointer-events: none; /* Deixa o click passar para os botões */
    
    /* Configuração Visual da Névoa */
    background: 
        radial-gradient(circle at 50% -20%, rgba(120, 120, 255, 0.15), transparent 60%),
        radial-gradient(circle at 100% 50%, rgba(100, 100, 255, 0.08), transparent 50%);
    filter: blur(40px);
    opacity: 1;
    
    /* [IMPORTANTE] Transição suave se decidires mudar a cor, mas evita o flash */
    transition: opacity 0.5s ease;
    will-change: opacity, transform;
}

/* Garante que as Views são transparentes para ver a névoa */
.app-view {
    background-color: transparent !important; /* Remove fundos pretos sólidos */
    position: relative;
    z-index: 1; /* Conteúdo à frente da névoa */
}

/* Se tiveres modo de leitura ou algo que precise de fundo sólido, usa esta classe */
.app-view.solid-bg {
    background-color: #000 !important;
}

/* * ================================================================================================
 * KNOWLEDGE BASE CREATE FORM
 * ================================================================================================
 */

/* View KB Create - posicionamento */
#view-kb-create {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

#view-kb-create.active-view {
    display: flex !important;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
}

.kb-create-container {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    padding: 1.5rem;
    padding-top: 20px;
    padding-bottom: 250px;
    box-sizing: border-box;
}

/* Linha invisível para criar espaço no topo */
.kb-create-container::before {
    content: '';
    display: block;
    width: 100%;
    height: 35px;
    pointer-events: none;
}

/* Card principal - estilo AI Studio */
.kb-create-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 28px;
    padding: 28px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.25), 0 3px 10px rgba(0, 0, 0, 0.15);
}

.kb-create-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
}

/* Card Header */
.kb-create-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.kb-create-card-icon {
    width: 58px;
    height: 58px;
    min-width: 58px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #4A90D9, #67B26F);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.kb-create-card-icon svg {
    width: 30px;
    height: 30px;
    fill: white;
}

.kb-create-card-title {
    flex: 1;
    min-width: 0;
}

.kb-create-card-title h4 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.2;
}

.kb-create-card-title span {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
    display: block;
    margin-top: 5px;
}

/* Form */
.kb-create-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.kb-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.kb-form-group label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kb-form-group label span {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
}

/* Input título */
.kb-form-group input[type="text"] {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.03) !important;
    border: none !important;
    border-radius: 12px;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.75) !important;
    outline: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
    box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.6) !important;
}

.kb-form-group input[type="text"]:focus {
    background: rgba(255, 255, 255, 0.05) !important;
    outline: 2px solid rgba(255, 255, 255, 0.5) !important;
    outline-offset: -1px;
    box-shadow: inset 0 0 22px rgba(0, 0, 0, 0.7) !important;
    color: #fff !important;
}

.kb-form-group input[type="text"]::placeholder {
    color: rgba(255, 255, 255, 0.2) !important;
    -webkit-text-fill-color: rgba(255, 255, 255, 0.2) !important;
    opacity: 1 !important;
}

/* Textareas */
.kb-form-group textarea {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.03) !important;
    border: none !important;
    border-radius: 12px;
    font-size: 16px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.75) !important;
    outline: none;
    resize: none;
    overflow: hidden;
    transition: all 0.2s ease;
    box-sizing: border-box;
    box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.6) !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.kb-form-group textarea:focus {
    background: rgba(255, 255, 255, 0.05) !important;
    outline: 2px solid rgba(255, 255, 255, 0.5) !important;
    outline-offset: -1px;
    box-shadow: inset 0 0 22px rgba(0, 0, 0, 0.7) !important;
    color: #fff !important;
}

.kb-form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.2) !important;
    -webkit-text-fill-color: rgba(255, 255, 255, 0.2) !important;
    opacity: 1 !important;
}

/* Sumário - altura inicial menor */
#kb-summary {
    min-height: 60px;
}

/* Contexto - altura inicial maior */
#kb-content {
    min-height: 150px;
}

/* Fix alignment for KB create when using product-form structure */
#view-kb-create .product-edit-container {
    padding: 47px 25px 20px 25px;
    max-width: 600px;
    margin: 0 auto;
    box-sizing: border-box;
    width: 100%;
}

#view-kb-create .product-form {
    padding: 0;
    width: 100%;
}

#view-kb-create .product-form-group {
    width: 100%;
}

#view-kb-create .product-form-group input,
#view-kb-create .product-form-group textarea {
    width: 100% !important;
    box-sizing: border-box;
}

#view-kb-create .product-form-actions {
    width: 100%;
    margin-top: 20px;
}

#view-kb-create .product-form-actions .product-form-btn {
    width: 100%;
}

/* Fix alignment for KB edit when using product-form structure */
#view-kb-edit .product-edit-container {
    padding: 47px 25px 20px 25px;
    max-width: 600px;
    margin: 0 auto;
    box-sizing: border-box;
    width: 100%;
}

#view-kb-edit .product-form {
    padding: 0;
    width: 100%;
}

#view-kb-edit .product-form-group {
    width: 100%;
}

#view-kb-edit .product-form-group input,
#view-kb-edit .product-form-group textarea {
    width: 100% !important;
    box-sizing: border-box;
}

#view-kb-edit .product-form-actions {
    width: 100%;
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#view-kb-edit .product-form-actions .product-form-btn {
    flex: 1 1 0;
    min-width: 0;
    margin-top: 0;
    padding: 14px 12px;
}

/* Product Create Section (Flat Style) */
#view-product-create .product-edit-container {
    padding: 55px 25px 20px 25px;
    max-width: 600px;
    margin: 0 auto;
    box-sizing: border-box;
    width: 100%;
}

#view-product-create .product-form {
    padding: 0;
    width: 100%;
}

#view-product-create .product-form-group {
    width: 100%;
}

#view-product-create .product-form-group input,
#view-product-create .product-form-group textarea {
    width: 100% !important;
    box-sizing: border-box;
}

#view-product-create .product-form-actions {
    width: 100%;
    margin-top: 20px;
}

#view-product-create .product-form-actions .product-form-btn {
    width: 100%;
}

/* Product Edit - same styles as Create */
#view-product-edit .product-edit-container {
    padding: 55px 25px 20px 25px;
    max-width: 600px;
    margin: 0 auto;
    box-sizing: border-box;
    width: 100%;
}

#view-product-edit .product-form {
    padding: 0;
    width: 100%;
}

#view-product-edit .product-form-group {
    width: 100%;
}

#view-product-edit .product-form-group input,
#view-product-edit .product-form-group textarea {
    width: 100% !important;
    box-sizing: border-box;
}

#view-product-edit .product-form-actions {
    width: 100%;
    margin-top: 20px;
}

#view-product-edit .product-form-actions .product-form-btn {
    width: 100%;
}

/* Actions */
.kb-create-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.kb-create-cancel-btn,
.kb-create-save-btn {
    flex: 1;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.kb-create-cancel-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
}

.kb-create-cancel-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.kb-create-save-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
}

.kb-create-save-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.kb-create-save-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Button icon + text layout */
.kb-create-cancel-btn,
.kb-create-save-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.kb-create-cancel-btn svg,
.kb-create-save-btn svg {
    flex-shrink: 0;
}

/* Status message */
.kb-create-status {
    text-align: center;
    font-size: 0.9rem;
    margin-top: 16px;
    padding: 12px;
    border-radius: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.kb-create-status.visible {
    opacity: 1;
}

.kb-create-status.success {
    background: rgba(76, 175, 80, 0.2);
    color: #81C784;
}

.kb-create-status.error {
    background: rgba(244, 67, 54, 0.2);
    color: #E57373;
}

/* Mobile responsiveness */
@media (max-width: 480px) {
    .kb-create-container {
        padding: 1rem;
    }

    .kb-create-card {
        padding: 20px;
        border-radius: 20px;
    }

    .kb-create-card-icon {
        width: 48px;
        height: 48px;
        min-width: 48px;
    }

    .kb-create-card-icon svg {
        width: 24px;
        height: 24px;
    }

    .kb-create-card-title h4 {
        font-size: 1.1rem;
    }
}


/* * ================================================================================================
 * [SECTION ACTION BARS] - Toolbar buttons for each view section
 * ================================================================================================
 */
.section-action-bar {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 60px);
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transform: translateX(20px);
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Show action bar when its view is active */
#view-home.active-view ~ .section-action-bar,
#view-home.active-view #home-action-bar,
.app-view.active-view > .section-action-bar {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

/* Direct child selector for active views */
#view-home.active-view > .section-action-bar,
#view-products.active-view > .section-action-bar,
#view-agenda.active-view > .section-action-bar {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

.action-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(30, 30, 35, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.action-btn svg {
    width: 20px;
    height: 20px;
    stroke: rgba(255, 255, 255, 0.7);
    transition: stroke 0.2s ease;
}

.action-btn:hover,
.action-btn:active {
    background: rgba(50, 50, 55, 0.9);
    transform: scale(1.05);
}

.action-btn:hover svg,
.action-btn:active svg {
    stroke: rgba(255, 255, 255, 0.95);
}

.action-btn.action-btn-primary {
    background: var(--accent, #0a84ff);
    border-color: rgba(255, 255, 255, 0.2);
}

.action-btn.action-btn-primary svg {
    stroke: #ffffff;
}

.action-btn.action-btn-primary:hover,
.action-btn.action-btn-primary:active {
    background: var(--accent, #0a84ff);
    filter: brightness(1.15);
}

/* Hide action bars when not in their view */
#home-action-bar,
#products-action-bar,
#agenda-action-bar {
    opacity: 0;
    pointer-events: none;
    transform: translateX(20px);
}

/* Active states based on body class or view */
body.mode-home #home-action-bar,
#view-home.active-view #home-action-bar {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

body.mode-products #products-action-bar,
#view-products.active-view #products-action-bar {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

body.mode-agenda #agenda-action-bar,
#view-agenda.active-view #agenda-action-bar {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}
