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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #0a0a0a;
    color: #fff;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Animated Background Graphic */
.background-graphic {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    background: 
        radial-gradient(circle at 20% 50%, rgba(46, 213, 115, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(0, 230, 118, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(52, 211, 153, 0.1) 0%, transparent 40%);
}

.background-graphic::before {
    content: '';
    position: absolute;
    width: 150%;
    height: 150%;
    top: -25%;
    left: -25%;
    background-image: 
        linear-gradient(90deg, rgba(46, 213, 115, 0.03) 1px, transparent 1px),
        linear-gradient(rgba(46, 213, 115, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.app {
    position: relative;
    z-index: 1;
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.header h1 {
    font-size: 2em;
    background: linear-gradient(135deg, #2ed573, #00e676);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.board-tabs {
    display: flex;
    gap: 10px;
}

.tab-btn {
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #888;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.tab-btn.active {
    background: linear-gradient(135deg, rgba(46, 213, 115, 0.2), rgba(0, 230, 118, 0.2));
    border-color: #2ed573;
    color: #fff;
}

.tab-icon {
    font-size: 1.2em;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #2ed573, #00e676);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(46, 213, 115, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: #888;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
}

.stats-bar {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.stat {
    flex: 1;
    padding: 20px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-label {
    display: block;
    color: #888;
    font-size: 0.85em;
    margin-bottom: 8px;
}

.stat-value {
    display: block;
    font-size: 2em;
    font-weight: bold;
    background: linear-gradient(135deg, #2ed573, #00e676);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.filters {
    margin-bottom: 20px;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.filters label {
    color: #888;
    margin-right: 10px;
}

.filter-btn {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #888;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover, .filter-btn.active {
    background: rgba(255, 255, 255, 0.1);
    border-color: #2ed573;
    color: #fff;
}

.board {
    display: none;
    animation: fadeIn 0.3s ease;
}

.board.active {
    display: block;
}

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

.board-title {
    text-align: center;
    margin-bottom: 30px;
    padding: 30px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.alexis-board .board-title h2 {
    background: linear-gradient(135deg, #2ed573, #00e676);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 2em;
    margin-bottom: 10px;
}

.dans-board .board-title h2 {
    background: linear-gradient(135deg, #ff6b6b, #feca57);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 2em;
    margin-bottom: 10px;
}

.board-title p {
    color: #888;
    font-size: 1.1em;
}

.columns-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.column {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    padding: 20px;
    min-height: 400px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.column-header {
    font-size: 1.1em;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.column-count {
    background: rgba(46, 213, 115, 0.2);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85em;
}

.task-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
}

.task-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(46, 213, 115, 0.2);
    border-color: #2ed573;
}

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

.card-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.edit-btn {
    background: rgba(46, 213, 115, 0.1);
    border: 1px solid rgba(46, 213, 115, 0.2);
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #2ed573;
}

.edit-btn:hover {
    background: rgba(46, 213, 115, 0.2);
    border-color: #2ed573;
    transform: scale(1.1);
}

.delete-btn {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.2);
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #ff6b6b;
}

.delete-btn:hover {
    background: rgba(255, 107, 107, 0.2);
    border-color: #ff6b6b;
    transform: scale(1.1);
}

.task-priority {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75em;
}

.task-priority.high {
    background: rgba(255, 107, 107, 0.2);
    color: #ff6b6b;
}

.task-priority.medium {
    background: rgba(254, 202, 87, 0.2);
    color: #feca57;
}

.task-priority.low {
    background: rgba(46, 213, 115, 0.2);
    color: #2ed573;
}

.task-title {
    font-weight: 600;
    margin-bottom: 8px;
    color: #fff;
}

.task-description {
    color: #888;
    font-size: 0.85em;
    line-height: 1.4;
}

.task-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.75em;
    color: #666;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #1a1a1a;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-close {
    background: none;
    border: none;
    color: #888;
    font-size: 2em;
    cursor: pointer;
    transition: color 0.3s;
}

.modal-close:hover {
    color: #fff;
}

.form-group {
    padding: 0 20px;
    margin: 20px 0;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #888;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #fff;
    font-family: inherit;
}

.form-group textarea {
    resize: vertical;
}

.form-actions {
    display: flex;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    justify-content: flex-end;
}

/* Strategy Boards */
.strats-columns {
    grid-template-columns: repeat(2, 1fr);
}

.strat-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.strat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(46, 213, 115, 0.2);
    border-color: #2ed573;
}

.strat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    gap: 10px;
}

.strat-title {
    font-weight: 600;
    color: #fff;
    flex: 1;
}

.strat-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.strat-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.strat-checkbox input[type="checkbox"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.checkbox-label {
    font-size: 0.85em;
    color: #888;
}

.strat-checkbox input[type="checkbox"]:checked + .checkbox-label {
    color: #2ed573;
    font-weight: 600;
}

.strat-description {
    color: #888;
    font-size: 0.85em;
    line-height: 1.4;
    margin-top: 8px;
}

.strat-date {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.75em;
    color: #666;
}

@media (max-width: 1200px) {
    .columns-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .columns-container {
        grid-template-columns: 1fr;
    }
    
    .strats-columns {
        grid-template-columns: 1fr !important;
    }
    
    .header {
        flex-direction: column;
        gap: 15px;
    }
    
    .board-tabs {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .tab-btn {
        flex: 1;
        justify-content: center;
        min-width: 120px;
    }
}

/* Drag and Drop */
.task-card.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
    cursor: grabbing !important;
}

.column-content.drag-over {
    background: rgba(46, 213, 115, 0.1);
    border: 2px dashed #2ed573;
}

.task-card {
    cursor: grab;
}

.task-card:active {
    cursor: grabbing;
}

/* Calendar Board Styles */
.calendar-board {
    max-width: 1200px;
    margin: 0 auto;
}

.calendar-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 30px;
    padding: 20px 0;
}

.calendar-section {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.calendar-section h3 {
    margin-bottom: 20px;
    color: #2ed573;
    font-size: 1.2em;
}

.reminder-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.reminder-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.reminder-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(46, 213, 115, 0.2);
    border-color: #2ed573;
}

.reminder-checkbox {
    margin-top: 2px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.reminder-content {
    flex: 1;
}

.reminder-title {
    font-weight: 600;
    color: #fff;
    margin-bottom: 5px;
}

.reminder-description {
    font-size: 0.9em;
    color: #888;
    margin-bottom: 8px;
}

.reminder-meta {
    display: flex;
    gap: 15px;
    font-size: 0.85em;
    color: #666;
}

.reminder-time {
    color: #2ed573;
}

.reminder-schedule {
    color: #888;
}

.reminder-card.completed {
    opacity: 0.6;
    background: rgba(46, 213, 115, 0.1);
}

.reminder-card.completed .reminder-title {
    text-decoration: line-through;
    color: #666;
}

.loading {
    text-align: center;
    color: #666;
    padding: 40px 0;
}

@media (max-width: 1000px) {
    .calendar-container {
        grid-template-columns: 1fr;
    }
}

/* Calendar & Reminders Styles */
.reminder-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.reminder-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(46, 213, 115, 0.2);
    border-radius: 8px;
    padding: 16px;
    transition: all 0.2s ease;
}

.reminder-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(46, 213, 115, 0.4);
    transform: translateY(-2px);
}

.reminder-card.today {
    background: rgba(46, 213, 115, 0.1);
    border-color: rgba(46, 213, 115, 0.5);
    box-shadow: 0 0 20px rgba(46, 213, 115, 0.2);
}

.reminder-card.past {
    background: rgba(255, 71, 87, 0.1);
    border-color: rgba(255, 71, 87, 0.4);
}

.reminder-card.recurring {
    border-left: 3px solid rgba(0, 230, 118, 0.6);
}

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

.reminder-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.reminder-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.reminder-time {
    font-size: 14px;
    color: rgba(46, 213, 115, 0.9);
    font-weight: 500;
    margin-bottom: 6px;
}

.reminder-time.overdue {
    color: #ff4757;
    font-weight: 600;
}

.reminder-schedule {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 6px;
}

.reminder-text {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.empty-state {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    padding: 40px 20px;
    font-size: 14px;
}

.error {
    text-align: center;
    color: #ff4757;
    padding: 40px 20px;
    font-size: 14px;
}

/* Reminder Complete Button */
.reminder-complete-btn {
    background: rgba(46, 213, 115, 0.2);
    border: 1px solid rgba(46, 213, 115, 0.4);
    border-radius: 4px;
    color: rgba(46, 213, 115, 0.9);
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    padding: 4px 10px;
    transition: all 0.2s ease;
    margin-left: auto;
}

.reminder-complete-btn:hover {
    background: rgba(46, 213, 115, 0.3);
    border-color: rgba(46, 213, 115, 0.6);
    transform: scale(1.1);
}

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

.reminder-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ===== RESEARCH DRIVE STYLES ===== */

.research-board {
    padding: 0;
}

.research-container {
    display: flex;
    height: calc(100vh - 250px);
    background: linear-gradient(135deg, #1a4d2e 0%, #0f2818 100%);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.research-sidebar {
    width: 250px;
    background: rgba(0, 0, 0, 0.2);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px;
    overflow-y: auto;
}

.research-sidebar h3 {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 15px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.folder-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.folder-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px 16px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
}

.folder-item:hover {
    background: rgba(16, 185, 129, 0.2);
    border-color: #10b981;
    color: #10b981;
    transform: translateX(4px);
}

.research-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.1);
}

.file-list h3 {
    font-size: 24px;
    margin: 0 0 20px 0;
    color: rgba(255, 255, 255, 0.95);
}

.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.file-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    position: relative;
}

.file-dl-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.4);
    border-radius: 6px;
    color: #10b981;
    cursor: pointer;
    padding: 4px 8px;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.2s;
}

.file-card:hover .file-dl-btn {
    opacity: 1;
}

.file-dl-btn:hover {
    background: rgba(16, 185, 129, 0.4);
}

#downloadFile {
    margin-left: auto;
    white-space: nowrap;
}

.file-card:hover {
    border-color: #10b981;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    transform: translateY(-2px);
    background: rgba(16, 185, 129, 0.1);
}

.file-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.file-name {
    font-size: 15px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-meta {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.empty-state {
    text-align: center;
    color: #6c757d;
    font-size: 14px;
    padding: 40px;
}

.file-viewer {
    max-width: 900px;
    margin: 0 auto;
}

.file-viewer-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #dee2e6;
}

.file-viewer-header h3 {
    font-size: 28px;
    margin: 0;
    color: #212529;
    flex: 1;
}

.file-viewer-content {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    border: 1px solid #dee2e6;
    line-height: 1.8;
}

.file-viewer-content h1 {
    font-size: 32px;
    margin: 0 0 20px 0;
    color: #212529;
}

.file-viewer-content h2 {
    font-size: 24px;
    margin: 30px 0 15px 0;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
    padding-bottom: 8px;
}

.file-viewer-content h3 {
    font-size: 20px;
    margin: 25px 0 12px 0;
    color: #495057;
}

.file-viewer-content p {
    margin: 12px 0;
    color: #495057;
}

.file-viewer-content ul,
.file-viewer-content ol {
    margin: 15px 0;
    padding-left: 30px;
}

.file-viewer-content li {
    margin: 8px 0;
    color: #495057;
}

.file-viewer-content code {
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 13px;
    color: #e83e8c;
}

.file-viewer-content pre {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 16px;
    overflow-x: auto;
    margin: 20px 0;
}

.file-viewer-content pre code {
    background: none;
    padding: 0;
    color: #212529;
    font-size: 13px;
}

.file-viewer-content blockquote {
    border-left: 4px solid #2196F3;
    padding-left: 20px;
    margin: 20px 0;
    color: #6c757d;
    font-style: italic;
}

.file-viewer-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.file-viewer-content th,
.file-viewer-content td {
    border: 1px solid #dee2e6;
    padding: 12px;
    text-align: left;
}

.file-viewer-content th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.file-viewer-content a {
    color: #2196F3;
    text-decoration: none;
}

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

/* Mobile responsive */
@media (max-width: 768px) {
    .research-container {
        flex-direction: column;
    }
    
    .research-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #dee2e6;
    }
    
    .file-grid {
        grid-template-columns: 1fr;
    }
}

/* File list header with back button */
.file-list-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.file-list-header h3 {
    margin: 0;
    font-size: 24px;
    color: rgba(255, 255, 255, 0.95);
    flex: 1;
}

.back-btn {
    padding: 8px 16px !important;
    font-size: 14px !important;
    white-space: nowrap;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .research-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #dee2e6;
    }
    
    .file-list-header {
        flex-direction: row;
        align-items: center;
    }
    
    .file-list-header h3 {
        font-size: 20px;
    }
    
    .file-viewer-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .file-viewer-header h3 {
        font-size: 22px;
    }
}

/* ===== GUT HEALTH TRACKER ===== */
.gut-health-board {
    padding: 20px;
}

.gut-health-container {
    max-width: 700px;
    margin: 0 auto;
}

.gut-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 30px;
    backdrop-filter: blur(10px);
}

.gut-card h3 {
    font-size: 1.5em;
    margin-bottom: 25px;
    color: #2ed573;
    text-align: center;
}

.gut-form {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.gut-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.gut-form label {
    font-weight: 600;
    color: #aaa;
    font-size: 0.95em;
}

.gut-form input[type="date"],
.gut-form input[type="number"],
.gut-form textarea {
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 1em;
    font-family: inherit;
}

.gut-form input[type="date"]:focus,
.gut-form input[type="number"]:focus,
.gut-form textarea:focus {
    outline: none;
    border-color: #2ed573;
}

.gut-form textarea {
    resize: vertical;
    min-height: 80px;
}

/* Checkboxes */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 10px 16px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.checkbox-label:hover {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.2);
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #2ed573;
}

.checkbox-label span {
    font-size: 0.95em;
    color: #ccc;
}

/* Sliders */
.slider-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.slider-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.slider-item label {
    font-weight: 500;
    color: #bbb;
    font-size: 0.9em;
}

.slider-item input[type="range"] {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    outline: none;
    -webkit-appearance: none;
}

.slider-item input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #2ed573;
    cursor: pointer;
    border-radius: 50%;
    border: 2px solid #0a0a0a;
}

.slider-item input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #2ed573;
    cursor: pointer;
    border-radius: 50%;
    border: 2px solid #0a0a0a;
}

.slider-item input[type="range"]:focus::-webkit-slider-thumb {
    box-shadow: 0 0 0 3px rgba(46, 213, 115, 0.3);
}

/* Actions */
.gut-actions {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.gut-actions .btn {
    flex: 1;
    font-size: 1em;
    padding: 14px;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .gut-card {
        padding: 20px;
    }
    
    .gut-card h3 {
        font-size: 1.3em;
    }
    
    .checkbox-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .checkbox-label {
        width: 100%;
    }
    
    .gut-actions {
        flex-direction: column;
    }
    
    .gut-actions .btn {
        width: 100%;
    }
}

/* ===== DROPDOWN NAV ===== */
.nav-groups {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.nav-group {
    position: relative;
}

.nav-group-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #888;
    font-size: 0.95em;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-family: inherit;
}

.nav-group-btn:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.18);
    color: #ccc;
}

