/* ==========================================================================
   TACTICAL DESIGN SYSTEM - nLight.fit
   Sharp, minimal, precision interface
   ========================================================================== */

/* NOTE: CSS Variables for consistent tactical palette */
:root {
    --bg-void: #0a0a0a;           /* Deepest black - void */
    --bg-base: #111111;           /* Base background */
    --bg-surface: #1a1a1a;        /* Surface elements */
    --bg-elevated: #222222;       /* Elevated/hover states */
    --border-subtle: #2a2a2a;     /* Subtle borders */
    --border-default: #333333;    /* Default borders */
    --border-active: #39ff14;     /* Active/accent borders */
    --text-primary: #e0e0e0;      /* Primary text */
    --text-secondary: #888888;    /* Secondary text */
    --text-muted: #555555;        /* Muted/disabled text */
    --accent: #39ff14;            /* Primary accent - neon green */
    --accent-dim: rgba(57, 255, 20, 0.15);  /* Dimmed accent */
    --error: #ff4444;             /* Error state */
    --warning: #ff8800;           /* Warning state */
    --radius-sharp: 2px;          /* Sharp corners - tactical */
    --radius-none: 0;             /* No radius - angular */
    --font-mono: 'SF Mono', 'Fira Code', 'JetBrains Mono', 'Consolas', monospace;
    --font-system: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

body {
    font-family: var(--font-mono);
    background-color: var(--bg-base);
    color: var(--text-primary);
    padding: 12px;
    height: 100vh;
    /* Prevent scrolling on body - only container scrolls */
    overflow: hidden;
    /* NOTE: Slight letter spacing for tactical feel */
    letter-spacing: 0.3px;
}

.container {
    max-width: 100%;
    /* Enable scrolling ONLY on container, not body */
    overflow-x: auto;
    overflow-y: auto;
    /* Fixed height */
    height: calc(100vh - 80px);
    position: relative;
    /* Smooth scrolling on mobile */
    -webkit-overflow-scrolling: touch;
    /* NOTE: Tactical scrollbar - thin and sharp */
    scrollbar-width: thin;
    scrollbar-color: var(--accent) var(--bg-base);
    /* Ensure content isn't cut off at bottom */
    padding-bottom: 20px;
}

/* NOTE: Custom scrollbar - sharp tactical style */
.container::-webkit-scrollbar {
    height: 6px;
    width: 6px;
}

.container::-webkit-scrollbar-track {
    background: var(--bg-base);
    border-radius: 0;  /* Sharp corners */
}

.container::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 0;  /* Sharp corners */
}

.container::-webkit-scrollbar-thumb:hover {
    background: #2ecc00;
}

.header-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 10px;
    gap: 8px;
    position: relative;
}

h1 {
    color: var(--text-primary);
    margin: 0;
    font-size: 1.1rem;
    font-weight: 400;
    letter-spacing: 2px;
    /* NOTE: No text-transform - preserve "nLight.fit" casing */
}

.month-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.month-display {
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 400;
    min-width: 100px;
    text-align: center;
    letter-spacing: 1px;
}

/* NOTE: Sync Status - tactical minimal indicator */
.sync-status {
    font-size: 0.65rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sync-status .sync-syncing {
    display: none;
    color: var(--accent);
    animation: pulse 1.5s ease-in-out infinite;
}

.sync-status .sync-saved {
    display: none;
    color: var(--accent);
}

.sync-status .sync-error {
    display: none;
    color: var(--error);
}

.sync-status.syncing .sync-syncing {
    display: inline;
}

.sync-status.saved .sync-saved {
    display: inline;
}

.sync-status.error .sync-error {
    display: inline;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* NOTE: Navigation buttons - sharp tactical style */
.nav-btn {
    padding: 4px 8px;
    background-color: transparent;
    color: var(--accent);
    border: 1px solid var(--border-default);
    border-radius: 0;  /* Sharp corners */
    font-size: 0.7rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.15s;
    min-width: 24px;
    font-family: var(--font-mono);
}

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

.nav-btn:active {
    background-color: #2ecc00;
}

/* NOTE: Table - tactical data grid */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background-color: var(--bg-surface);
    box-shadow: none;  /* No shadow - clean tactical */
    font-size: 0.75rem;
    table-layout: fixed;
    min-width: 1000px;
    border: 1px solid var(--border-subtle);
}

thead {
    background-color: var(--bg-base);
    position: sticky;
    top: 0;
    z-index: 100;
}

th {
    padding: 6px 2px;
    text-align: center;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--accent);  /* Accent line under headers */
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.1;
    font-size: 0.55rem;
    position: sticky;
    top: 0;
    background-color: var(--bg-base);
    z-index: 100;
    user-select: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* NOTE: Freeze Date column - tactical accent border */
th.col-date {
    position: sticky;
    left: 0;
    top: 0;
    z-index: 110;
    background-color: var(--bg-base);
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.4);
    border-right: 1px solid var(--accent);
}

.resize-handle {
    position: absolute;
    top: 0;
    right: 0;
    width: 3px;
    height: 100%;
    cursor: col-resize;
    background-color: transparent;
    z-index: 110;
}

.resize-handle:hover {
    background-color: var(--accent);
    opacity: 0.6;
}

td {
    padding: 2px 2px;
    border-bottom: 1px solid var(--border-subtle);
    position: relative;
    font-size: 0.65rem;
    word-wrap: break-word;
    text-align: center;
}

