 :root {
     /* Palette moderna e vibrante */
     --bg-primary: #ffffff;
     --bg-secondary: #fafbfc;
     --bg-tertiary: #f0f2f5;
     --bg-quaternary: #e4e6eb;
     --text-primary: #050505;
     --text-secondary: #65676b;
     --text-accent: #667eea;
     --accent-secondary: #764ba2;
     --border-color: #e4e6eb;
     --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
     --gradient-chat: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
     --gradient-upgrade: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
     --button-hover: #f0f2f5;
     --input-bg: #f0f2f5;
     --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
     --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
     --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
     --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
     --radius-sm: 8px;
     --radius-md: 12px;
     --radius-lg: 16px;
     --radius-xl: 20px;
     --radius-full: 50px;
 }


 [data-theme="dark"] {
     --bg-primary: #0a0a0b;
     --bg-secondary: #18181b;
     --bg-tertiary: #27272a;
     --bg-quaternary: #3f3f46;
     --text-primary: #fafafa;
     --text-secondary: #a1a1aa;
     --text-accent: #818cf8;
     --accent-secondary: #a78bfa;
     --border-color: #27272a;
     --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
     --gradient-chat: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
     --gradient-upgrade: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
     --button-hover: #27272a;
     --input-bg: #18181b;
     --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
     --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
     --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
     --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.6);
 }


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

 html {
     zoom: 1 !important;
     -moz-transform: scale(1) !important;
     -webkit-transform: scale(1) !important;
     transform: scale(1) !important;
     -ms-text-size-adjust: 100% !important;
     -webkit-text-size-adjust: 100% !important;
     text-size-adjust: 100% !important;
     font-size: 16px !important;
 }

 body {
     font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
     background: var(--bg-primary);
     color: var(--text-primary);
     height: 100vh;
     display: flex;
     overflow: hidden;
     transition: background-color 0.35s cubic-bezier(0.4, 0, 0.2, 1), color 0.35s ease;
     -webkit-font-smoothing: antialiased;
     -moz-osx-font-smoothing: grayscale;
 }

 .theme-toggle {
     background: var(--bg-tertiary);
     border: none;
     color: var(--text-secondary);
     cursor: pointer;
     padding: 10px;
     border-radius: var(--radius-md);
     font-size: 20px;
     transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
     width: 44px;
     height: 44px;
     display: flex;
     align-items: center;
     justify-content: center;
 }

 .theme-toggle:hover {
     background: var(--gradient-chat);
     color: #ffffff;
     transform: rotate(15deg) scale(1.05);
     box-shadow: var(--shadow-md);
 }

 .theme-toggle:active {
     transform: rotate(15deg) scale(0.95);
 }

 .assistant-name {
     margin: 0 0 8px 0;
     font-size: 15px;
     font-weight: 600;
     color: var(--text-accent);
 }

 .loading-overlay {
     display: none;
     position: absolute;
     bottom: 109px;
     left: 0%;
     right: 0;
     justify-content: center;
     padding-bottom: 10px;
     z-index: 10;
 }

 .sidebar {
     width: 280px;
     background: var(--bg-secondary);
     border-right: 1px solid var(--border-color);
     display: flex;
     flex-direction: column;
     padding: 20px 16px;
     transition: width 0.25s ease, padding 0.25s ease;
     position: relative;
     z-index: 1000;
     backdrop-filter: blur(10px);
     box-shadow: var(--shadow-sm);
 }

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

 .sidebar-logo {
     width: 28px;
     height: 28px;
     object-fit: contain;
     border-radius: 6px;
 }

 .sidebar-icon-btn {
     background: none;
     border: none;
     color: var(--text-secondary);
     cursor: pointer;
     padding: 8px;
     border-radius: 8px;
     transition: background-color 0.15s ease, color 0.15s ease;
     display: flex;
     align-items: center;
     justify-content: center;
     width: 36px;
     height: 36px;
 }

 .sidebar-icon-btn:hover {
     background: var(--button-hover);
     color: var(--text-primary);
 }

 .sidebar-icon-btn.new-chat-btn {
     margin-left: auto;
 }

 /* Search Container */
 .search-container {
     display: none;
     align-items: center;
     gap: 8px;
     margin-bottom: 16px;
     background: var(--bg-tertiary);
     border-radius: 8px;
     padding: 4px 8px;
     border: 1px solid var(--border-color);
 }

 .search-container.show {
     display: flex;
 }

 .search-input {
     flex: 1;
     background: none;
     border: none;
     color: var(--text-primary);
     font-size: 14px;
     padding: 8px;
     outline: none;
 }

 .search-input::placeholder {
     color: var(--text-secondary);
 }

 .search-close-btn {
     background: none;
     border: none;
     color: var(--text-secondary);
     cursor: pointer;
     padding: 6px;
     border-radius: 6px;
     display: flex;
     align-items: center;
     justify-content: center;
 }

 .search-close-btn:hover {
     background: var(--button-hover);
     color: var(--text-primary);
 }

 /* Sidebar Collapsed State */
 .sidebar.collapsed {
     width: 60px;
     padding: 20px 10px;
 }

 .sidebar.collapsed .sidebar-header {
     flex-direction: column;
     gap: 12px;
 }

 .sidebar.collapsed .sidebar-icon-btn.new-chat-btn {
     margin-left: 0;
 }

 .sidebar.collapsed .search-container,
 .sidebar.collapsed .sidebar-section,
 .sidebar.collapsed .section-title,
 .sidebar.collapsed .chat-item-text,
 .sidebar.collapsed .footer-menu span,
 .sidebar.collapsed .sidebar-close-btn {
     display: none;
 }

 .sidebar.collapsed .footer-menu .chat-item {
     justify-content: center;
     padding: 10px;
 }

 .sidebar.collapsed .footer-menu .chat-item i {
     margin: 0;
 }

 .sidebar.collapsed .footer-toggle {
     padding: 8px;
 }

 .sidebar-section {
     margin-bottom: 8px;
 }

 .section-title {
     color: var(--text-secondary);
     font-size: 11px;
     font-weight: 600;
     margin-bottom: 4px;
     text-transform: uppercase;
     letter-spacing: 0.5px;
 }

 .chat-item {
     display: block;
     color: var(--text-secondary);
     text-decoration: none;
     padding: 6px 10px;
     border-radius: var(--radius-md);
     font-size: 13px;
     margin-bottom: 1px;
     white-space: nowrap;
     overflow: hidden;
     text-overflow: ellipsis;
     transition: background-color 0.15s ease, color 0.15s ease;
     cursor: pointer;
 }

 .chat-item:hover {
     background: var(--button-hover);
     color: var(--text-primary);
     transform: none;
 }

 .chat-item.active {
     background: var(--bg-tertiary);
     color: var(--text-primary);
     font-weight: 500;
 }

 .main-content {
     flex: 1;
     display: flex;
     flex-direction: column;
     position: relative;
     background: var(--bg-primary);
     min-height: 0;
     overflow: hidden;
 }

 .header {
     display: flex;
     align-items: center;
     justify-content: space-between;
     padding: 18px 28px;
     border-bottom: 1px solid var(--border-color);
     background: var(--bg-secondary);
     backdrop-filter: blur(10px);
     transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
     position: relative;
     z-index: 999;
     box-shadow: var(--shadow-sm);
 }

 .logo {
     display: flex;
     align-items: center;
     gap: 12px;
 }

 .logo h1 {
     color: var(--text-primary);
     font-size: 22px;
     font-weight: 400;
 }

 .version {
     color: var(--text-secondary);
     font-size: 13px;
     margin-left: 8px;
 }

 .header-actions {
     display: flex;
     align-items: center;
     gap: 12px;
 }

 .upgrade-btn {
     background: var(--gradient-upgrade);
     border: none;
     color: white;
     padding: 8px 16px;
     border-radius: 20px;
     font-size: 13px;
     cursor: pointer;
     display: flex;
     align-items: center;
     gap: 6px;
 }

 .chat-container {
     overflow: hidden;
     flex: 1;
     display: flex;
     flex-direction: column;
     max-width: 768px;
     margin: 0 auto;
     width: 100%;
     padding: 0 24px;
     position: relative;
 }

 .welcome-section {
     flex: 1;
     display: flex;
     flex-direction: column;
     justify-content: center;
     align-items: center;
     text-align: center;
     padding: 40px 0;
 }

 .welcome-title {
     font-size: 56px;
     font-weight: 700;
     margin-bottom: 32px;
     background: var(--gradient-chat);
     -webkit-background-clip: text;
     -webkit-text-fill-color: transparent;
     background-clip: text;
     letter-spacing: -0.02em;
     animation: fadeInUp 0.6s ease-out;
 }

 .suggestions {
     display: flex;
     gap: 12px;
     flex-wrap: wrap;
     justify-content: center;
     margin-bottom: 32px;
 }

 .suggestion-chip {
     background: var(--bg-tertiary);
     border: 2px solid var(--border-color);
     color: var(--text-primary);
     padding: 14px 24px;
     border-radius: var(--radius-full);
     font-size: 14px;
     font-weight: 500;
     cursor: pointer;
     transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
     box-shadow: var(--shadow-sm);
 }

 .suggestion-chip:hover {
     background: var(--gradient-chat);
     color: #ffffff;
     border-color: transparent;
     transform: translateY(-2px);
     box-shadow: var(--shadow-md);
 }

 .chat-messages::-webkit-scrollbar {
     width: 0;
     height: 0;
 }

 .chat-messages {
     flex: 1;
     scrollbar-width: none;
     -ms-overflow-style: none;
     overflow-y: auto;
     padding: 24px 0;
     display: none;
 }

 .message {
     margin-bottom: 32px;
     animation: slideUp 0.4s ease-out;
 }

 /* .user-message {
    background: var(--bg-tertiary);
    padding: 16px 20px;
    border-radius: 18px;
    margin-left: auto;
    max-width: 80%;
    width: fit-content;
    font-size: 16px;
    line-height: 1.5;
    transition: background-color 0.3s ease;
} */
 /* 
.ai-message {
    display: flex;
    gap: 16px;
    align-items: flex-start;
} */

 .ai-avatar {
     width: 32px;
     height: 32px;
     background: var(--gradient-primary);
     border-radius: 50%;
     display: flex;
     align-items: center;
     justify-content: center;
     color: white;
     font-size: 14px;
     font-weight: 600;
     flex-shrink: 0;
     margin-top: 4px;
 }

 .ai-content {
     flex: 1;
     font-size: 16px;
     line-height: 1.6;
 }

 .ai-content h3 {
     color: var(--text-primary);
     font-size: 18px;
     font-weight: 500;
     margin-bottom: 16px;
 }

 .ai-content p {
     margin-bottom: 16px;
     color: var(--text-primary);
 }

 .ai-content ol,
 .ai-content ul {
     margin-bottom: 16px;
     padding-left: 20px;
 }

 .ai-content li {
     margin-bottom: 12px;
     color: var(--text-primary);
 }

 .ai-content strong {
     color: var(--text-primary);
     font-weight: 600;
 }

 .ai-content a {
     color: var(--text-accent);
     text-decoration: none;
 }

 .ai-content a:hover {
     text-decoration: underline;
 }

 .input-section {
     padding: 24px 0;
     border-top: 1px solid var(--border-color);
     transition: border-color 0.3s ease;
 }

 .input-container {
     position: relative;
     background: var(--input-bg);
     border-radius: var(--radius-full);
     padding: 6px;
     display: flex;
     align-items: flex-end;
     gap: 10px;
     transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
     border: 2px solid transparent;
     box-shadow: var(--shadow-sm);
 }

 .input-container:focus-within {
     box-shadow: var(--shadow-md);
 }

 .chat-input {
     flex: 1;
     background: none;
     border: none;
     color: var(--text-primary);
     font-size: 16px;
     padding: 16px 20px;
     resize: none;
     outline: none;
     max-height: 200px;
     font-family: inherit;
 }

 .chat-input::placeholder {
     color: var(--text-secondary);
 }

 .input-actions {
     display: flex;
     align-items: center;
     gap: 16px;
     /* da 8px a 16px */
     padding: 8px 16px;
 }


 .action-btn {
     background: none;
     border: none;
     color: var(--text-secondary);
     cursor: pointer;
     padding: 8px;
     border-radius: 50%;
     width: 40px;
     height: 40px;
     display: flex;
     align-items: center;
     justify-content: center;
     transition: all 0.3s ease;
 }

 .action-btn:hover {
     background: var(--bg-quaternary);
 }

 .send-btn {
     background: var(--gradient-chat);
     border: none;
     color: white;
     cursor: pointer;
     padding: 10px;
     border-radius: 50%;
     width: 44px;
     height: 44px;
     display: flex;
     align-items: center;
     justify-content: center;
     opacity: 0.5;
     transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
     box-shadow: var(--shadow-sm);
 }

 .send-btn.active {
     opacity: 1;
 }

 .send-btn:hover.active {
     transform: scale(1.05);
     box-shadow: var(--shadow-md);
 }

 .send-btn:active.active {
     transform: scale(0.95);
 }

 .loading-message {
     display: none;
 }

 .loading-dots {
     display: flex;
     gap: 4px;
     padding: 20px 0;
 }

 .dot {
     width: 8px;
     height: 8px;
     background: var(--text-secondary);
     border-radius: 50%;
     animation: loadingDots 1.4s ease-in-out infinite both;
 }

 .dot:nth-child(1) {
     animation-delay: -0.32s;
 }

 .dot:nth-child(2) {
     animation-delay: -0.16s;
 }

 .dot:nth-child(3) {
     animation-delay: 0s;
 }

 .footer-note {
     text-align: center;
     color: var(--text-secondary);
     font-size: 12px;
     padding: 16px;
     border-top: 1px solid var(--border-color);
     transition: all 0.3s ease;
     flex-shrink: 0;
     position: relative;
     z-index: 10;
 }

 .footer-note a {
     color: var(--text-accent);
     text-decoration: none;
 }

 .action-btn.active {
     color: #1a73e8;
 }

 .theme-indicator {
     font-size: 12px;
     color: var(--text-secondary);
     margin-left: 8px;
     padding: 4px 8px;
     border-radius: 12px;
     background: var(--bg-tertiary);
     transition: all 0.3s ease;
 }

 /* Hamburger menu per mobile */
 .mobile-menu-btn {
     display: none;
     background: none;
     border: none;
     color: var(--text-primary);
     cursor: pointer;
     padding: 8px;
     border-radius: 8px;
     font-size: 20px;
     transition: all 0.3s ease;
 }

 .mobile-menu-btn:hover {
     background: var(--button-hover);
 }

 /* Backdrop per sidebar mobile */
 .sidebar-backdrop {
     display: none;
     position: fixed;
     top: 0;
     left: 0;
     width: 100%;
     height: 100%;
     background: rgba(0, 0, 0, 0.5);
     z-index: 999;
     opacity: 0;
     transition: opacity 0.3s ease;
 }

 .sidebar-backdrop.show {
     opacity: 1;
 }

 /* Close button per sidebar mobile */
 .sidebar-close-btn {
     display: none;
     position: absolute;
     top: 16px;
     right: 16px;
     background: none;
     border: none;
     color: var(--text-secondary);
     cursor: pointer;
     padding: 8px;
     border-radius: 50%;
     font-size: 18px;
     transition: all 0.3s ease;
 }

 .sidebar-close-btn:hover {
     background: var(--button-hover);
     color: var(--text-primary);
 }

 @keyframes slideUp {
     from {
         opacity: 0;
         transform: translateY(20px);
     }

     to {
         opacity: 1;
         transform: translateY(0);
     }
 }

 @keyframes fadeInUp {
     from {
         opacity: 0;
         transform: translateY(30px);
     }

     to {
         opacity: 1;
         transform: translateY(0);
     }
 }

 @keyframes loadingDots {

     0%,
     80%,
     100% {
         transform: scale(0);
         opacity: 0.5;
     }

     40% {
         transform: scale(1);
         opacity: 1;
     }
 }

 @keyframes slideInFromLeft {
     from {
         transform: translateX(-100%);
     }

     to {
         transform: translateX(0);
     }
 }

 @keyframes slideOutToLeft {
     from {
         transform: translateX(0);
     }

     to {
         transform: translateX(-100%);
     }
 }

 /* Media query ottimizzate per mobile */
 @media (max-width: 768px) {
     body {
         height: 100vh;
         height: 100dvh;
         /* Dynamic viewport height per browser mobili */
     }

     .sidebar {
         position: fixed;
         top: 0;
         left: 0;
         height: 100%;
         height: 100dvh;
         width: 85%;
         max-width: 320px;
         transform: translateX(-100%);
         transition: transform 0.3s ease;
         z-index: 1000;
         border-right: none;
         box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
     }

     .sidebar.show {
         transform: translateX(0);
         animation: slideInFromLeft 0.3s ease;
     }

     .sidebar-backdrop {
         display: block;
     }

     .sidebar-close-btn {
         display: block;
     }

     .sidebar-header {
         padding-right: 44px;
     }

     .mobile-menu-btn {
         display: block;
     }

     .main-content {
         width: 100%;
         height: 100vh;
         height: 100dvh;
         flex-direction: column;
     }

     .header {
         padding: 12px 16px;
         min-height: 60px;
         flex-shrink: 0;
     }

     .logo {
         flex: 1;
     }

     .logo img {
         height: 35px !important;
         width: 60px !important;
     }

     .theme-indicator {
         display: none;
         /* Nascosto su mobile per risparmiare spazio */
     }

     .header-actions {
         gap: 8px;
     }

     .header-actions .action-btn {
         width: 36px;
         height: 36px;
         padding: 6px;
     }

     .chat-container {
         flex: 1;
         padding: 0 16px;
         max-width: none;
         width: 100%;
         display: flex;
         flex-direction: column;
         height: calc(100vh - 60px);
         height: calc(100dvh - 60px);
     }

     .welcome-section {
         flex: 1;
         padding: 20px 0;
         justify-content: flex-start;
         padding-top: 10vh;
     }

     .welcome-title {
         font-size: 32px;
         margin-bottom: 24px;
     }

     .suggestions {
         flex-direction: column;
         align-items: stretch;
         gap: 8px;
         margin-bottom: 24px;
     }

     .suggestion-chip {
         padding: 16px 20px;
         text-align: left;
         border-radius: 12px;
     }

     .chat-messages {
         flex: 1;
         padding: 16px 0;
         margin-bottom: 0;
         min-height: 0;
     }

     .message {
         margin-bottom: 20px;
     }

     .user-message {
         max-width: 90%;
         font-size: 16px;
         padding: 12px 16px;
         border-radius: 16px;
     }

     .ai-message {
         gap: 12px;
     }

     .ai-avatar {
         width: 28px;
         height: 28px;
         font-size: 12px;
         margin-top: 2px;
     }

     .ai-content {
         font-size: 15px;
         line-height: 1.5;
     }

     .ai-content h3 {
         font-size: 16px;
         margin-bottom: 12px;
     }

     .ai-content p {
         margin-bottom: 12px;
     }

     .input-section {
         padding: 16px 0;
         border-top: 1px solid var(--border-color);
         background: var(--bg-primary);
         flex-shrink: 0;
         position: sticky;
         bottom: 0;
         z-index: 100;
     }

     .input-container {
         border-radius: 24px;
         padding: 4px;
         box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
     }

     .chat-input {
         font-size: 16px;
         padding: 12px 16px;
         max-height: 120px;
     }

     .input-actions {
         padding: 4px 8px;
         gap: 4px;
     }

     .action-btn {
         width: 36px;
         height: 36px;
         padding: 6px;
         font-size: 14px;
     }

     .send-btn {
         width: 36px;
         height: 36px;
         padding: 6px;
     }

     .loading-overlay {
         bottom: 85px;
     }

     .footer-note {
         display: none;
         /* Nascosto su mobile per risparmiare spazio */
     }

     /* Migliora il touch target */
     .chat-item {
         padding: 12px 16px;
         font-size: 15px;
         margin-bottom: 2px;
     }

     .sidebar-icon-btn {
         touch-action: manipulation;
     }

     /* Assicura che gli elementi interattivi siano facilmente toccabili */
     button,
     .chat-item,
     .suggestion-chip {
         min-height: 44px;
         touch-action: manipulation;
     }

     /* Previeni lo zoom su focus input */
     .chat-input {
         font-size: 16px !important;
     }

     /* Gestisci meglio la tastiera virtuale */
     .chat-container {
         padding-bottom: env(keyboard-inset-height, 0);
     }
 }

 /* Media query per schermi molto piccoli */
 @media (max-width: 480px) {
     .sidebar {
         width: 90%;
         max-width: 280px;
     }

     .welcome-title {
         font-size: 28px;
     }

     .chat-container {
         padding: 0 12px;
     }

     .input-section {
         padding: 12px 0;
     }

     .suggestions {
         margin-bottom: 16px;
     }
 }

 /* Supporto per notch e safe area */
 @media (max-width: 768px) {
     .header {
         padding-top: max(12px, env(safe-area-inset-top));
         padding-left: max(16px, env(safe-area-inset-left));
         padding-right: max(16px, env(safe-area-inset-right));
     }

     .input-section {
         padding-bottom: max(16px, env(safe-area-inset-bottom));
         padding-left: max(16px, env(safe-area-inset-left));
         padding-right: max(16px, env(safe-area-inset-right));
     }

     .sidebar {
         padding-left: max(16px, env(safe-area-inset-left));
     }

     .chat-item {
         padding: 12px 16px;
         font-size: 15px;
         margin-bottom: 2px;
         touch-action: manipulation;
     }
 }

 .dropdown-wrapper {
     position: relative;
     bottom: 0px;
     top: 20px;
 }

 .dropdown-menu {
     position: absolute;
     top: 100%;
     left: 50%;
     transform: translateX(-50%);
     background: var(--bg-secondary);
     border: 1px solid var(--border-color);
     border-radius: 12px;
     padding: 4px;
     display: none;
     flex-direction: column;
     gap: 4px;
     z-index: 999;
     box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
     min-width: 200px;
     max-width: 90vw;
 }

 /* Override solo dentro il dropdown da mobile */
 .dropdown-menu .action-btn {
     width: auto !important;
     height: auto !important;
     border-radius: 6px !important;
     padding: 8px 12px !important;
     display: flex !important;
     align-items: center;
     gap: 8px;
     font-size: 14px;
     white-space: nowrap;
 }

 @media (min-width: 769px) {
     .dropdown-menu {
         position: absolute;
         bottom: 120%;
         right: 0;
         background: var(--bg-secondary);
         border: 1px solid var(--border-color);
         border-radius: 12px;
         padding: 6px;
         display: none;
         flex-direction: column;
         gap: 6px;
         z-index: 999;
         box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
     }

     .dropdown-toggle {
         display: flex;
         align-items: center;
         gap: 8px;
         background: var(--bg-tertiary);
         color: var(--text-primary);
         padding: 8px 12px;
         border-radius: 8px;
         border: none;
         font-size: 14px;
     }
 }

 .dropdown-menu .action-btn {
     width: 40px;
     height: 40px;
     padding: 8px;
     border-radius: 50%;
     justify-content: center;
 }

 /* Mostra sempre le icone su desktop */
 @media (min-width: 769px) {
     .dropdown-menu {
         display: flex !important;
         position: static;
         border: none;
         background: none;
         box-shadow: none;
         padding: 0;
         flex-direction: row;
         gap: 8px;
     }

     .dropdown-toggle {
         display: none !important;
     }
 }

 /* Solo su desktop: nasconde il testo accanto alle icone */
 @media (min-width: 769px) {
     .dropdown-menu .action-btn i {
         margin: 0;
         /* toglie spazio extra */
     }

     .dropdown-menu .action-btn {
         width: 40px;
         height: 40px;
         justify-content: center;
         padding: 8px;
         border-radius: 50%;
         overflow: hidden;
     }

     .dropdown-menu .action-btn span {
         display: none;
         /* nasconde il testo */
     }
 }

 .chat-item {
     display: flex;
     align-items: center;
     justify-content: space-between;
     color: var(--text-secondary);
     text-decoration: none;
     padding: 8px 12px;
     border-radius: 8px;
     font-size: 14px;
     margin-bottom: 4px;
     transition: all 0.3s ease;
     position: relative;
     cursor: pointer;
 }

 .chat-item-text {
     flex: 1;
     overflow: hidden;
     text-overflow: ellipsis;
     white-space: nowrap;
 }

 /* Chat item actions (archive + delete) */
 .chat-item-actions {
     display: flex;
     align-items: center;
     gap: 4px;
     margin-left: auto;
     flex-shrink: 0;
 }

 .chat-item-actions button {
     display: flex;
     align-items: center;
     justify-content: center;
     width: 26px;
     height: 26px;
     border: none;
     border-radius: 6px;
     background: transparent;
     cursor: pointer;
     color: var(--text-secondary);
     font-size: 13px;
     transition: background-color 0.15s ease, color 0.15s ease;
 }

 .chat-item-actions .archive-btn:hover {
     background: rgba(102, 126, 234, 0.15);
     color: #667eea;
 }

 .chat-item-actions .delete-btn:hover {
     background: rgba(239, 68, 68, 0.15);
     color: #ef4444;
 }

 /* -----------------------------------------------------------------
   MSG BUBBLES — stile dei messaggi spostato dall’<style> inline
   ----------------------------------------------------------------- */

 .message {
     display: flex;
     align-items: flex-start;
     margin-bottom: 12px;
     padding: 10px 14px;
     border-radius: var(--radius-md);
     max-width: 80%;
     min-height: 70px;
     word-wrap: break-word;
     animation: none;
     box-shadow: none;
 }

 .message:hover {
     box-shadow: none;
     transform: none;
 }

 .message>div:last-child {
     display: flex;
     flex-direction: column;
     gap: 2px;
 }

 .message.user {
     background: var(--gradient-chat);
     color: #ffffff;
     align-self: flex-end;
     margin-left: auto;
     border: 1px solid transparent;
     border-bottom-right-radius: 4px;
 }

 .message.assistant {
     background: var(--bg-tertiary);
     color: var(--text-primary);
     align-self: flex-start;
     margin-right: auto;
     border: 1px solid var(--border-color);
     border-bottom-left-radius: 4px;
 }

 .message-avatar {
     margin-right: 10px;
     font-size: 20px;
     flex-shrink: 0;
 }

 .message.user .message-avatar {
     color: #ffffff;
     font-weight: 600;
     background: rgba(255, 255, 255, 0.2);
     width: 28px;
     height: 28px;
     border-radius: 50%;
     display: flex;
     align-items: center;
     justify-content: center;
     font-size: 12px;
 }

 .message-content {
     font-size: 14px;
     line-height: 1.5;
     color: inherit;
     overflow-wrap: break-word;
     word-wrap: break-word;
     word-break: break-word;
 }

 /* Stili per liste dentro i messaggi */
 .message-content ul,
 .message-content ol {
     margin: 8px 0;
     padding-left: 20px;
     list-style-position: inside;
 }

 .message-content li {
     margin: 4px 0;
     padding-left: 4px;
     list-style-position: inside;
 }

 /* Stili per li orfani (senza ul/ol parent) */
 .message-content > li {
     display: list-item;
     list-style-type: disc;
     list-style-position: inside;
     margin-left: 0;
     padding-left: 0;
 }

 .message-content ul li {
     list-style-type: disc;
 }

 .message-content ol li {
     list-style-type: decimal;
 }

 /* Stili per code blocks */
 .message-content code {
     background-color: rgba(0, 0, 0, 0.08);
     padding: 2px 6px;
     border-radius: 4px;
     font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
     font-size: 13px;
 }

 .message-content pre {
     background-color: rgba(0, 0, 0, 0.08);
     padding: 12px;
     border-radius: 8px;
     overflow-x: auto;
     margin: 8px 0;
 }

 .message-content pre code {
     background: none;
     padding: 0;
 }

 /* Stili per paragrafi e titoli */
 .message-content p {
     margin: 8px 0;
 }

 .message-content p:first-child {
     margin-top: 0;
 }

 .message-content p:last-child {
     margin-bottom: 0;
 }

 .message-content strong,
 .message-content b {
     font-weight: 600;
 }

 .message-content h1,
 .message-content h2,
 .message-content h3,
 .message-content h4 {
     margin: 12px 0 8px 0;
     font-weight: 600;
 }

 .message-content h1 { font-size: 1.3em; }
 .message-content h2 { font-size: 1.2em; }
 .message-content h3 { font-size: 1.1em; }
 .message-content h4 { font-size: 1em; }

 /* Link */
 .message-content a {
     color: var(--accent-color);
     text-decoration: underline;
 }

 .message.user .message-content {
     color: #ffffff;
 }

 .message.user .message-content a {
     color: #a8d4ff;
 }

 .message.user .message-content code {
     background-color: rgba(255, 255, 255, 0.15);
 }

 .message-time {
     font-size: 10px;
     color: var(--text-secondary);
     margin-top: 2px;
     opacity: 0;
     transition: opacity 0.2s ease;
 }

 .message:hover .message-time {
     opacity: 0.5;
 }

 .message.user .message-time {
     color: rgba(255, 255, 255, 0.8);
 }

 .auth-banner {
     position: fixed;
     bottom: 0;
     left: 0;
     width: 100%;
     background: #fff;
     border-top: 1px solid #e5e5e5;
     padding: 12px 20px;
     z-index: 9999;
     display: flex;
     flex-wrap: wrap;
     justify-content: space-between;
     align-items: center;
     box-shadow: 0 -3px 8px rgba(0, 0, 0, .05);
 }

 .auth-banner.hidden {
     display: none !important;
 }

 @media(max-width:540px) {
     .auth-actions {
         width: 100%;
         margin-top: 10px;
         text-align: center;
     }
 }

 .typing-indicator {
     display: flex;
     justify-content: center;
     align-items: center;
     height: 40px;
     gap: 6px;
     padding: 10px 0;
 }

 .typing-indicator span {
     display: inline-block;
     width: 8px;
     height: 8px;
     background-color: var(--text-secondary);
     border-radius: 50%;
     opacity: 0.4;
     animation: typingBlink 1.4s infinite both;
 }

 .typing-indicator span:nth-child(1) {
     animation-delay: 0s;
 }

 .typing-indicator span:nth-child(2) {
     animation-delay: 0.2s;
 }

 .typing-indicator span:nth-child(3) {
     animation-delay: 0.4s;
 }

 @keyframes typingBlink {

     0%,
     80%,
     100% {
         opacity: 0.4;
         transform: scale(0.8);
     }

     40% {
         opacity: 1;
         transform: scale(1);
     }
 }

 div#mobileActionsDropdown {
     background: transparent;
 }


 /* Stili per la modale */
 .modal {
     display: none;
     position: fixed;
     z-index: 1;
     left: 0;
     top: 0;
     width: 100%;
     height: 100%;
     background-color: rgba(0, 0, 0, 0.4);
     padding-top: 60px;
 }

 .modal-content {
     background-color: #fefefe;
     margin: 5% auto;
     padding: 20px;
     border: 1px solid #888;
     width: 80%;
     max-width: 600px;
 }

 .close-btn {
     color: #aaa;
     float: right;
     font-size: 28px;
     font-weight: bold;
 }

 .close-btn:hover,
 .close-btn:focus {
     color: black;
     text-decoration: none;
     cursor: pointer;
 }

 /* Animazione Tools */