.nav-group-btn.active {
    background: linear-gradient(135deg, rgba(46, 213, 115, 0.15), rgba(0, 230, 118, 0.15));
    border-color: rgba(46, 213, 115, 0.5);
    color: #2ed573;
}

.nav-group-btn.open {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.nav-chevron {
    font-size: 0.7em;
    transition: transform 0.2s ease;
    opacity: 0.6;
}

.nav-group-btn.open .nav-chevron {
    transform: rotate(180deg);
}

.nav-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 180px;
    background: #111;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-top: none;
    border-radius: 0 8px 8px 8px;
    z-index: 100;
    overflow: hidden;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.nav-dropdown.open {
    display: flex;
}

/* Agent Data Board */
.agent-data-board { padding: 20px; }
.agent-data-empty { color: rgba(255,255,255,0.4); text-align: center; padding: 40px 20px; font-style: italic; }
.agent-data-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}
.agent-data-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.agent-data-strat {
  font-weight: 700;
  font-size: 1.1rem;
  color: #4FC3F7;
  flex: 1;
}
.strat-expand-arrow { display: none; }
.agent-data-overlap { color: #a78bfa; font-weight: 600; }
.agent-data-meta { display: flex; gap: 12px; font-size: 0.85rem; color: rgba(255,255,255,0.5); }
.agent-data-wallets { color: #81C784; font-weight: 600; }
.agent-data-pnl { color: #FFD54F; font-weight: 600; }
.agent-data-delete {
  background: none; border: none; color: rgba(255,255,255,0.3); cursor: pointer;
  font-size: 1.1rem; padding: 4px 8px; border-radius: 4px;
}
.agent-data-delete:hover { color: #ef5350; background: rgba(239,83,80,0.15); }
.agent-data-summary { color: rgba(255,255,255,0.6); font-size: 0.9rem; margin-bottom: 8px; }
.agent-data-wallet-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.wallet-addr {
  background: rgba(255,255,255,0.08); padding: 3px 8px; border-radius: 4px;
  font-size: 0.8rem; color: rgba(255,255,255,0.7); cursor: pointer;
  transition: background 0.2s;
}
.wallet-addr:hover { background: rgba(255,255,255,0.15); }
.wallet-addr.copied { background: rgba(76,175,80,0.5) !important; color: #A5D6A7 !important; border-color: #4CAF50 !important; text-decoration: line-through; opacity: 0.5; }
.btn-sm { font-size: 0.8rem; padding: 6px 12px; }
.btn-copy-all {
  background: rgba(79,195,247,0.15); border: 1px solid rgba(79,195,247,0.3);
  color: #4FC3F7; border-radius: 6px; cursor: pointer; transition: all 0.2s;
}
.btn-copy-all:hover { background: rgba(79,195,247,0.25); }
.agent-data-actions { display: flex; gap: 8px; }
.btn-download-csv {
  background: rgba(129,199,132,0.15); border: 1px solid rgba(129,199,132,0.3);
  color: #81C784; border-radius: 6px; cursor: pointer; transition: all 0.2s;
}
.btn-download-csv:hover { background: rgba(129,199,132,0.25); }

.nav-subheader {
    padding: 8px 16px 4px;
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.45);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    pointer-events: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: 4px;
}

.nav-nested {
    padding-left: 28px !important;
}

.nav-dropdown .tab-btn {
    width: 100%;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 10px 16px;
    justify-content: flex-start;
    font-size: 0.9em;
}

.nav-dropdown .tab-btn:last-child {
    border-bottom: none;
}

.nav-dropdown .tab-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.nav-dropdown .tab-btn.active {
    background: linear-gradient(135deg, rgba(46, 213, 115, 0.2), rgba(0, 230, 118, 0.2));
    color: #2ed573;
}

/* ===== MEMORY BOARD ===== */
.memory-board {
    display: none;
}
.memory-board.active {
    display: block;
}

.memory-controls {
    margin-bottom: 20px;
}

.memory-search-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 4px 12px;
    max-width: 640px;
}

.memory-search-icon {
    font-size: 1em;
    opacity: 0.5;
    flex-shrink: 0;
}

.memory-search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 0.95em;
    padding: 8px 4px;
    font-family: inherit;
}

.memory-search-input::placeholder {
    color: rgba(255,255,255,0.3);
}

.memory-refresh-btn {
    flex-shrink: 0;
    padding: 6px 14px;
    font-size: 0.85em;
}

.memory-cards-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.memory-loading, .memory-error, .memory-no-results, .memory-empty {
    text-align: center;
    padding: 40px;
    color: rgba(255,255,255,0.4);
    font-size: 0.95em;
}

.memory-no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.memory-no-results span {
    font-size: 2em;
}

.memory-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.memory-group-header {
    font-size: 0.8em;
    font-weight: 600;
    color: rgba(255,255,255,0.35);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0 4px 6px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.memory-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.memory-card:hover {
    border-color: rgba(255,255,255,0.13);
    background: rgba(255,255,255,0.05);
}

.memory-card-root {
    border-color: rgba(46, 213, 115, 0.2);
    background: rgba(46, 213, 115, 0.03);
}

.memory-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
}

.memory-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.95em;
    color: #e0e0e0;
    flex: 1;
    min-width: 0;
}

.memory-card-icon {
    font-size: 1em;
    flex-shrink: 0;
}

.memory-match-badge {
    font-size: 0.72em;
    background: rgba(46, 213, 115, 0.2);
    color: #2ed573;
    padding: 2px 8px;
    border-radius: 12px;
    flex-shrink: 0;
    font-weight: 500;
}

.memory-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.memory-meta-item {
    font-size: 0.75em;
    color: rgba(255,255,255,0.35);
}

.memory-card-copy {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9em;
    padding: 2px 4px;
    border-radius: 4px;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.memory-card-copy:hover {
    opacity: 1;
    background: rgba(255,255,255,0.08);
}

.memory-expand-icon {
    font-size: 0.7em;
    color: rgba(255,255,255,0.3);
    transition: transform 0.2s;
}

.memory-card.expanded .memory-expand-icon {
    transform: rotate(180deg);
}

.memory-card-preview {
    padding: 0 16px 12px;
    font-size: 0.82em;
    color: rgba(255,255,255,0.4);
    line-height: 1.5;
    font-family: monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.memory-card.expanded .memory-card-preview {
    display: none;
}

.memory-card-content {
    display: none;
    padding: 0 16px 16px;
    border-top: 1px solid rgba(255,255,255,0.05);
    max-height: 600px;
    overflow-y: auto;
}

.memory-card.expanded .memory-card-content {
    display: block;
}

.memory-content-rendered {
    font-size: 0.88em;
    line-height: 1.7;
    color: rgba(255,255,255,0.75);
    padding-top: 12px;
}

.memory-content-rendered h1,
.memory-content-rendered h2,
.memory-content-rendered h3 {
    color: #2ed573;
    margin: 16px 0 8px;
}

.memory-content-rendered h1 { font-size: 1.2em; }
.memory-content-rendered h2 { font-size: 1.05em; }
.memory-content-rendered h3 { font-size: 0.95em; }

.memory-content-rendered p {
    margin: 0 0 10px;
}

.memory-content-rendered ul, .memory-content-rendered ol {
    margin: 0 0 10px 20px;
}

.memory-content-rendered code {
    background: rgba(255,255,255,0.08);
    padding: 1px 5px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.9em;
}

.memory-content-rendered pre {
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    padding: 12px;
    overflow-x: auto;
    margin: 10px 0;
}

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

.memory-content-rendered strong { color: #fff; }
.memory-content-rendered em { color: rgba(255,255,255,0.6); }
.memory-content-rendered hr {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin: 16px 0;
}

/* ===== AGENT STATUS BOARD ===== */
.agent-status-board {
    display: none;
}
.agent-status-board.active {
    display: block;
}

.agent-status-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.agent-last-updated {
    font-size: 0.8em;
    color: rgba(255,255,255,0.35);
}

.agent-status-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.agent-loading, .agent-error, .agent-empty {
    text-align: center;
    padding: 40px;
    color: rgba(255,255,255,0.4);
    font-size: 0.95em;
}

.agent-group {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    overflow: hidden;
}

.agent-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    font-size: 0.8em;
    font-weight: 600;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.agent-group-count {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.4);
    font-size: 0.85em;
    padding: 1px 7px;
    border-radius: 10px;
    margin-left: 2px;
}

.agent-group-items {
    display: flex;
    flex-direction: column;
}

.agent-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    gap: 12px;
    transition: background 0.15s;
}

.agent-card:last-child {
    border-bottom: none;
}

.agent-card:hover {
    background: rgba(255,255,255,0.03);
}

.agent-card-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.agent-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dot-green {
    background: #2ed573;
    box-shadow: 0 0 6px rgba(46, 213, 115, 0.6);
    animation: pulse-green 2s infinite;
}

.dot-amber {
    background: #ffa502;
    box-shadow: 0 0 4px rgba(255, 165, 2, 0.4);
}

.dot-blue {
    background: #1e90ff;
    box-shadow: 0 0 4px rgba(30, 144, 255, 0.4);
}

.dot-gray {
    background: rgba(255,255,255,0.2);
}

@keyframes pulse-green {
    0%, 100% { box-shadow: 0 0 4px rgba(46, 213, 115, 0.4); }
    50% { box-shadow: 0 0 10px rgba(46, 213, 115, 0.8); }
}

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

.agent-card-label {
    font-size: 0.9em;
    font-weight: 500;
    color: #ddd;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agent-card-meta {
    display: flex;
    gap: 6px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.agent-meta-chip {
    font-size: 0.72em;
    background: rgba(255,255,255,0.07);
    color: rgba(255,255,255,0.4);
    padding: 2px 8px;
    border-radius: 10px;
}

.agent-meta-tokens {
    background: rgba(46, 213, 115, 0.08);
    color: rgba(46, 213, 115, 0.6);
}

.agent-meta-spawned {
    background: rgba(100, 100, 255, 0.08);
    color: rgba(150, 150, 255, 0.7);
}

.agent-card-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.agent-status-badge {
    font-size: 0.72em;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.agent-status-active {
    background: rgba(46, 213, 115, 0.2);
    color: #2ed573;
}

.agent-status-recent {
    background: rgba(255, 165, 2, 0.2);
    color: #ffa502;
}

.agent-status-completed {
    background: rgba(30, 144, 255, 0.2);
    color: #1e90ff;
}

.agent-status-idle {
    background: rgba(255,255,255,0.07);
    color: rgba(255,255,255,0.4);
}

.agent-age {
    font-size: 0.75em;
    color: rgba(255,255,255,0.3);
}

/* ═══════════════════════════════════════════════
   CREDITS DASHBOARD
   ═══════════════════════════════════════════════ */

.credits-board {
  padding: 24px;
  max-width: 900px;
}

.credits-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.credits-last-updated {
  font-size: 0.78em;
  color: rgba(255,255,255,0.35);
}

/* ── Budget card ── */
.credits-budget-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 20px 24px;
  margin-bottom: 24px;
}

.budget-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}

.budget-label {
  font-size: 0.85em;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.budget-values {
  font-size: 1.05em;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
}

.budget-bar-wrap {
  height: 8px;
  background: rgba(255,255,255,0.08);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 16px;
}

.budget-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease, background 0.3s;
}

.budget-type-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.budget-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.80em;
  background: var(--pill-colour, rgba(255,255,255,0.05));
  color: rgba(255,255,255,0.75);
}

.budget-pill strong { font-weight: 700; }
.budget-pill small {
  color: rgba(255,255,255,0.45);
  font-size: 0.88em;
}

/* ── Section ── */
.credits-section {
  margin-bottom: 28px;
}

.credits-section-title {
  font-size: 0.82em;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin-bottom: 12px;
}

/* ── Sessions table ── */
.credits-table-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 0.72em;
  color: rgba(255,255,255,0.3);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.credits-th-stats {
  display: flex;
  gap: 0;
  text-align: right;
}
.credits-th-stats span {
  width: 80px;
  text-align: right;
}

.credits-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 4px;
  transition: background 0.15s;
}