/* NOTE: Column width constraints - tactical compact */
th.col-date,
td.col-date {
    max-width: 45px;
    min-width: 45px;
    text-align: center;
}

/* NOTE: Sticky date column cells */
td.col-date {
    position: sticky;
    left: 0;
    z-index: 5;
    background-color: var(--bg-surface);
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.3);
    border-right: 1px solid var(--accent);
}

/* NOTE: Today's row - tactical highlight */
tbody tr.today-row td.col-date {
    background-color: #0f1f0f !important;
    border-left: 2px solid var(--accent);
}

tbody tr:nth-child(even) td.col-date {
    background-color: var(--bg-elevated);
}

tbody tr.today-row:nth-child(even) td.col-date {
    background-color: #0f1f0f !important;
}

tbody tr:hover td.col-date {
    background-color: var(--bg-elevated);
}

tbody tr.today-row:hover td.col-date {
    background-color: #152515 !important;
}

th.col-compact-checkbox,
td.col-compact-checkbox {
    max-width: 16px; /* Super compact for checkboxes */
    min-width: 16px;
    text-align: center;
}

th.col-compact-number,
td.col-compact-number {
    max-width: 20px; /* Super compact for numbers */
    min-width: 20px;
    text-align: center;
}

th.col-compact-time,
td.col-compact-time {
    max-width: 32px; /* Super compact for time */
    min-width: 32px;
    text-align: center;
}

th.col-workout,
td.col-workout {
    max-width: 32px; /* Super compact for workout */
    min-width: 32px;
    text-align: center;
}

th.col-meal,
td.col-meal {
    max-width: 180px; /* Extended for meal columns - Breakfast, Lunch, Dinner, Snacks */
    min-width: 180px;
    text-align: center;
}

th.col-health,
td.col-health {
    max-width: 30px; /* Super compact for health column */
    min-width: 30px;
    text-align: center;
}

tbody tr:nth-child(even) {
    background-color: var(--bg-elevated);
}

/* NOTE: Today's row - subtle tactical highlight */
tbody tr.today-row {
    background-color: rgba(57, 255, 20, 0.08) !important;
    border-left: 2px solid var(--accent);
}

tbody tr.today-row td {
    background-color: transparent;
}

tbody tr.today-row:hover {
    background-color: rgba(57, 255, 20, 0.15) !important;
}

tbody tr:hover {
    background-color: var(--bg-elevated);
}

tbody tr:last-child td {
    border-bottom: none;
}

/* NOTE: Editable cells - tactical interaction */
.editable {
    cursor: pointer;
    position: relative;
    transition: background-color 0.1s;
}

.editable:hover {
    background-color: var(--bg-elevated);
}

/* Rest day overlay - light blue background for specific metrics */
.rest-day-cell {
    background-color: rgba(135, 206, 250, 0.25) !important; /* Light blue with transparency */
}

.rest-day-cell:hover {
    background-color: rgba(135, 206, 250, 0.35) !important; /* Slightly brighter on hover */
}

/* Traveling overlay - light red background for specific metrics */
.traveling-cell {
    background-color: rgba(255, 99, 71, 0.25) !important; /* Light red with transparency */
}

.traveling-cell:hover {
    background-color: rgba(255, 99, 71, 0.35) !important; /* Slightly brighter on hover */
}

/* Healthy Eating color overlays - color-coded based on eating quality */
.health-high {
    background-color: rgba(144, 238, 144, 0.3) !important; /* Light green for high */
}

.health-high:hover {
    background-color: rgba(144, 238, 144, 0.4) !important; /* Brighter green on hover */
}

.health-medium {
    background-color: rgba(255, 255, 153, 0.3) !important; /* Light yellow for medium */
}

.health-medium:hover {
    background-color: rgba(255, 255, 153, 0.4) !important; /* Brighter yellow on hover */
}

.health-low {
    background-color: rgba(255, 99, 71, 0.3) !important; /* Light red for low */
}

.health-low:hover {
    background-color: rgba(255, 99, 71, 0.4) !important; /* Brighter red on hover */
}

/* NOTE: Editable inputs - tactical sharp style */
.editable input,
.editable select {
    width: 100%;
    padding: 2px 3px;
    background-color: var(--bg-base);
    color: var(--text-primary);
    border: 1px solid var(--accent);
    border-radius: 0;  /* Sharp */
    font-size: 0.65rem;
    font-family: var(--font-mono);
    text-align: center;
}

.editable input:focus,
.editable select:focus {
    outline: none;
    background-color: var(--bg-elevated);
}

/* NOTE: Checkbox - tactical minimal */
.checkbox-cell {
    text-align: center;
}

.checkbox-cell input[type="checkbox"] {
    width: 11px;
    height: 11px;
    cursor: pointer;
    accent-color: var(--accent);
}

/* NOTE: Date cell - tactical accent color */
.date-cell {
    font-weight: 500;
    color: var(--accent);
    white-space: nowrap;
    font-size: 0.6rem;
    text-align: center;
    letter-spacing: 0.5px;
}