/* ═══════════════════════════════════════════════════════════════════════════════
   DEVICES HUB - Card styles for device listing in chat
   ═══════════════════════════════════════════════════════════════════════════════ */

.devices-hub-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--primary-color, #667eea);
}

.devices-hub-header i {
    font-size: 1.1em;
}

.devices-hub-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.device-hub-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 12px;
    transition: all 0.2s ease;
    position: relative;
}

.device-hub-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.4);
}

.device-hub-card.offline {
    opacity: 0.6;
    background: linear-gradient(135deg, rgba(128, 128, 128, 0.08) 0%, rgba(100, 100, 100, 0.08) 100%);
    border-color: rgba(128, 128, 128, 0.2);
}

.device-hub-icon {
    font-size: 2rem;
    min-width: 48px;
    text-align: center;
}

.device-hub-info {
    flex: 1;
    min-width: 0;
}

.device-hub-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 4px;
    color: var(--text-primary, #1a1a2e);
}

.device-hub-status {
    font-size: 0.85rem;
    margin-bottom: 2px;
}

.device-hub-details {
    font-size: 0.8rem;
    color: var(--text-secondary, #666);
}

.device-hub-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.device-hub-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: var(--primary-color, #667eea);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s ease;
}

.device-hub-action-btn i {
    font-size: 1rem;
}

.device-hub-action-btn:hover:not(:disabled) {
    background: var(--primary-hover, #5a6fd6);
    transform: translateY(-1px);
}

.device-hub-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Device Output Dropdown */
.device-hub-output {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--card-background, #fff);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 12px;
    padding: 12px;
    min-width: 200px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 100;
}

.device-output-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(102, 126, 234, 0.15);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--primary-color, #667eea);
}

.device-output-header i {
    font-size: 0.9rem;
}

.device-output-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.device-output-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    color: var(--text-primary, #333);
}

.device-output-option:hover {
    background: rgba(102, 126, 234, 0.12);
}

.device-output-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color, #667eea);
    cursor: pointer;
}