.credits-row:hover {
  background: rgba(255,255,255,0.04);
}

.credits-row-top {
  background: rgba(255,255,255,0.03);
}

.credits-row-rank {
  font-size: 0.8em;
  font-weight: 700;
  color: rgba(255,255,255,0.25);
  width: 18px;
  text-align: right;
  flex-shrink: 0;
}

.credits-row-info {
  flex: 1;
  min-width: 0;
}

.credits-row-label {
  margin-bottom: 5px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.credits-type-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 0.82em;
  font-weight: 500;
  white-space: nowrap;
}

.credits-row-bar-wrap {
  height: 3px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
}

.credits-row-bar {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s ease;
}

.credits-row-stats {
  display: flex;
  gap: 0;
  align-items: center;
  flex-shrink: 0;
}

.credits-row-stats span {
  width: 80px;
  text-align: right;
  font-size: 0.80em;
}

.credits-tokens { color: rgba(255,255,255,0.6); font-variant-numeric: tabular-nums; }
.credits-cost   { color: rgba(255,255,255,0.85); font-weight: 600; font-variant-numeric: tabular-nums; }
.credits-model  { color: rgba(255,255,255,0.3); font-size: 0.72em !important; }
.credits-age    { color: rgba(255,255,255,0.25); font-size: 0.72em !important; }