/* Number input styling */
input[type="number"] {
    -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Time input styling (MM:SS format for mile run) */
.editable input[placeholder="MM:SS"] {
    font-family: monospace;
    text-align: center;
    letter-spacing: 0.5px;
}

/* ============================================================================
   Authentication & Security Styles
   ============================================================================ */

/* Access Denied Screen */
.access-denied {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: #1a1a1a;
    color: #e0e0e0;
    padding: 20px;
    text-align: center;
}

.access-denied h1 {
    color: #ff4444;
    font-size: 2rem;
    margin-bottom: 20px;
}

.access-denied p {
    font-size: 1.1rem;
    margin-bottom: 30px;
    max-width: 600px;
    line-height: 1.6;
}

.retry-btn {
    padding: 12px 24px;
    background-color: #39ff14;
    color: #000000;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.retry-btn:hover {
    background-color: #2ecc00;
}

.retry-btn:active {
    background-color: #22a000;
}

/* Session Timeout Warning */
.session-warning {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #ff8800;
    color: #000000;
    padding: 15px 20px;
    border-radius: 6px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    max-width: 300px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.session-warning-content {
    font-size: 0.9rem;
    line-height: 1.4;
}

.session-warning-content p {
    margin: 5px 0;
}

.session-warning-content p:first-child {
    font-weight: 600;
}

/* Responsive design - Tablet */
@media (max-width: 1200px) {
    th, td {
        font-size: 0.7rem;
        padding: 3px 3px;
    }
}

/* Mobile optimizations */
@media (max-width: 768px) {
    body {
        padding: 8px;
    }
    
    .container {
        /* More space for table on mobile */
        max-height: calc(100vh - 100px);
        height: calc(100vh - 80px);
        /* Better touch scrolling with hardware acceleration */
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
        transform: translateZ(0);
        will-change: scroll-position;
        contain: layout style paint;
    }
    
    h1 {
        font-size: 1.2rem;
        margin-bottom: 4px;
    }
    
    .header-controls {
        margin-bottom: 8px;
        gap: 8px;
    }
    
    .month-navigation {
        gap: 12px;
    }
    
    .month-display {
        font-size: 0.9rem;
        min-width: 100px;
    }
    
    .nav-btn {
        padding: 6px 10px;
        font-size: 0.85rem;
        min-width: 32px;
        min-height: 32px;
        /* Better touch target */
        touch-action: manipulation;
    }
    
    table {
        /* Larger minimum width to prevent squishing - updated for health columns */
        min-width: 1100px;
        font-size: 0.75rem;
        /* GPU acceleration for smooth scrolling */
        transform: translateZ(0);
        backface-visibility: hidden;
        -webkit-font-smoothing: antialiased;
    }
    
    th {
        padding: 6px 3px;
        font-size: 0.55rem;
        line-height: 1.2;
        /* Better readability */
        white-space: nowrap;
        /* Ensure headers always visible */
        position: sticky;
        top: 0;
        z-index: 500 !important;
        background-color: #1a1a1a;
        will-change: transform;
        transform: translateZ(0);
    }
    
    td {
        padding: 6px 3px;
        font-size: 0.6rem;
    }
    
    /* Increase column widths slightly for better mobile usability */
    th.col-date,
    td.col-date {
        min-width: 70px;
        max-width: 70px;
    }
    
    th.col-compact-checkbox,
    td.col-compact-checkbox {
        min-width: 32px;
        max-width: 32px;
    }
    
    th.col-compact-number,
    td.col-compact-number {
        min-width: 40px;
        max-width: 40px;
    }
    
    th.col-compact-time,
    td.col-compact-time {
        min-width: 50px;
        max-width: 50px;
    }
    
    th.col-workout,
    td.col-workout {
        min-width: 55px;
        max-width: 55px;
    }
    
    th.col-meal,
    td.col-meal {
        min-width: 75px;
        max-width: 75px;
    }
    
    th.col-health,
    td.col-health {
        min-width: 55px;
        max-width: 55px;
    }
    
    /* Larger inputs for easier touch interaction */
    .editable input,
    .editable select {
        padding: 4px 3px;
        font-size: 0.7rem;
        min-height: 28px;
    }
    
    .checkbox-cell input[type="checkbox"] {
        width: 18px;
        height: 18px;
        /* Better touch target */
        cursor: pointer;
    }
    
    .date-cell {
        font-size: 0.7rem;
    }
    
    /* Disable resize handles on mobile */
    .resize-handle {
        display: none;
    }
    
    /* Better scrollbar visibility on mobile */
    .container::-webkit-scrollbar {
        height: 10px;
    }
    
    .container::-webkit-scrollbar-thumb {
        background: #39ff14;
        border-radius: 5px;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    body {
        padding: 6px;
    }
    
    h1 {
        font-size: 1rem;
    }
    
    .container {
        max-height: calc(100vh - 90px);
        height: calc(100vh - 90px);
        /* Even more aggressive GPU acceleration */
        transform: translate3d(0, 0, 0);
        -webkit-transform: translate3d(0, 0, 0);
    }
    
    .month-display {
        font-size: 0.85rem;
        min-width: 90px;
    }
    
    .nav-btn {
        padding: 5px 8px;
        font-size: 0.8rem;
        min-width: 28px;
        min-height: 28px;
    }
    
    table {
        /* Updated for health columns */
        min-width: 1150px;
    }
    
    th {
        padding: 5px 2px;
        font-size: 0.5rem;
    }
    
    td {
        padding: 5px 2px;
        font-size: 0.55rem;
    }
    
    .editable input,
    .editable select {
        padding: 3px 2px;
        font-size: 0.65rem;
        min-height: 26px;
    }
    
    /* Larger scrollbar on small devices */
    .container::-webkit-scrollbar {
        height: 12px;
    }
    
    /* Mobile security UI */
    .access-denied {
        padding: 15px;
    }
    
    .access-denied h1 {
        font-size: 1.5rem;
    }
    
    .access-denied p {
        font-size: 1rem;
    }
    
    .session-warning {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        padding: 12px 15px;
    }
    
    /* Additional scroll optimization for small devices */
    .container {
        /* Even more aggressive GPU acceleration */
        transform: translate3d(0, 0, 0);
        -webkit-transform: translate3d(0, 0, 0);
    }
    
    /* Ensure headers remain strongly visible */
    thead {
        z-index: 500 !important;
    }
    
    th {
        z-index: 500 !important;
    }
    
    th.col-date {
        z-index: 600 !important;
    }
}


/* ============================================================================
   Settings Button & Modal Styles
   ============================================================================ */

/* NOTE: Settings button - tactical style */
.settings-btn-header {
    background: transparent;
    border: 1px solid var(--border-default);
    color: var(--accent);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 0;  /* Sharp */
    font-size: 1rem;
    transition: all 0.15s;
    margin-left: 12px;
}

.settings-btn-header:hover {
    border-color: var(--accent);
    background: var(--accent-dim);
}

/* NOTE: Settings modal - tactical overlay */
.settings-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

/* NOTE: Settings modal - sharp tactical container */
.settings-modal {
    background: var(--bg-base);
    border: 1px solid var(--accent);
    border-radius: 0;  /* Sharp */
    width: 100%;
    max-width: min(1100px, calc(100vw - 40px)); /* NOTE: Wider modal to match the Profile window width */
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 40px rgba(57, 255, 20, 0.1);
    outline: none;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #333;
}

.settings-header h2 {
    margin: 0;
    font-size: 1.2rem;
    color: #fff;
}

.settings-close-btn {
    background: transparent;
    border: none;
    color: #888;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.settings-close-btn:hover {
    color: #ff4444;
}

.settings-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.settings-section {
    margin-bottom: 24px;
}

.settings-section h3 {
    color: #39ff14;
    font-size: 0.9rem;
    margin: 0 0 8px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.settings-hint {
    color: #666;
    font-size: 0.75rem;
    margin: 0 0 12px 0;
}

/* Column list */
.column-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.column-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #2a2a2a;
    border-radius: 4px;
    border: 1px solid #333;
    cursor: grab;
    transition: all 0.2s;
}

.column-item:hover {
    border-color: #444;
    background: #333;
}

.column-item.dragging {
    opacity: 0.5;
    border-color: #39ff14;
}

.column-item-drag {
    color: #555;
    font-size: 0.9rem;
    cursor: grab;
    user-select: none;
}

.column-item-visibility {
    flex-shrink: 0;
}

.column-item-visibility input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #39ff14;
    cursor: pointer;
}

.column-item-visibility input[type="checkbox"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.column-item-label {
    flex: 1;
}

.column-label-input {
    width: 100%;
    background: transparent;
    border: 1px solid transparent;
    color: #e0e0e0;
    padding: 4px 6px; /* NOTE: Keep label editing tight/compact */
    border-radius: 3px;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.column-label-input:hover {
    border-color: #444;
}

.column-label-input:focus {
    outline: none;
    border-color: #39ff14;
    background: #1a1a1a;
}

.column-item-type {
    color: #666;
    font-size: 0.7rem;
    text-transform: uppercase;
    flex-shrink: 0;
    min-width: 60px;
    text-align: right;
}

.column-item-actions {
    flex-shrink: 0;
    min-width: 30px;
    text-align: center;
}

.column-delete-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 2px 4px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.column-delete-btn:hover {
    opacity: 1;
}

/* Add column button */
.add-column-btn {
    width: 100%;
    padding: 10px;
    background: transparent;
    border: 1px dashed #444;
    color: #888;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
    margin-top: 8px;
}

.add-column-btn:hover {
    border-color: #39ff14;
    color: #39ff14;
    background: rgba(57, 255, 20, 0.05);
}

/* Add column form */
.add-column-form {
    background: #2a2a2a;
    border: 1px solid #39ff14;
    border-radius: 4px;
    padding: 12px;
    margin-top: 8px;
}

.add-column-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.add-column-name {
    flex: 1;
    padding: 6px 8px; /* NOTE: Compact input padding */
    background: #1a1a1a;
    border: 1px solid #444;
    color: #e0e0e0;
    border-radius: 4px;
    font-size: 0.75rem; /* NOTE: Compact input font-size */
}

.add-column-name:focus {
    outline: none;
    border-color: #39ff14;
}

.add-column-type {
    padding: 6px 8px; /* NOTE: Compact select padding */
    background: #1a1a1a;
    border: 1px solid #444;
    color: #e0e0e0;
    border-radius: 4px;
    font-size: 0.75rem; /* NOTE: Compact select font-size */
    cursor: pointer;
}

.add-column-type:focus {
    outline: none;
    border-color: #39ff14;
}

.add-column-options {
    margin-bottom: 8px;
}

.add-column-options-input {
    width: 100%;
    padding: 6px 8px; /* NOTE: Compact options input padding */
    background: #1a1a1a;
    border: 1px solid #444;
    color: #e0e0e0;
    border-radius: 4px;
    font-size: 0.75rem; /* NOTE: Compact options input font-size */
}

/* ============================================================================
   Profile Modal (AI personalization) - Wide + Compact Inputs
   ============================================================================ */

/* NOTE: Profile modal is inline-styled in `js/app.js` so CSS uses !important overrides. */
#profileOverlay {
    padding: 20px !important; /* NOTE: More breathing room while keeping the modal wide */
}

#profileModal {
    width: min(1100px, calc(100vw - 40px)) !important;
    max-width: min(1100px, calc(100vw - 40px)) !important; /* NOTE: Override inline max-width: 600px */
}

/* NOTE: Make all Profile form controls dense (applies to inputs/selects/textarea). */
#profileModal input,
#profileModal select,
#profileModal textarea {
    /* NOTE: Readability first: force dark controls + bright text (some browsers/auto-fill can turn inputs white). */
    background: #252525 !important;
    color: #e0e0e0 !important;
    border: 1px solid #444 !important;
    border-radius: 4px !important;

    /* NOTE: Density: compact control height. */
    padding: 3px 6px !important;
    font-size: 0.72rem !important;
    line-height: 1.1 !important;
}

/* NOTE: Labels are part of density; reduce size + spacing. */
#profileModal label {
    font-size: 0.6rem !important;
    margin-bottom: 2px !important;
}

