:root {
    /* Gentle Gradient Palette */
    --primary-bg: #eef2f6;
    /* Soft blue-grey background */
    --sidebar-bg: #ffffff;
    --card-bg: #ffffff;

    /* Gradients */
    --accent-gradient: linear-gradient(135deg, #a78bfa 0%, #818cf8 100%);
    /* Soft Violet to Indigo */
    --hover-gradient: linear-gradient(135deg, #c4b5fd 0%, #a5b4fc 100%);

    /* Text Colors */
    --text-main: #334155;
    /* Slate 700 */
    --text-muted: #64748b;
    /* Slate 500 */
    --text-light: #94a3b8;
    /* Slate 400 */

    /* Borders & Shadows */
    --border-subtle: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

    /* Layout */
    --sidebar-width: 280px;
    --header-height: 70px;

    /* Radius */
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Noto Sans JP', sans-serif;
    background-color: var(--primary-bg);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
    font-size: 14px;
    line-height: 1.5;
}

/* App Shell */
.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    padding: 24px;
    padding-bottom: 150px;
    /* Ensure bottom items are visible */
    gap: 24px;
    z-index: 10;
    overflow-y: auto;
    /* Enable scrolling */
    height: 100vh;
}

.sidebar-header .logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

.sidebar-header .logo-icon {
    font-size: 24px;
}

.sidebar-header h1 {
    font-size: 20px;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

.sidebar-header .subtitle {
    color: var(--text-light);
    font-size: 12px;
    font-weight: 500;
}

/* Search */
.search-container {
    position: relative;
}

.search-box {
    position: relative;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-light);
}

.search-box input {
    width: 100%;
    padding: 10px 12px 10px 36px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--primary-bg);
    color: var(--text-main);
    font-size: 14px;
    transition: all 0.2s ease;
}

.search-box input:focus {
    outline: none;
    border-color: #818cf8;
    /* Indigo 400 */
    background: white;
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.1);
}

/* Categories */
.category-nav h3 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-light);
    margin-bottom: 12px;
    font-weight: 600;
}

.category-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.category-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-muted);
}

.category-item:hover {
    background: var(--primary-bg);
    color: var(--text-main);
}

.category-item.checked {
    background: #eff6ff;
    /* Blue 50 */
    color: #4f46e5;
    /* Indigo 600 */
    font-weight: 600;
}

.category-item input {
    display: none;
    /* Hide default checkbox */
}

/* Main Content */
.main-content {
    overflow-y: auto;
    overflow-y: auto;
    padding: 32px 40px 180px 40px;
    /* Extra bottom padding */
    position: relative;
    position: relative;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.main-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
}

/* Grid */
.ai-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    gap: 20px;
    padding-bottom: 0px;
    /* Padding handled by main-content now */
    /* Space for dock */
}

/* AI Cards */
.ai-card-item {
    /* Renamed for clarity in JS mapping if needed, but styling class */
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid transparent;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.ai-card-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: #c7d2fe;
}

.ai-card-item.checked {
    border: 2px solid #818cf8;
    background: #fbfbfe;
}

/* Simple checkmark indicator for selected state */
.ai-card-item.checked::after {
    content: "âœ“";
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--accent-gradient);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    box-shadow: var(--shadow-sm);
}

.ai-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 12px;
}

.ai-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
}

.ai-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.ai-tag {
    font-size: 10px;
    padding: 3px 8px;
    background: var(--primary-bg);
    border-radius: var(--radius-full);
    color: var(--text-muted);
    font-weight: 500;
}

.tool-description {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 8px;
    line-height: 1.6;
}

/* Hidden input for logic */
.ai-card-item input[type="checkbox"] {
    display: none;
}

/* Bottom Dock */
.dock-container {
    position: fixed;
    bottom: 30px;
    left: calc(var(--sidebar-width) + 40px);
    right: 40px;
    display: flex;
    justify-content: center;
    pointer-events: none;
    /* Let clicks pass through outside dock */
    z-index: 50;
}