.credits-totals-row {
  padding: 12px 12px;
  margin-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.07);
  font-size: 0.82em;
  color: rgba(255,255,255,0.4);
  display: flex;
  gap: 10px;
  align-items: baseline;
  flex-wrap: wrap;
}

.credits-totals-row strong { color: rgba(255,255,255,0.7); }
.credits-totals-row small  { color: rgba(255,255,255,0.25); font-size: 0.88em; }

.credits-loading,
.credits-empty,
.credits-error {
  padding: 32px;
  text-align: center;
  color: rgba(255,255,255,0.35);
  font-size: 0.9em;
}

.credits-error { color: #ef4444; }

/* ── Weekly bars ── */
.weekly-bars {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  height: 120px;
  padding: 0 4px;
}

.weekly-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
}

.weekly-bar-label {
  font-size: 0.70em;
  color: rgba(255,255,255,0.5);
  text-align: center;
  line-height: 1.2;
}

.weekly-bar-wrap {
  flex: 1;
  width: 100%;
  background: rgba(255,255,255,0.05);
  border-radius: 4px 4px 0 0;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  max-height: 80px;
}

.weekly-bar-fill {
  width: 100%;
  background: linear-gradient(180deg, #6366f1, #8b5cf6);
  border-radius: 3px 3px 0 0;
  min-height: 3px;
  transition: height 0.4s ease;
}

.weekly-bar-day {
  font-size: 0.72em;
  color: rgba(255,255,255,0.4);
  text-align: center;
}

.weekly-bar-tokens {
  font-size: 0.65em;
  color: rgba(255,255,255,0.25);
  text-align: center;
}

.weekly-summary {
  margin-top: 12px;
  font-size: 0.82em;
  color: rgba(255,255,255,0.35);
  text-align: center;
}

.weekly-summary strong { color: rgba(255,255,255,0.65); }

/* ═══════════════════════════════════════════════════════════════════════
   BUSINESS IDEAS BOARD — Sticky Notes UI
   ═══════════════════════════════════════════════════════════════════════ */

.ideas-board {
  position: relative;
  min-height: 600px;
}

.ideas-toolbar {
  margin: 20px 0;
  display: flex;
  justify-content: flex-start;
  gap: 12px;
}

.ideas-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
  padding: 20px 0;
}

.ideas-loading,
.ideas-error,
.ideas-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  font-size: 1.1em;
  color: rgba(255, 255, 255, 0.5);
}

.ideas-error { color: #ef4444; }

/* Sticky note */
.sticky-note {
  position: relative;
  padding: 20px;
  min-height: 180px;
  border-radius: 4px;
  box-shadow: 
    0 4px 8px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(0, 0, 0, 0.1);
  cursor: default;
  transition: all 0.2s ease;
  transform-origin: center;
}

.sticky-note:hover:not(.scrunch-up) {
  box-shadow: 
    0 8px 16px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(0, 0, 0, 0.15);
  transform: scale(1.02) rotate(0deg) !important;
}

.sticky-delete-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.1);
  border: none;
  border-radius: 4px;
  font-size: 1.1em;
  width: 32px;
  height: 32px;
  cursor: pointer;
  opacity: 0;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sticky-note:hover .sticky-delete-btn {
  opacity: 1;
}