/* NOTE: Ensure placeholders are readable on dark backgrounds. */
#profileModal input::placeholder,
#profileModal textarea::placeholder {
    color: #777 !important;
    opacity: 1 !important;
}

/* NOTE: Clear focus ring while keeping the tactical accent. */
#profileModal input:focus,
#profileModal select:focus,
#profileModal textarea:focus {
    outline: none !important;
    border-color: #39ff14 !important;
    box-shadow: 0 0 0 2px rgba(57, 255, 20, 0.12) !important;
}

/* NOTE: Chrome/Safari autofill can force light backgrounds; pin it to our dark theme. */
#profileModal input:-webkit-autofill,
#profileModal input:-webkit-autofill:hover,
#profileModal input:-webkit-autofill:focus,
#profileModal textarea:-webkit-autofill,
#profileModal textarea:-webkit-autofill:hover,
#profileModal textarea:-webkit-autofill:focus,
#profileModal select:-webkit-autofill,
#profileModal select:-webkit-autofill:hover,
#profileModal select:-webkit-autofill:focus {
    -webkit-text-fill-color: #e0e0e0 !important;
    box-shadow: 0 0 0px 1000px #252525 inset !important;
    transition: background-color 9999s ease-in-out 0s;
}

/* NOTE: Diet approach "chips" - make them denser. */
#dietApproachesContainer label {
    padding: 2px 4px !important;
    font-size: 0.62rem !important;
    gap: 3px !important;
}