.dock {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 12px 24px;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    gap: 32px;
    pointer-events: auto;
    transform: translateY(100px);
    /* Hidden by default */
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Show dock when items selected (handled by JS toggling class) */
body.has-selection .dock {
    transform: translateY(0);
    opacity: 1;
}

.dock-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.selected-count {
    background: var(--text-main);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

.dock-label {
    font-weight: 600;
    color: var(--text-main);
}

.dock-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-text {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-weight: 500;
    font-size: 13px;
}

.btn-text:hover {
    color: var(--text-main);
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(129, 140, 248, 0.3);
    transition: all 0.2s;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(129, 140, 248, 0.4);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Modal */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    /* Slide up from bottom */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}


.modal-content {
    background: white;
    width: 95%;
    /* Wider */
    height: 92vh;
    /* Higher */
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.1);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.modal-backdrop.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    padding: 20px 24px;
    /* Compact padding */
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 18px;
    /* Compact font */
    font-weight: 700;
}

.btn-close {
    background: #f1f5f9;
    border: none;
    width: 28px;
    /* Compact size */
    height: 28px;
    border-radius: 50%;
    font-size: 18px;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.btn-close:hover {
    background: #e2e8f0;
}


.modal-body {
    padding: 24px;
    /* Compact padding */
    overflow-y: auto;
    flex: 1;
    background: var(--primary-bg);
}

.comparison-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    /* Force 4 columns */
    gap: 16px;
    /* Compact gap */
}

/* Detailed Comparison Cards in Modal */
.ai-detail-card {
    background: white;
    padding: 16px;
    /* Compact padding */
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-subtle);
}

.ai-detail-card h3 {
    margin-bottom: 12px;
    color: #4f46e5;
    font-size: 16px;
    /* Smaller title */
}

.detail-section {
    margin-bottom: 12px;
}