.sticky-delete-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  transform: scale(1.1);
}

.sticky-title {
  font-size: 1.15em;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 12px;
  word-wrap: break-word;
}

.sticky-notes {
  font-size: 0.9em;
  color: #333;
  line-height: 1.5;
  margin-bottom: 12px;
  word-wrap: break-word;
  white-space: pre-wrap;
}

.sticky-date {
  position: absolute;
  bottom: 12px;
  right: 12px;
  font-size: 0.75em;
  color: rgba(0, 0, 0, 0.4);
  font-style: italic;
}

/* Trash bin */
.trash-bin {
  position: fixed;
  bottom: 40px;
  right: 40px;
  width: 80px;
  height: 80px;
  background: rgba(239, 68, 68, 0.15);
  border: 2px dashed rgba(239, 68, 68, 0.4);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5em;
  opacity: 0.3;
  transition: all 0.3s ease;
  pointer-events: none;
  z-index: 10;
}

.trash-bin.active {
  opacity: 1;
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.7);
  transform: scale(1.1);
}

/* Scrunch-up / crumple animation */
@keyframes scrunchUp {
  0% {
    transform: scale(1) rotate(0deg) skewX(0deg);
    opacity: 1;
    border-radius: 4px;
    filter: brightness(1);
  }
  8% {
    transform: scale(1.04, 0.96) rotate(2deg) skewX(-3deg);
    border-radius: 6px;
  }
  18% {
    transform: scale(0.88, 1.06) rotate(-6deg) skewX(7deg);
    border-radius: 10px;
  }
  30% {
    transform: scale(0.72, 0.78) rotate(18deg) skewX(-12deg) skewY(4deg);
    border-radius: 18%;
    opacity: 0.92;
    filter: brightness(0.88);
  }
  45% {
    transform: scale(0.5, 0.55) rotate(-28deg) skewX(9deg) skewY(-6deg);
    border-radius: 35%;
    opacity: 0.78;
    filter: brightness(0.82);
  }
  62% {
    transform: scale(0.3, 0.32) rotate(50deg) skewX(-5deg);
    border-radius: 50%;
    opacity: 0.55;
    filter: brightness(0.75);
  }
  80% {
    transform: scale(0.16) rotate(72deg);
    border-radius: 50%;
    opacity: 0.3;
    filter: brightness(0.65);
  }
  100% {
    transform: scale(0) rotate(88deg);
    border-radius: 50%;
    opacity: 0;
    filter: brightness(0.5);
  }
}

.sticky-note.scrunch-up {
  animation: scrunchUp 0.65s cubic-bezier(0.55, 0, 0.7, 1) forwards;
  pointer-events: none;
  transition: none !important;
  transform-origin: center center;
}

/* Idea form modal */
.idea-form-modal {
  max-width: 500px;
  width: 90%;
}

.idea-form-modal h2 {
  margin-bottom: 20px;
  color: #2ed573;
}

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

.idea-form-modal label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9em;
  color: rgba(255, 255, 255, 0.7);
}

.idea-form-modal input,
.idea-form-modal textarea {
  width: 100%;
  padding: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #fff;
  font-size: 1em;
  font-family: inherit;
}

.idea-form-modal textarea {
  resize: vertical;
  min-height: 120px;
}

.idea-form-modal input:focus,
.idea-form-modal textarea:focus {
  outline: none;
  border-color: #2ed573;
  background: rgba(255, 255, 255, 0.08);
}

.idea-form-modal .form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

/* ===== ARGUS VENTURES ===== */
.argus-ventures-board {
  padding: 0 24px 40px;
}

.av-toolbar {
  margin-bottom: 24px;
}

.av-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 700px;
}

.av-item {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  transition: background 0.2s, opacity 0.35s, transform 0.35s;
}

.av-item:hover {
  background: rgba(255, 255, 255, 0.10);
}

.av-item.av-fading {
  opacity: 0;
  transform: translateX(40px);
  pointer-events: none;
}

.av-label {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  width: 100%;
}

.av-checkbox {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: #2ed573;
}

.av-text {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.5;
}

.av-loading,
.av-error,
.av-empty {
  padding: 20px 0;
  color: rgba(255, 255, 255, 0.45);
  font-size: 14px;
  list-style: none;
}