#dietApproachesContainer input[type="checkbox"] {
    width: 10px !important;
    height: 10px !important;
}

.add-column-options-input:focus {
    outline: none;
    border-color: #39ff14;
}

.add-column-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* Settings footer */
.settings-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-top: 1px solid #333;
    gap: 12px;
}

.settings-footer-right {
    display: flex;
    gap: 8px;
}

/* Settings buttons */
.settings-btn {
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid;
}

.settings-btn-primary {
    background: #39ff14;
    color: #000;
    border-color: #39ff14;
    font-weight: 600;
}

.settings-btn-primary:hover {
    background: #2ecc00;
    border-color: #2ecc00;
}

.settings-btn-secondary {
    background: transparent;
    color: #888;
    border-color: #444;
}

.settings-btn-secondary:hover {
    color: #fff;
    border-color: #666;
}

/* Custom column CSS class */
.col-custom {
    min-width: 60px;
    max-width: 120px;
    text-align: center;
}

/* Mobile responsive settings */
@media (max-width: 768px) {
    .settings-modal {
        max-height: 90vh;
        margin: 10px;
    }
    
    .settings-header {
        padding: 12px 16px;
    }
    
    .settings-body {
        padding: 16px;
    }
    
    .settings-footer {
        flex-direction: column;
        gap: 10px;
        padding: 12px 16px;
    }
    
    .settings-footer-right {
        width: 100%;
        justify-content: flex-end;
    }
    
    .column-item {
        padding: 6px 8px;
    }
    
    .column-item-type {
        display: none;
    }
    
    .add-column-row {
        flex-direction: column;
    }
    
    .settings-btn-header {
        padding: 6px 10px;
        font-size: 1rem;
    }
}

/* NOTE: Bottom controls - tactical command bar */
.csv-buttons {
    position: fixed;
    bottom: 16px;
    left: 16px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
    z-index: 1000;
    background: var(--bg-base);
    padding: 6px 10px;
    border-radius: 0;  /* Sharp */
    border: 1px solid var(--border-subtle);
}

.csv-controls {
    position: fixed;
    bottom: 16px;
    left: 16px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
    z-index: 1000;
    background: var(--bg-base);
    padding: 6px 10px;
    border-radius: 0;  /* Sharp */
    border: 1px solid var(--border-subtle);
}

.csv-label {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.csv-separator {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* NOTE: Control buttons - tactical style */
.csv-btn {
    background: transparent;
    border: 1px solid var(--border-default);
    color: var(--accent);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 0;  /* Sharp */
    font-size: 1rem;
    transition: all 0.15s;
    line-height: 1;
}

.csv-btn:hover {
    border-color: var(--accent);
    background: var(--accent-dim);
}

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

/* Responsive adjustments for mobile - CSV & bottom controls */
@media (max-width: 768px) {
    /* Hide CSV buttons on mobile - better UX, use desktop for exports */
    .csv-buttons,
    .csv-controls {
        display: none !important;
    }
    
    /* But SHOW the bottom controls (Settings, AI, Logout) on mobile */
    #bottomControls {
        display: flex !important;
        bottom: 12px;
        left: 12px;
        padding: 6px 10px;
        gap: 6px;
    }
    
    /* Make buttons larger for better touch targets on mobile */
    #bottomControls .csv-btn {
        padding: 10px 14px;
        min-width: 44px;
        min-height: 44px;
        font-size: 1.3rem;
    }
    
    /* NOTE: Scroll optimization is already in the main mobile media query above.
     * Additional sticky header enhancements: */
    
    /* Strengthen sticky headers with shadow for visual separation */
    thead {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    }
    
    /* Date column - double shadow for both scroll directions */
    th.col-date {
        box-shadow: 
            2px 0 8px rgba(0, 0, 0, 0.5),
            0 2px 8px rgba(0, 0, 0, 0.6);
    }
}