.detail-section h4 {
    font-size: 11px;
    /* Smaller header */
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.detail-section ul {
    list-style: none;
}

.detail-section li {
    font-size: 13px;
    /* Smaller text */
    margin-bottom: 4px;
    position: relative;
    padding-left: 14px;
}

.detail-section li::before {
    content: "â€¢";
    color: #818cf8;
    position: absolute;
    left: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
        /* For now, hide sidebar on mobile to simplify. In real app, hamburger menu. */
    }

    .dock-container {
        left: 20px;
        right: 20px;
    }
}/ *   L a n g u a g e   T o g g l e   * /  
 . h e a d e r - c o n t e n t   {  
         d i s p l a y :   f l e x ;  
         j u s t i f y - c o n t e n t :   s p a c e - b e t w e e n ;  
         a l i g n - i t e m s :   c e n t e r ;  
         w i d t h :   1 0 0 % ;  
 }  
  
 . h e a d e r - r i g h t   {  
         m a r g i n - l e f t :   a u t o ;  
 }  
  
 . l a n g - t o g g l e   {  
         b a c k g r o u n d :   r g b a ( 2 5 5 ,   2 5 5 ,   2 5 5 ,   0 . 2 ) ;  
         b o r d e r :   1 p x   s o l i d   r g b a ( 2 5 5 ,   2 5 5 ,   2 5 5 ,   0 . 3 ) ;  
         b o r d e r - r a d i u s :   2 0 p x ;  
         p a d d i n g :   8 p x   1 6 p x ;  
         c o l o r :   w h i t e ;  
         c u r s o r :   p o i n t e r ;  
         f o n t - s i z e :   0 . 9 r e m ;  
         d i s p l a y :   f l e x ;  
         a l i g n - i t e m s :   c e n t e r ;  
         g a p :   6 p x ;  
         t r a n s i t i o n :   a l l   0 . 3 s   e a s e ;  
         b a c k d r o p - f i l t e r :   b l u r ( 1 0 p x ) ;  
 }  
  
 . l a n g - t o g g l e : h o v e r   {  
         b a c k g r o u n d :   r g b a ( 2 5 5 ,   2 5 5 ,   2 5 5 ,   0 . 3 ) ;  
         t r a n s f o r m :   t r a n s l a t e Y ( - 1 p x ) ;  
 }  
  
 . l a n g - i c o n   {  
         f o n t - s i z e :   1 . 1 r e m ;  
 }  
 / *   A I   C a r d   U p d a t e s   f o r   B i l i n g u a l   &   L a y o u t   * /  
 . a i - c a r d - i t e m   {  
         p a d d i n g :   1 6 p x ;  
         d i s p l a y :   f l e x ;  
         f l e x - d i r e c t i o n :   c o l u m n ;  
         g a p :   1 2 p x ;  
 }  
  
 . a i - c a r d - h e a d e r   {  
         d i s p l a y :   f l e x ;  
         f l e x - d i r e c t i o n :   c o l u m n ;  
         g a p :   8 p x ;  
         p o s i t i o n :   r e l a t i v e ;  
         p a d d i n g - b o t t o m :   0 ;  
         m a r g i n - b o t t o m :   0 ;  
         b o r d e r - b o t t o m :   n o n e ;  
 }  
  
 . a i - n a m e - a c t i o n s   {  
         d i s p l a y :   f l e x ;  
         j u s t i f y - c o n t e n t :   s p a c e - b e t w e e n ;  
         a l i g n - i t e m s :   f l e x - s t a r t ;  
 }  
  
 . a i - n a m e - a c t i o n s   h 3   {  
         m a r g i n :   0 ;  
         f o n t - s i z e :   1 . 1 r e m ;  
         f o n t - w e i g h t :   7 0 0 ;  
 }  
  
 . a i - c a r d - s e l e c t - o v e r l a y   {  
         p o s i t i o n :   a b s o l u t e ;  
         t o p :   0 ;  
         r i g h t :   0 ;  
 }  
  
 . a i - c a r d - b o d y - p r e v i e w   {  
         d i s p l a y :   f l e x ;  
         f l e x - d i r e c t i o n :   c o l u m n ;  
         g a p :   6 p x ;  
         f o n t - s i z e :   0 . 9 r e m ;  
         c o l o r :   v a r ( - - t e x t - c o l o r ) ;  
 }  
  
 . a i - p r i c e - m i n i   {  
         c o l o r :   v a r ( - - a c c e n t - c o l o r ) ;  
         f o n t - w e i g h t :   5 0 0 ;  
         f o n t - s i z e :   0 . 8 5 r e m ;  
         m a r g i n :   0 ;  
 }  
  
 . a i - f e a t u r e s - m i n i   {  
         l i s t - s t y l e :   n o n e ;  
         p a d d i n g :   0 ;  
         m a r g i n :   0 ;  
         d i s p l a y :   f l e x ;  
         f l e x - d i r e c t i o n :   c o l u m n ;  
         g a p :   2 p x ;  
 }  
  
 . a i - f e a t u r e s - m i n i   l i   {  
         f o n t - s i z e :   0 . 8 5 r e m ;  
         c o l o r :   v a r ( - - t e x t - m u t e d ) ;  
         l i n e - h e i g h t :   1 . 4 ;  
         p a d d i n g - l e f t :   0 ;  
         p o s i t i o n :   r e l a t i v e ;  
 }  
  
 . a i - f e a t u r e s - m i n i   l i : : b e f o r e   {  
         c o n t e n t :   " ¶zbÿ" ;  
         c o l o r :   v a r ( - - a c c e n t - c o l o r ) ;  
         m a r g i n - r i g h t :   6 p x ;  
 }  
  
 / *   H i d e   c h e c k b o x   b u t   k e e p   f u n c t i o n a l i t y   v i a   o v e r l a y / c l i c k   * /  
 . a i - c a r d - s e l e c t - o v e r l a y   i n p u t [ t y p e = " c h e c k b o x " ]   {  
         w i d t h :   2 0 p x ;  
         h e i g h t :   2 0 p x ;  
         c u r s o r :   p o i n t e r ;  
         a c c e n t - c o l o r :   v a r ( - - a c c e n t - c o l o r ) ;  
 }  
 