.av-error { color: #ef4444; }

/* Argus Ventures Modal */
.av-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.av-modal {
  background: #1a1a2e;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 32px;
  width: 480px;
  max-width: 90vw;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.av-modal h2 {
  margin: 0 0 20px;
  font-size: 20px;
  color: #fff;
}

.av-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: #fff;
  font-size: 15px;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.2s;
}

.av-input:focus {
  border-color: #2ed573;
  background: rgba(255, 255, 255, 0.09);
}

.av-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* ============================================
   MOBILE RESPONSIVE — iPhone optimized
   ============================================ */
@media (max-width: 480px) {
    body {
        font-size: 14px;
    }

    .app {
        padding: 8px;
    }

    /* Header: stack vertically */
    .header {
        flex-direction: column;
        gap: 10px;
        padding: 12px;
        margin-bottom: 15px;
    }

    .header h1 {
        font-size: 1.3em;
    }

    /* Nav groups: horizontal scroll, no wrap */
    .nav-groups {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 6px;
        padding-bottom: 4px;
        width: 100%;
        scrollbar-width: none;
    }
    .nav-groups::-webkit-scrollbar {
        display: none;
    }

    .nav-group-btn {
        min-height: 44px;
        padding: 8px 14px;
        font-size: 0.85em;
        flex-shrink: 0;
    }

    .nav-dropdown {
        position: absolute;
        left: 0;
        right: auto;
        top: 100%;
        min-width: 180px;
        border-radius: 8px;
        border: 1px solid rgba(255, 255, 255, 0.15);
        z-index: 9999;
    }

    .nav-group {
        position: relative;
    }

    .nav-dropdown .tab-btn {
        min-height: 44px;
        padding: 12px 16px;
        font-size: 0.9em;
        white-space: nowrap;
    }

    /* Header actions */
    .header-actions {
        width: 100%;
        justify-content: stretch;
    }
    .header-actions .btn {
        flex: 1;
        min-height: 44px;
        padding: 10px 12px;
        font-size: 0.85em;
    }

    /* Stats bar: stack vertically */
    .stats-bar {
        flex-direction: column;
        gap: 8px;
        margin-bottom: 12px;
    }
    .stat {
        padding: 12px;
    }
    .stat-value {
        font-size: 1.5em;
    }
    .stat-label {
        font-size: 0.8em;
        margin-bottom: 4px;
    }

    /* Filters */
    .filters {
        flex-wrap: wrap;
        padding: 10px;
        gap: 6px;
        margin-bottom: 12px;
    }
    .filter-btn {
        min-height: 44px;
        padding: 8px 12px;
        font-size: 0.85em;
    }

    /* Board columns: single column */
    .columns-container {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }

    .column {
        min-height: unset;
    }

    .column-header {
        padding: 10px 12px;
        font-size: 0.9em;
    }

    /* Task cards: full width */
    .task-card {
        padding: 12px;
        margin: 6px 0;
    }
    .task-card h4 {
        font-size: 0.9em;
    }
    .task-card p {
        font-size: 0.8em;
    }
    .task-actions .btn {
        min-height: 44px;
        min-width: 44px;
        padding: 6px 10px;
        font-size: 0.8em;
    }

    /* Board title */
    .board-title {
        padding: 0 4px;
        margin-bottom: 10px;
    }
    .board-title h2 {
        font-size: 1.1em;
    }
    .board-title p {
        font-size: 0.75em;
    }

    /* Research board: stack vertically on mobile */
    .research-container {
        flex-direction: column;
        height: auto;
        max-height: none;
    }
    .research-sidebar {
        width: 100%;
        max-height: none;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    .research-content {
        width: 100%;
    }

    /* Modal: full width on mobile */
    .modal-content {
        width: 95%;
        max-width: none;
        margin: 10px;
        padding: 16px;
    }
    .modal-content input,
    .modal-content textarea,
    .modal-content select {
        min-height: 44px;
        font-size: 16px; /* prevents iOS zoom */
    }

    /* Gut health form */
    .gut-card {
        padding: 12px;
    }
    .gut-form .form-group label {
        font-size: 0.85em;
    }

    /* Calendar */
    .calendar-container {
        grid-template-columns: 1fr !important;
    }

    /* Memory */
    .memory-controls {
        flex-direction: column;
    }
    .memory-search-input {
        font-size: 16px;
    }

    /* Ideas wall */
    .ideas-wall {
        grid-template-columns: 1fr !important;
    }

    /* Agent data cards */
    .agent-data-board {
        padding: 10px;
    }
    .agent-data-card {
        padding: 12px;
        margin-bottom: 10px;
        position: relative;
    }
    /* Mobile: collapsible cards */
    .agent-data-card.collapsed .agent-data-body {
        display: none;
    }
    .agent-data-body {
        margin-top: 8px;
    }
    .agent-data-card.collapsed .strat-expand-arrow {
        transform: rotate(-90deg);
    }
    .strat-expand-arrow {
        display: block;
        font-size: 0.7rem;
        color: rgba(255,255,255,0.4);
        transition: transform 0.1s;
        position: absolute;
        right: 36px;
        top: 14px;
    }
    .agent-data-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        cursor: pointer;
        padding: 10px 50px 10px 0;
        min-height: 44px;
        -webkit-tap-highlight-color: transparent;
        user-select: none;
        -webkit-user-select: none;
        touch-action: manipulation;
    }
    .agent-data-strat {
        font-size: 0.9rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }
    .agent-data-meta {
        flex-wrap: wrap;
        gap: 8px;
        font-size: 0.8rem;
    }
    .agent-data-overlap {
        color: #a78bfa;
        font-weight: 600;
    }
    .agent-data-summary {
        font-size: 0.82rem;
        line-height: 1.4;
    }
    .agent-data-wallet-list {
        gap: 4px;
    }
    .wallet-addr {
        font-size: 0.72rem;
        padding: 2px 6px;
    }
    .agent-data-actions {
        flex-wrap: wrap;
        gap: 6px;
    }
    .agent-data-actions .btn-sm {
        min-height: 40px;
        padding: 8px 12px;
        font-size: 0.78rem;
        flex: 1;
        text-align: center;
        min-width: 70px;
    }
    .agent-data-delete {
        position: absolute;
        top: 8px;
        right: 8px;
    }
    /* Config modal on mobile */
    .config-content {
        font-size: 0.75rem !important;
    }
    .agent-data-list {
        font-size: 0.85em;
    }

    /* Credits */
    #usageSummaryCards {
        grid-template-columns: 1fr !important;
    }

    /* Strats columns */
    .strats-columns {
        grid-template-columns: 1fr !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
    }

    /* Strat cards: constrain width on mobile */
    .strat-card {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding: 10px !important;
        overflow: hidden !important;
        word-break: break-word !important;
    }

    .strat-header {
        flex-wrap: wrap;
        gap: 6px;
    }

    .strat-title {
        font-size: 0.9em;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .strat-actions {
        flex-wrap: wrap;
        gap: 6px;
    }

    .strat-actions .btn-sm,
    .strat-actions button {
        min-height: 40px;
        padding: 6px 10px;
        font-size: 0.8em;
    }

    .strat-description {
        font-size: 0.8em;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* ====== Usage Dashboard — new components (2026-02-26) ====== */

/* Today stat cards */
.usage-today-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 4px;
}

.usage-stat-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 16px 18px;
  text-align: center;
}

.usage-stat-val {
  font-size: 1.75em;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}

.usage-stat-label {
  font-size: 0.75em;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  margin-bottom: 4px;
}

.usage-stat-sub {
  font-size: 0.72em;
  color: rgba(255,255,255,0.3);
}

/* 7-day bar chart */
.usage-chart-wrap {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 20px 16px 8px;
}

.usage-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 120px;
  position: relative;
}

.usage-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  position: relative;
}

.usage-bar-col:hover .usage-bar-tooltip {
  opacity: 1;
  transform: translateY(-4px);
}

.usage-bar-tooltip {
  position: absolute;
  top: -52px;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  background: rgba(30,30,40,0.95);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  padding: 5px 9px;
  font-size: 0.72em;
  color: rgba(255,255,255,0.85);
  white-space: nowrap;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s, transform 0.15s;
  z-index: 10;
  line-height: 1.4;
}

.usage-bar-wrap {
  width: 100%;
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 4px;
}

.usage-bar-fill {
  width: 80%;
  min-height: 4px;
  border-radius: 4px 4px 2px 2px;
  transition: height 0.5s ease;
}

.usage-bar-label {
  font-size: 0.70em;
  color: rgba(255,255,255,0.35);
  font-weight: 500;
  margin-top: 4px;
}

.usage-bar-label-today {
  color: #22c55e;
  font-weight: 700;
}

.usage-bar-cost {
  font-size: 0.65em;
  color: rgba(255,255,255,0.25);
  font-variant-numeric: tabular-nums;
  margin-bottom: 4px;
}

/* Two-column layout */
.usage-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 0;
}

@media (max-width: 700px) {
  .usage-two-col { grid-template-columns: 1fr; }
}

/* Active sessions list */
.usage-active-list {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 8px;
  min-height: 48px;
}

.usage-active-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 7px;
  transition: background 0.15s;
}

.usage-active-row:hover {
  background: rgba(255,255,255,0.04);
}

.usage-active-label {
  flex: 1;
  font-size: 0.82em;
  color: rgba(255,255,255,0.75);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.usage-active-meta {
  font-size: 0.72em;
  color: rgba(255,255,255,0.3);
  flex-shrink: 0;
}

.usage-active-age {
  font-size: 0.72em;
  color: rgba(255,255,255,0.25);
  flex-shrink: 0;
  min-width: 44px;
  text-align: right;
}

/* Model cards */
.usage-model-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.usage-model-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  padding: 12px 14px;
}

.usage-model-name {
  font-size: 0.82em;
  font-weight: 700;
  margin-bottom: 2px;
}

.usage-model-cost {
  font-size: 1.25em;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}

.usage-model-bar-wrap {
  height: 4px;
  background: rgba(255,255,255,0.07);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 6px;
}

.usage-model-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s ease;
}

.usage-model-meta {
  font-size: 0.72em;
  color: rgba(255,255,255,0.35);
}

.usage-model-rate {
  font-size: 0.68em;
  color: rgba(255,255,255,0.2);
  margin-top: 2px;
}

/* ===== KEY FILES BOARD ===== */

.keyfiles-board .board-title h2 {
  background: linear-gradient(135deg, #a78bfa, #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 2em;
}

.keyfiles-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px 16px;
}

.keyfiles-last-updated {
  font-size: 0.8em;
  color: #888;
}

.keyfiles-container {
  padding: 0 24px 40px;
}

.keyfiles-loading,
.keyfiles-error {
  padding: 40px;
  text-align: center;
  color: #888;
  font-size: 1.1em;
}

.keyfiles-error {
  color: #ff6b6b;
}

.keyfiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(580px, 1fr));
  gap: 20px;
}

.keyfile-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.keyfile-card:hover {
  border-color: rgba(167, 139, 250, 0.3);
}

.keyfile-card.keyfile-saved {
  border-color: #4ade80;
  box-shadow: 0 0 0 1px rgba(74, 222, 128, 0.4);
  transition: border-color 0.1s ease, box-shadow 0.1s ease;
}

.keyfile-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 14px 16px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
}