/* ==========================================================================
   ONBOARDING STYLES
   NOTE: Extracted from inline styles in auth.js for maintainability
   ========================================================================== */

/* NOTE: Login container - full-screen void background */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: var(--bg-void);
}

/* NOTE: Onboarding container with centered content */
.onboarding-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: var(--bg-void);
    padding: 20px;
}

/* NOTE: Onboarding card - main content container */
.onboarding-card {
    max-width: 520px;
    width: 100%;
    font-family: var(--font-mono);
}

/* NOTE: Onboarding title - green accent heading */
.onboarding-title {
    color: var(--accent);
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 2px;
    margin: 0 0 6px 0;
    text-align: center;
}

/* NOTE: Onboarding subtitle - muted helper text */
.onboarding-subtitle {
    color: #666;
    font-size: 0.7rem;
    text-align: center;
    margin: 0 0 20px 0;
    line-height: 1.5;
}

/* NOTE: Onboarding form label - uppercase muted */
.onboarding-label {
    display: block;
    color: #555;
    font-size: 0.6rem;
    margin-bottom: 4px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* NOTE: Onboarding text input */
.onboarding-input {
    width: 100%;
    padding: 10px;
    background: var(--bg-base);
    border: 1px solid var(--border-default);
    color: var(--text-primary);
    font-size: 0.8rem;
    font-family: var(--font-mono);
    box-sizing: border-box;
    transition: border-color 0.15s;
}

.onboarding-input:focus {
    outline: none;
    border-color: var(--accent);
}

/* NOTE: Onboarding primary button - green CTA */
.onboarding-btn {
    width: 100%;
    padding: 14px;
    background: var(--accent);
    color: #000;
    border: none;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.15s;
    margin-top: 20px;
}

.onboarding-btn:hover {
    filter: brightness(1.1);
}

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

/* NOTE: Onboarding skip/secondary button */
.onboarding-btn-skip {
    background: transparent;
    border: 1px solid var(--border-default);
    color: var(--text-secondary);
}

.onboarding-btn-skip:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

/* NOTE: Selection chip for multi-select options */
.onboarding-chip {
    display: inline-block;
    padding: 8px 12px;
    margin: 3px;
    background: transparent;
    border: 1px solid var(--border-default);
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-family: var(--font-mono);
    cursor: pointer;
    transition: all 0.15s;
}

.onboarding-chip:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.onboarding-chip.selected {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-dim);
}

/* NOTE: Onboarding form group spacing */
.onboarding-group {
    margin-bottom: 16px;
}

/* NOTE: 2-column grid for compact layouts */
.onboarding-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 20px;
}

/* NOTE: Benefit card in 2x2 grid */
.onboarding-benefit {
    background: var(--bg-base);
    padding: 12px;
    border-left: 2px solid var(--accent);
}