.device-output-option i {
    width: 18px;
    text-align: center;
    color: var(--primary-color, #667eea);
    font-size: 0.9rem;
}

.device-output-option span {
    flex: 1;
}

/* Make device-hub-actions relative for dropdown positioning */
.device-hub-actions {
    position: relative;
}

/* Dark theme styles for Output dropdown */
body.dark-theme .device-hub-output {
    background: var(--card-background, #1a1a2e);
    border-color: rgba(102, 126, 234, 0.3);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

body.dark-theme .device-output-option {
    background: rgba(102, 126, 234, 0.1);
    color: var(--text-primary, #e0e0e0);
}

body.dark-theme .device-output-option:hover {
    background: rgba(102, 126, 234, 0.2);
}

/* Empty state */
.devices-empty-state {
    text-align: center;
    padding: 24px;
    color: var(--text-secondary, #666);
}

.devices-empty-state i {
    font-size: 3rem;
    margin-bottom: 12px;
    opacity: 0.5;
}

.devices-empty-state p {
    margin: 8px 0;
}

.devices-empty-hint {
    font-size: 0.85rem;
    opacity: 0.8;
}

.devices-download-btn {
    margin-top: 16px;
    padding: 10px 20px;
    background: var(--primary-color, #667eea);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.devices-download-btn:hover {
    background: var(--primary-hover, #5a6fd6);
}

/* Device Command Mode */
.device-command-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--primary-color, #667eea);
}

.device-command-close {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-secondary, #666);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.device-command-close:hover {
    background: rgba(0,0,0,0.1);
    color: var(--text-primary, #333);
}

.device-command-hint {
    margin-bottom: 8px;
    color: var(--text-secondary, #666);
}

.device-command-examples {
    margin: 0 0 12px 0;
    padding-left: 20px;
}

.device-command-examples li {
    margin: 6px 0;
    color: var(--text-secondary, #666);
}

.device-command-examples em {
    background: rgba(102, 126, 234, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-style: normal;
}

.device-command-note {
    font-size: 0.85rem;
    color: var(--text-secondary, #888);
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed rgba(102, 126, 234, 0.2);
}

.device-command-note i {
    color: var(--primary-color, #667eea);
    margin-right: 6px;
}

/* Device Actions List */
.device-actions-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.device-action-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(102, 126, 234, 0.08);
    border: 1px solid rgba(102, 126, 234, 0.15);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    color: var(--text-primary, #333);
}

.device-action-item:hover {
    background: rgba(102, 126, 234, 0.18);
    border-color: rgba(102, 126, 234, 0.4);
    transform: translateY(-1px);
}

.device-action-item:active {
    transform: scale(0.98);
}

.device-action-item i {
    font-size: 1rem;
    color: var(--primary-color, #667eea);
    width: 20px;
    text-align: center;
}

.device-action-item span {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Actions Pagination */
.device-actions-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
}

.action-page-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color, #667eea);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-page-btn:hover:not(:disabled) {
    background: var(--primary-hover, #5a6fd6);
    transform: scale(1.05);
}

.action-page-btn:disabled {
    background: rgba(102, 126, 234, 0.3);
    cursor: not-allowed;
}

.action-page-info {
    font-size: 0.85rem;
    color: var(--text-secondary, #666);
    font-weight: 500;
    min-width: 50px;
    text-align: center;
}

/* Command inserted animation */
#chatInput.command-inserted,
#messageInput.command-inserted,
.chat-input.command-inserted {
    animation: flash-insert 0.3s ease;
    border-color: var(--primary-color, #667eea) !important;
}

@keyframes flash-insert {
    0% { background-color: rgba(102, 126, 234, 0.3); }
    100% { background-color: transparent; }
}

/* Dark theme */
body.dark-theme .device-action-item {
    background: rgba(102, 126, 234, 0.12);
    border-color: rgba(102, 126, 234, 0.25);
    color: #e0e0e0;
}

body.dark-theme .device-action-item:hover {
    background: rgba(102, 126, 234, 0.25);
}

/* Responsive - single column on small screens */
@media (max-width: 500px) {
    .device-actions-list {
        grid-template-columns: 1fr;
    }
}

/* Folder Watch UI */
.folder-watch-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--primary-color, #667eea);
}

.folder-watch-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.folder-watch-input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-secondary, #666);
}

.folder-watch-input-wrapper {
    position: relative;
}

.folder-watch-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 8px;
    font-size: 0.9rem;
    background: var(--bg-secondary, #f8f9fa);
    transition: all 0.2s ease;
}

.folder-watch-input:focus {
    outline: none;
    border-color: var(--primary-color, #667eea);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.folder-watch-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 8px;
    margin-top: 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.folder-suggestion {
    padding: 10px 12px;
    cursor: pointer;
    font-size: 0.85rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    transition: background 0.15s ease;
}

.folder-suggestion:last-child {
    border-bottom: none;
}

.folder-suggestion:hover {
    background: rgba(102, 126, 234, 0.1);
}

.folder-watch-notifications label:first-child {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-secondary, #666);
}

.folder-watch-notify-options {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.folder-watch-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}

.folder-watch-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color, #667eea);
}

.folder-watch-submit {
    padding: 12px 20px;
    background: var(--primary-color, #667eea);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.folder-watch-submit:hover {
    background: var(--primary-hover, #5a6fd6);
}

.folder-watch-output {
    margin-top: 16px;
    border-top: 1px solid rgba(0,0,0,0.1);
    padding-top: 16px;
}

.folder-watch-output-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    font-weight: 500;
}

.folder-watch-stop {
    padding: 6px 12px;
    background: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.folder-watch-stop:hover {
    background: #c0392b;
}

.folder-watch-events {
    max-height: 200px;
    overflow-y: auto;
    font-size: 0.85rem;
}

.folder-watch-event {
    padding: 8px 10px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 6px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.folder-watch-event.add { border-left: 3px solid #27ae60; }
.folder-watch-event.change { border-left: 3px solid #f39c12; }
.folder-watch-event.unlink { border-left: 3px solid #e74c3c; }

/* Folder Browser */
.folder-browser {
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-secondary, #f8f9fa);
}

.folder-browser-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(102, 126, 234, 0.08);
    border-bottom: 1px solid rgba(102, 126, 234, 0.15);
}

.folder-browser-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-background, #fff);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 6px;
    cursor: pointer;
    color: var(--primary-color, #667eea);
    transition: all 0.2s ease;
}

.folder-browser-btn:hover:not(:disabled) {
    background: var(--primary-color, #667eea);
    color: #fff;
}

.folder-browser-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.folder-browser-path {
    flex: 1;
    font-size: 0.85rem;
    font-family: monospace;
    padding: 6px 10px;
    background: var(--card-background, #fff);
    border-radius: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-primary, #333);
}

.folder-browser-list {
    max-height: 250px;
    overflow-y: auto;
    padding: 8px;
}

.folder-browser-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 0.9rem;
}

.folder-browser-item.folder {
    color: var(--primary-color, #667eea);
}

.folder-browser-item.file {
    color: var(--text-secondary, #666);
    cursor: default;
    opacity: 0.6;
}

.folder-browser-item.folder:hover {
    background: rgba(102, 126, 234, 0.1);
}

.folder-browser-item.selected {
    background: rgba(102, 126, 234, 0.2);
    border: 1px solid var(--primary-color, #667eea);
}

.folder-browser-item i:first-child {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.folder-browser-item-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.folder-browser-select-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color, #667eea);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
}

.folder-browser-item:hover .folder-browser-select-btn {
    opacity: 1;
}

.folder-browser-select-btn:hover {
    background: var(--primary-hover, #5a6fd6);
    transform: scale(1.1);
}

.folder-browser-selected {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: rgba(39, 174, 96, 0.1);
    border-top: 1px solid rgba(39, 174, 96, 0.2);
    color: #27ae60;
    font-size: 0.9rem;
    font-weight: 500;
}

.folder-browser-selected i {
    font-size: 1.1rem;
}

.folder-browser-loading,
.folder-browser-empty,
.folder-browser-error {
    padding: 30px;
    text-align: center;
    color: var(--text-secondary, #666);
    font-size: 0.9rem;
}

.folder-browser-loading i,
.folder-browser-empty i,
.folder-browser-error i {
    font-size: 1.5rem;
    margin-bottom: 8px;
    display: block;
}

.folder-browser-error {
    color: #e74c3c;
}

.folder-watch-manual {
    padding-top: 12px;
    border-top: 1px dashed rgba(102, 126, 234, 0.2);
}

.folder-watch-manual label {
    font-size: 0.8rem;
    color: var(--text-secondary, #666);
    margin-bottom: 6px;
    display: block;
}

/* Active Watchers List */
.watchers-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--primary-color, #667eea);
}

.watchers-list-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.watcher-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 10px;
    transition: all 0.2s ease;
}

.watcher-card:hover {
    border-color: rgba(102, 126, 234, 0.4);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.watcher-card-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color, #667eea);
    color: #fff;
    border-radius: 10px;
    font-size: 1.2rem;
}

.watcher-card-info {
    flex: 1;
    min-width: 0;
}

.watcher-card-path {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary, #333);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.watcher-card-details {
    display: flex;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--text-secondary, #666);
    margin-bottom: 6px;
}

.watcher-card-details i {
    margin-right: 4px;
    opacity: 0.7;
}

.watcher-card-notifications {
    display: flex;
    gap: 6px;
}

.watcher-notify-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    font-size: 0.75rem;
}

.watcher-notify-badge.chat {
    background: rgba(52, 152, 219, 0.15);
    color: #3498db;
}

.watcher-notify-badge.push {
    background: rgba(155, 89, 182, 0.15);
    color: #9b59b6;
}

.watcher-notify-badge.email {
    background: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
}

.watcher-card-stop {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.watcher-card-stop:hover {
    background: #e74c3c;
    color: #fff;
}

.watchers-empty {
    text-align: center;
    padding: 30px;
    color: var(--text-secondary, #666);
}

.watchers-empty i {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.4;
}

.watchers-empty p {
    margin: 6px 0;
}

.watchers-empty-hint {
    font-size: 0.85rem;
    opacity: 0.7;
}

/* Dark theme support */
body.dark-theme .device-hub-card {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    border-color: rgba(102, 126, 234, 0.3);
}

body.dark-theme .device-hub-name {
    color: #e0e0e0;
}

body.dark-theme .device-hub-details {
    color: #999;
}

body.dark-theme .folder-watch-input {
    background: #353535;
    border-color: #404040;
    color: #e0e0e0;
}

body.dark-theme .folder-watch-suggestions {
    background: #2d2d2d;
    border-color: #404040;
}

body.dark-theme .folder-suggestion:hover {
    background: rgba(102, 126, 234, 0.2);
}

body.dark-theme .folder-browser {
    background: #2a2a2a;
    border-color: #404040;
}

body.dark-theme .folder-browser-toolbar {
    background: rgba(102, 126, 234, 0.12);
    border-color: #404040;
}

body.dark-theme .folder-browser-btn {
    background: #353535;
    border-color: #505050;
}

body.dark-theme .folder-browser-path {
    background: #353535;
    color: #e0e0e0;
}

body.dark-theme .folder-browser-item.folder:hover {
    background: rgba(102, 126, 234, 0.15);
}

body.dark-theme .folder-browser-item.selected {
    background: rgba(102, 126, 234, 0.25);
}

body.dark-theme .devices-empty-state {
    color: #999;
}