.keyfile-card-title {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.keyfile-icon {
  font-size: 1.4em;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.keyfile-filename {
  font-size: 0.95em;
  font-weight: 600;
  color: #e2e8f0;
  font-family: 'SFMono-Regular', 'Cascadia Code', 'Fira Mono', Consolas, monospace;
  letter-spacing: 0.02em;
}

.keyfile-desc {
  font-size: 0.78em;
  color: #666;
  margin-top: 2px;
}

.keyfile-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.keyfile-meta-item {
  font-size: 0.72em;
  color: #555;
  background: rgba(255, 255, 255, 0.04);
  padding: 2px 7px;
  border-radius: 4px;
}

.keyfile-card-body {
  padding: 12px 14px 14px;
}

.keyfile-textarea {
  width: 100%;
  min-height: 420px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #d1d5db;
  font-family: 'SFMono-Regular', 'Cascadia Code', 'Fira Mono', Consolas, 'Courier New', monospace;
  font-size: 0.8em;
  line-height: 1.55;
  padding: 12px 14px;
  resize: vertical;
  box-sizing: border-box;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
  tab-size: 2;
  transition: border-color 0.2s ease;
}

.keyfile-textarea:focus {
  outline: none;
  border-color: rgba(167, 139, 250, 0.5);
  background: rgba(0, 0, 0, 0.45);
}

.keyfile-card-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}

.keyfile-save-status {
  font-size: 0.8em;
  color: #888;
}

.keyfile-status-ok {
  color: #4ade80;
}

.keyfile-status-err {
  color: #ff6b6b;
}

.keyfile-save-btn {
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: white;
  border: none;
  padding: 7px 18px;
  border-radius: 7px;
  font-size: 0.85em;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.1s ease;
}

.keyfile-save-btn:hover:not(:disabled) {
  opacity: 0.9;
  transform: translateY(-1px);
}

.keyfile-save-btn:active:not(:disabled) {
  transform: translateY(0);
}

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

@media (max-width: 900px) {
  .keyfiles-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== HABITS TRACKER ===== */
.habits-summary-bar {
  display: flex;
  gap: 16px;
  padding: 16px 20px;
  margin: 0 16px 16px;
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  overflow-x: auto;
  flex-wrap: wrap;
}
.habit-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 80px;
}
.habit-stat-value {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}
.habit-stat-label {
  font-size: 11px;
  color: #888;
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.habits-month-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 16px;
}
.habits-month-label {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  min-width: 180px;
  text-align: center;
}
.habits-calendar {
  padding: 0 16px 16px;
}
.habits-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 4px;
}
.habits-weekdays span {
  text-align: center;
  font-size: 11px;
  color: #888;
  text-transform: uppercase;
  padding: 4px 0;
}
.habits-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.habit-day {
  aspect-ratio: 1;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  position: relative;
  min-height: 54px;
}
.habit-day:hover:not(.empty):not(.future) {
  transform: scale(1.08);
  box-shadow: 0 0 12px rgba(255,255,255,0.15);
}
.habit-day.empty { cursor: default; background: transparent; }
.habit-day.future { opacity: 0.3; cursor: default; }
.habit-day.none { background: rgba(255,255,255,0.06); }
.habit-day.green { background: rgba(74, 222, 128, 0.25); border: 1px solid rgba(74, 222, 128, 0.4); }
.habit-day.yellow { background: rgba(250, 204, 21, 0.2); border: 1px solid rgba(250, 204, 21, 0.35); }
.habit-day.red { background: rgba(248, 113, 113, 0.2); border: 1px solid rgba(248, 113, 113, 0.35); }
.habit-day.today { box-shadow: 0 0 0 2px #3b82f6; }
.habit-day-num {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}
.habit-day-icons {
  font-size: 10px;
  margin-top: 2px;
}

/* Habit Modal */
.habit-modal-content {
  max-width: 700px !important;
  max-height: 85vh;
  overflow-y: auto;
}
.habit-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.habit-form-section {
  background: rgba(255,255,255,0.04);
  border-radius: 8px;
  padding: 12px;
}
.habit-form-section h4 {
  margin-bottom: 8px;
  font-size: 13px;
  color: #aaa;
}
.habit-form-section .checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 14px;
  color: #ccc;
}
.habit-form-section .form-group {
  margin-bottom: 8px;
}
.habit-form-section .form-group label {
  font-size: 12px;
  color: #999;
}
.habit-form-section input[type="range"] {
  width: 100%;
}
.habit-form-section select,
.habit-form-section input[type="number"],
.habit-form-section input[type="time"] {
  width: 100%;
  padding: 6px 8px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  color: #fff;
  font-size: 14px;
}

@media (max-width: 600px) {
  .habit-form-grid { grid-template-columns: 1fr; }
  .habits-summary-bar { flex-wrap: wrap; }
}