.onboarding-benefit-title {
    color: var(--accent);
    font-size: 0.6rem;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.onboarding-benefit-desc {
    color: var(--text-secondary);
    font-size: 0.6rem;
}

/* NOTE: Progress indicator for onboarding steps */
.onboarding-progress {
    color: #444;
    font-size: 0.6rem;
    text-align: center;
    margin-bottom: 6px;
    letter-spacing: 2px;
}

/* NOTE: Onboarding textarea for longer inputs */
.onboarding-textarea {
    width: 100%;
    padding: 10px;
    background: var(--bg-base);
    border: 1px solid var(--border-default);
    color: var(--text-primary);
    font-size: 0.75rem;
    font-family: var(--font-mono);
    box-sizing: border-box;
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.15s;
}

.onboarding-textarea:focus {
    outline: none;
    border-color: var(--accent);
}

/* NOTE: Privacy modal overlay */
.privacy-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.privacy-modal.active {
    display: flex;
}

.privacy-modal-content {
    background: var(--bg-void);
    border: 1px solid var(--border-default);
    padding: 24px;
    max-width: 300px;
    font-family: var(--font-mono);
}

/* NOTE: Login box - ultra compact */
.login-box {
    width: 240px;
    padding: 0;
}

/* NOTE: Login logo with split color */
.login-logo {
    text-align: center;
    margin: 0 0 32px 0;
    font-size: 1.4rem;
    font-family: var(--font-mono);
    font-weight: 300;
    letter-spacing: 2px;
    position: relative;
}

.login-logo-n { color: #666; }
.login-logo-light { color: #888; }
.login-logo-ai { color: var(--accent); }

/* NOTE: Privacy info button on login */
.privacy-info-btn {
    position: absolute;
    right: -28px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid var(--border-default);
    background: transparent;
    color: #555;
    font-size: 0.65rem;
    font-family: var(--font-mono);
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.privacy-info-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* NOTE: Login form input */
.login-input {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border-default);
    color: var(--text-primary);
    font-size: 0.8rem;
    font-family: var(--font-mono);
    margin-bottom: 16px;
    transition: border-color 0.15s;
}

.login-input:focus {
    outline: none;
    border-bottom-color: var(--accent);
}

/* NOTE: Login submit button */
.login-submit {
    width: 100%;
    padding: 12px;
    background: var(--accent);
    color: #000;
    border: none;
    font-size: 0.7rem;
    font-weight: 600;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.15s;
}

.login-submit:hover {
    filter: brightness(1.1);
}

.login-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* NOTE: Login toggle (switch between login/register) */
.login-toggle {
    text-align: center;
    margin-top: 20px;
}

.login-toggle-text {
    color: #555;
    font-size: 0.65rem;
}

.login-toggle-link {
    color: var(--accent);
    cursor: pointer;
    font-size: 0.65rem;
    border: none;
    background: none;
    font-family: var(--font-mono);
    text-decoration: underline;
}

.login-toggle-link:hover {
    color: #fff;
}

/* NOTE: Demo button - allows users to preview app with sample data */
.login-demo-btn {
    width: 100%;
    margin-top: 20px;
    padding: 12px;
    background: transparent;
    border: 1px dashed var(--accent);
    color: var(--accent);
    font-size: 0.7rem;
    font-family: var(--font-mono);
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
}

.login-demo-btn:hover {
    background: rgba(57, 255, 20, 0.1);
    border-style: solid;
}

/* NOTE: Login error message */
.login-error {
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid var(--error);
    color: var(--error);
    padding: 10px;
    margin-bottom: 16px;
    font-size: 0.7rem;
    display: none;
}

.login-error.visible {
    display: block;
}

/* ==========================================================================
   VOICE AGENT STYLES - Real-time voice conversations with Grok
   ========================================================================== */

/* NOTE: Voice mode panel container */
#voiceModePanel {
    animation: voiceFadeIn 0.3s ease-out;
}

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

/* NOTE: Voice status orb - pulsing animation when listening */
#voiceStatusOrb {
    transition: all 0.3s ease-out;
    will-change: transform, box-shadow;
}

#voiceStatusOrb:hover {
    transform: scale(1.05);
}

/* NOTE: Listening state - pulsing green glow */
#voiceStatusOrb.listening {
    animation: voicePulse 1.5s ease-in-out infinite;
}

@keyframes voicePulse {
    0%, 100% {
        box-shadow: 0 0 30px rgba(57, 255, 20, 0.4);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 60px rgba(57, 255, 20, 0.7);
        transform: scale(1.05);
    }
}

/* NOTE: Speaking state - purple wave animation */
#voiceStatusOrb.speaking {
    animation: voiceWave 1s ease-in-out infinite;
}

@keyframes voiceWave {
    0%, 100% {
        box-shadow: 0 0 30px rgba(170, 102, 255, 0.4);
    }
    50% {
        box-shadow: 0 0 50px rgba(170, 102, 255, 0.6);
    }
}

/* NOTE: Processing state - rotating indicator */
#voiceStatusOrb.processing {
    animation: voiceProcess 2s linear infinite;
}

@keyframes voiceProcess {
    0% {
        box-shadow: 0 0 30px rgba(0, 170, 255, 0.3);
    }
    50% {
        box-shadow: 0 0 50px rgba(0, 170, 255, 0.5);
    }
    100% {
        box-shadow: 0 0 30px rgba(0, 170, 255, 0.3);
    }
}

/* NOTE: Voice transcript area styling */
#voiceTranscript {
    transition: all 0.2s ease-out;
}

#voiceTranscript:not(:empty) {
    border-color: var(--border-default);
}

/* NOTE: Voice mode toggle button active state */
#aiVoiceModeToggle.active {
    border-color: var(--accent) !important;
    color: var(--accent) !important;
    background: rgba(57, 255, 20, 0.1) !important;
}

/* NOTE: End voice button hover state */
#voiceEndBtn:hover {
    background: rgba(255, 68, 68, 0.1);
    color: #ff6666;
    border-color: #ff6666;
}

/* NOTE: Audio level visualizer bars (optional enhancement) */
.voice-level-bar {
    height: 4px;
    background: linear-gradient(90deg, var(--accent), #00ff88);
    border-radius: 2px;
    transition: width 0.1s ease-out;
}

/* NOTE: Responsive voice panel for mobile */
@media (max-width: 640px) {
    #voiceModePanel {
        padding: 24px 16px;
    }
    
    #voiceStatusOrb {
        width: 100px;
        height: 100px;
        font-size: 2rem;
    }
    
    #voiceTranscript {
        font-size: 0.7rem;
        padding: 10px 12px;
    }
}

/* ==========================================================================
   LOADING SKELETONS - Smooth loading states for data fetches
   ========================================================================== */

/* NOTE: Base skeleton animation - shimmer effect */
@keyframes skeleton-shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* NOTE: Skeleton row for table loading state */
.skeleton-row {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 4px;
    border-bottom: 1px solid var(--border-subtle);
}

/* NOTE: Skeleton cell placeholder */
.skeleton-cell {
    height: 16px;
    background: linear-gradient(
        90deg,
        var(--bg-surface) 0%,
        var(--bg-elevated) 50%,
        var(--bg-surface) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 2px;
}

/* NOTE: Different skeleton cell widths based on column type */
.skeleton-cell--date {
    width: 45px;
    flex-shrink: 0;
}

.skeleton-cell--checkbox {
    width: 16px;
    flex-shrink: 0;
}

.skeleton-cell--number {
    width: 20px;
    flex-shrink: 0;
}

.skeleton-cell--time {
    width: 32px;
    flex-shrink: 0;
}

.skeleton-cell--text {
    flex: 1;
    min-width: 60px;
    max-width: 180px;
}

/* NOTE: Loading overlay for modals and panels */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 10, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

/* NOTE: Loading spinner - tactical style */
.loading-spinner {
    width: 32px;
    height: 32px;
    border: 2px solid var(--border-subtle);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* NOTE: Loading message text */
.loading-message {
    color: var(--text-muted);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 12px;
    text-align: center;
}

/* NOTE: Inline loading indicator for buttons */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 14px;
    height: 14px;
    margin: -7px 0 0 -7px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* ==========================================================================
   DYNAMIC UI CLASSES - Replaces inline styles from JS
   ========================================================================== */

/* NOTE: View mode toggle container */
.view-mode-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 12px;
    padding: 4px 8px;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: 4px;
    font-size: 0.65rem;
    font-family: var(--font-mono);
}

/* NOTE: View mode toggle buttons */
.view-mode-btn {
    background: transparent;
    color: var(--text-muted);
    border: none;
    padding: 3px 8px;
    font-size: 0.6rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.view-mode-btn:hover {
    color: var(--text-secondary);
}

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

/* NOTE: View mode separator */
.view-mode-separator {
    color: var(--border-default);
}

/* NOTE: Bottom controls container */
.bottom-controls {
    position: fixed;
    bottom: 16px;
    left: 16px;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 1000;
    background: var(--bg-base);
    padding: 6px 10px;
    border-radius: 0;
    border: 1px solid var(--border-subtle);
}

/* NOTE: Quick action button base styles */
.quick-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: transparent;
    border: 1px solid var(--border-default);
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-family: var(--font-mono);
    cursor: pointer;
    transition: all 0.15s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.quick-action-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-dim);
}

.quick-action-btn.active {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-dim);
}

/* NOTE: AI period selector button */
.ai-period-btn {
    padding: 6px 10px;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-default);
    font-size: 0.65rem;
    font-family: var(--font-mono);
    cursor: pointer;
    transition: all 0.15s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ai-period-btn:hover {
    border-color: var(--text-secondary);
    color: var(--text-secondary);
}

.ai-period-btn.active {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}

/* NOTE: Tooltip styles */
.tooltip {
    position: fixed;
    background: var(--bg-elevated);
    color: var(--text-primary);
    padding: 4px 8px;
    border: 1px solid var(--border-default);
    font-size: 0.6rem;
    font-family: var(--font-mono);
    z-index: 10001;
    pointer-events: none;
    white-space: nowrap;
}

/* NOTE: Message bubble styles for AI chat */
.chat-message {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 4px;
    font-size: 0.8rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.chat-message--user {
    background: var(--bg-elevated);
    color: var(--text-primary);
    margin-left: auto;
    border: 1px solid var(--border-default);
}

.chat-message--ai {
    background: var(--bg-surface);
    color: var(--text-primary);
    border-left: 2px solid var(--accent);
}

.chat-message--error {
    color: var(--error);
}

/* NOTE: Chat timestamp */
.chat-timestamp {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* NOTE: Typing indicator animation */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    background: var(--bg-surface);
    border-left: 2px solid var(--accent);
    border-radius: 4px;
    max-width: 80px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    animation: typing-bounce 1.4s ease-in-out infinite;
}

.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

/* NOTE: Suggestions container */
.suggestions-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

/* NOTE: Suggestion button */
.suggestion-btn {
    padding: 6px 10px;
    background: transparent;
    border: 1px solid var(--border-default);
    color: var(--text-secondary);
    font-size: 0.65rem;
    font-family: var(--font-mono);
    cursor: pointer;
    transition: all 0.15s;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.suggestion-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* NOTE: Reformatter button */
.reformatter-btn {
    padding: 4px 8px;
    background: transparent;
    border: 1px dashed var(--border-default);
    color: var(--text-muted);
    font-size: 0.6rem;
    font-family: var(--font-mono);
    cursor: pointer;
    transition: all 0.15s;
}

.reformatter-btn:hover {
    border-color: var(--accent);
    border-style: solid;
    color: var(--accent);
}

/* NOTE: Chat message animations */
@keyframes message-slide-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* NOTE: Chat message wrapper */
.chat-message-wrapper {
    display: flex;
    flex-direction: column;
    margin-bottom: 8px;
    animation: message-slide-in 0.3s ease-out;
}

.chat-message-wrapper--user {
    align-items: flex-end;
}

.chat-message-wrapper--ai {
    align-items: flex-start;
}

/* NOTE: Chat message bubble */
.chat-bubble {
    padding: 6px 10px;
    border-radius: 0;
    font-size: 0.65rem;
    font-family: var(--font-mono);
    line-height: 1.3;
}

.chat-bubble--user {
    background: var(--accent);
    color: #000;
    max-width: 85%;
}

.chat-bubble--ai {
    background: var(--bg-base);
    color: #ccc;
    border-left: 2px solid var(--border-default);
    max-width: 100%;
}

/* NOTE: Message timestamp */
.msg-timestamp {
    font-size: 0.6rem;
    color: #444;
    margin-top: 3px;
    font-family: var(--font-mono);
    letter-spacing: 0.5px;
}