/* ===== Code Drop ===== */
.code-drop-board { padding: 24px; }
.codedrop-form { margin-bottom: 24px; }
.codedrop-title-input {
  width: 100%; padding: 10px 14px; margin-bottom: 8px;
  background: var(--card-bg, #1e1e2e); border: 1px solid var(--border, #333);
  border-radius: 8px; color: var(--text, #cdd6f4); font-size: 14px;
}
.codedrop-textarea {
  width: 100%; min-height: 300px; padding: 14px;
  background: var(--card-bg, #1e1e2e); border: 1px solid var(--border, #333);
  border-radius: 8px; color: var(--text, #cdd6f4);
  font-family: 'JetBrains Mono', 'Fira Code', monospace; font-size: 13px;
  line-height: 1.5; resize: vertical; tab-size: 4;
}
.codedrop-textarea:focus, .codedrop-title-input:focus {
  outline: none; border-color: var(--accent, #89b4fa);
}
.codedrop-actions { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.codedrop-status { font-size: 13px; color: var(--text-dim, #888); }
.codedrop-history { margin-top: 16px; }
.codedrop-history h3 { color: var(--text-dim, #888); font-size: 14px; margin-bottom: 8px; }
.codedrop-list { list-style: none; padding: 0; }
.codedrop-item {
  background: var(--card-bg, #1e1e2e); border: 1px solid var(--border, #333);
  border-radius: 8px; padding: 12px; margin-bottom: 8px;
}
.codedrop-item.reviewed { border-color: var(--green, #a6e3a1); opacity: 0.7; }
.codedrop-item-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.codedrop-date { font-size: 12px; color: var(--text-dim, #888); }
.codedrop-badge { font-size: 11px; padding: 2px 8px; border-radius: 12px; }
.codedrop-badge.pending { background: #fab38720; color: #fab387; }
.codedrop-badge.reviewed { background: #a6e3a120; color: #a6e3a1; }
.codedrop-preview {
  background: #11111b; padding: 8px; border-radius: 4px;
  font-size: 12px; overflow: hidden; max-height: 60px; color: #888;
  font-family: 'JetBrains Mono', monospace;
}
.codedrop-full {
  background: #11111b; padding: 12px; border-radius: 4px;
  font-size: 13px; overflow-x: auto; max-height: 500px; overflow-y: auto;
  color: var(--text, #cdd6f4); font-family: 'JetBrains Mono', monospace;
  margin-top: 8px; white-space: pre; line-height: 1.5;
}
.codedrop-item-actions { margin-top: 6px; display: flex; gap: 6px; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.codedrop-loading { color: var(--text-dim, #888); font-style: italic; padding: 12px; }

/* ══════════════════════════════════════════════════════════════
   MOBILE RESPONSIVENESS — buttons & content overlap fix
   Only affects screens ≤768px. Desktop unchanged.
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    /* Stack header vertically */
    .header {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 12px;
    }

    .header h1 {
        font-size: 1.3em;
    }

    /* Nav groups: horizontal scroll */
    .nav-groups {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }

    .nav-group-btn {
        padding: 8px 12px;
        font-size: 0.85em;
    }

    /* Hide normal dropdowns on mobile — JS handles it */
    .nav-dropdown {
        display: none !important;
    }

    /* Hide action buttons from header entirely on mobile */
    .header > .header-actions {
        display: none !important;
    }

    /* Board content spacing */
    .board {
        padding-bottom: 20px;
    }

    .column-content {
        padding-bottom: 12px;
    }

    /* Research board: stack sidebar/content vertically */
    .research-container {
        flex-direction: column;
        height: auto;
        max-height: none;
    }
    .research-sidebar {
        width: 100%;
        max-height: none;
        overflow-y: auto;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        border-right: none;
    }

    /* Agent data boards: tighter padding */
    .agent-data-board {
        padding: 8px;
    }

    /* Mobile FAB */
    .mobile-fab {
        display: block;
    }

    /* Habits modal: full width, scrollable */
    .habit-modal-content {
        max-height: 90vh;
        overflow-y: auto;
    }
    .habit-form-grid {
        grid-template-columns: 1fr !important;
    }

    /* Two-column usage layout: stack */
    .usage-two-col {
        flex-direction: column;
    }

    /* Checkin trackers row */
    .checkin-trackers-row {
        grid-template-columns: 1fr !important;
    }
}

/* Mobile FAB - hidden on desktop */
.mobile-fab {
    display: none;
    position: fixed;
    bottom: 24px;
    right: 16px;
    z-index: 9998;
}
.fab-toggle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2ed573, #00e676);
    border: none;
    color: white;
    font-size: 1.6em;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(46, 213, 115, 0.4);
    transition: transform 0.2s;
}
.fab-toggle:active {
    transform: scale(0.9);
}
.fab-menu {
    display: none;
    position: absolute;
    bottom: 64px;
    right: 0;
    flex-direction: column;
    gap: 8px;
}
.fab-menu.open {
    display: flex;
}
.fab-item {
    padding: 10px 16px;
    background: rgba(30, 30, 30, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: white;
    font-size: 0.9em;
    cursor: pointer;
    white-space: nowrap;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.fab-item:active {
    background: rgba(46, 213, 115, 0.3);
}

/* Mobile bottom sheet overlay */
.mobile-sheet-backdrop {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 10000;
}
.mobile-sheet-backdrop.open {
    display: block;
}
.mobile-sheet {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: #1a1a1a;
    border-radius: 16px 16px 0 0;
    border: 1px solid rgba(255,255,255,0.15);
    border-bottom: none;
    z-index: 10001;
    max-height: 70vh;
    overflow-y: auto;
    padding: 12px 0 24px 0;
    transform: translateY(100%);
    transition: transform 0.25s ease;
    box-shadow: 0 -8px 32px rgba(0,0,0,0.7);
}
.mobile-sheet.open {
    transform: translateY(0);
}
.mobile-sheet-handle {
    width: 40px;
    height: 4px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    margin: 0 auto 12px auto;
}
.mobile-sheet-title {
    padding: 0 20px 8px 20px;
    font-size: 0.8em;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.mobile-sheet-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    color: #fff;
    font-size: 1em;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
}
.mobile-sheet-item:active {
    background: rgba(46,213,115,0.15);
}
.mobile-sheet-item .tab-icon {
    font-size: 1.2em;
}

/* ══════════════════════════════════════════════════════════════
   MOBILE ACCORDION — collapsible sections on ≤768px
   Desktop completely unaffected.
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    /* --- Collapsible column headers --- */
    .column-header {
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 14px;
        margin: 0 -12px;
        border-radius: 8px;
        transition: background 0.15s;
        -webkit-tap-highlight-color: transparent;
        user-select: none;
        min-height: 44px;
        touch-action: manipulation;
    }
    .column-header:active {
        background: rgba(46, 213, 115, 0.1);
    }
    .column-header::after {
        content: '▾';
        font-size: 0.8em;
        color: #888;
        transition: transform 0.3s ease;
        flex-shrink: 0;
        margin-left: 8px;
    }
    .column-header.collapsed::after {
        transform: rotate(-90deg);
    }
    .column-content {
        overflow: hidden;
        transition: max-height 0.35s ease, opacity 0.25s ease;
        max-height: 2000px;
        opacity: 1;
    }
    .column-content.collapsed {
        max-height: 0 !important;
        opacity: 0;
        padding: 0;
    }

    /* --- Collapsible stats bar --- */
    .stats-bar {
        cursor: pointer;
        position: relative;
        -webkit-tap-highlight-color: transparent;
        min-height: 44px;
        padding: 10px 14px;
        touch-action: manipulation;
    }
    .stats-bar::before {
        content: '📊 Stats';
        display: none;
    }
    .stats-bar.collapsed .stat {
        display: none;
    }
    .stats-bar.collapsed::before {
        display: flex;
        align-items: center;
        gap: 6px;
        color: #888;
        font-size: 0.9em;
    }

    /* --- Collapsible filters --- */
    .filters {
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        min-height: 44px;
        padding: 10px 14px;
        position: relative;
        touch-action: manipulation;
    }
    .filters.collapsed .filter-btn {
        display: none;
    }
    .filters.collapsed label {
        display: none;
    }
    .filters.collapsed::before {
        content: '🔽 Filters';
        display: block;
        color: #888;
        font-size: 0.9em;
    }
    .filters::before {
        content: '';
        display: none;
    }

    /* --- Collapsible board sections (calendar, gut health, etc.) --- */
    .board-title {
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        user-select: none;
        display: flex;
        align-items: center;
        gap: 8px;
        min-height: 44px;
        touch-action: manipulation;
    }
    .board-title::after {
        content: '▾';
        font-size: 0.8em;
        color: #888;
        transition: transform 0.3s ease;
        margin-left: auto;
        flex-shrink: 0;
    }
    .board-title.collapsed::after {
        transform: rotate(-90deg);
    }
    .board-title p {
        display: none;
    }

    /* --- Column styling: stack and spacing --- */
    .column {
        background: rgba(255, 255, 255, 0.02);
        border: 1px solid rgba(255, 255, 255, 0.06);
        border-radius: 10px;
        padding: 8px 12px 12px;
        margin-bottom: 8px;
    }

    /* --- Touch-friendly cards --- */
    .task-card {
        padding: 12px;
        min-height: 48px;
        margin-bottom: 6px;
    }
    .task-card .task-actions button {
        min-width: 36px;
        min-height: 36px;
        font-size: 1em;
    }

    /* --- Button sizing --- */
    .btn {
        min-height: 44px;
        padding: 10px 16px;
        font-size: 0.95em;
    }

    /* --- General spacing reductions --- */
    .app {
        padding: 10px 8px;
    }
    .board {
        padding: 0 4px 16px;
    }
    .columns-container {
        gap: 0;
    }

    /* --- Calendar board mobile --- */
    .calendar-container {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 8px 0;
    }
    .calendar-section {
        padding: 14px;
    }
    .calendar-section h3 {
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 44px;
        -webkit-tap-highlight-color: transparent;
    }
    .calendar-section h3::after {
        content: '▾';
        font-size: 0.7em;
        color: #888;
        transition: transform 0.3s ease;
    }
    .calendar-section h3.collapsed::after {
        transform: rotate(-90deg);
    }
    .calendar-section .reminder-list {
        overflow: hidden;
        transition: max-height 0.35s ease, opacity 0.25s ease;
        max-height: 2000px;
        opacity: 1;
    }
    .calendar-section .reminder-list.collapsed {
        max-height: 0;
        opacity: 0;
    }

    /* --- Gut health: compact form --- */
    .gut-form .form-group {
        margin-bottom: 12px;
    }
    .gut-form input, .gut-form textarea, .gut-form select {
        font-size: 16px;
        min-height: 40px;
    }

    /* --- Memory board: compact --- */
    .memory-search-input {
        font-size: 16px;
        min-height: 44px;
    }

    /* --- Key files, research: full width --- */
    .keyfiles-container, .research-content {
        padding: 0;
    }

    /* --- Ideas board: single column --- */
    .ideas-wall {
        columns: 1 !important;
    }

    /* --- Habits: compact calendar grid --- */
    .habits-calendar {
        font-size: 11px;
    }
}
