/* ==========================================================================
   BugBoar – Kanban Board Styles
   Clean, minimal, monochrome + blue accent (#3b82f6)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS Custom Properties
   -------------------------------------------------------------------------- */

:root {
    --bg: #ffffff;
    --bg-secondary: #f8f8f8;
    --bg-card: #ffffff;
    --border: #e6e6e6;
    --text: #000000;
    --text-muted: #666666;
    --accent: #00b892;
    --accent-subtle: rgba(0, 184, 146, 0.06);
    --accent-light: rgba(0, 184, 146, 0.12);
    --accent-hover: #00a080;
    --rose: #d4534b;
    --rose-subtle: rgba(212, 83, 75, 0.07);
    --amber: #c49030;
    --amber-subtle: rgba(196, 144, 48, 0.07);
    --green: #00b892;
    --green-subtle: rgba(0, 184, 146, 0.06);
    --danger: #d4534b;
}

@font-face {
    font-family: 'Lato';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/static/fonts/lato-400.woff2') format('woff2');
}
@font-face {
    font-family: 'Lato';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/static/fonts/lato-700.woff2') format('woff2');
}
@font-face {
    font-family: 'Lato';
    font-style: normal;
    font-weight: 900;
    font-display: swap;
    src: url('/static/fonts/lato-900.woff2') format('woff2');
}

/* --------------------------------------------------------------------------
   2. Reset & Base
   -------------------------------------------------------------------------- */

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

.hidden {
    display: none !important;
}

body {
    font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
        'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    font-size: 16px;
    line-height: 1.6;
    letter-spacing: -0.011em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.modal-open {
    overflow: hidden;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent-hover);
    text-decoration: none;
}

/* --------------------------------------------------------------------------
   3. Header & Navigation
   -------------------------------------------------------------------------- */

header {
    padding: 0.85rem 2rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    transition: background-color 0.3s ease;
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.035em;
}

.logo-icon {
    width: 1.75rem;
    height: 1.75rem;
}

.header-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-link:hover {
    text-decoration: none;
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.header-nav {
    display: flex;
    gap: 0.25rem;
    margin-left: 1rem;
}

.nav-link {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 6px;
    transition: color 0.25s ease, background-color 0.25s ease, transform 0.2s ease;
}

.nav-link:hover {
    color: var(--text);
    background: var(--bg-secondary);
    text-decoration: none;
}

.nav-link.active {
    color: var(--text);
    background: var(--bg-secondary);
    font-weight: 600;
}

.project-breadcrumb {
    margin-left: auto;
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.project-breadcrumb a {
    color: var(--accent);
    text-decoration: none;
}

.project-breadcrumb a:hover {
    text-decoration: underline;
}

.project-breadcrumb strong {
    color: var(--text);
}

.settings-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    padding: 3px 10px;
    color: var(--text-muted);
    text-decoration: none;
    font-family: inherit;
    font-weight: 500;
    transition: color 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
}

.settings-btn:hover {
    color: var(--text);
    border-color: var(--text-muted);
    text-decoration: none;
}

/* --------------------------------------------------------------------------
   Chase Animation – Weevil & Boar
   -------------------------------------------------------------------------- */

.chase-scene {
    position: relative;
    width: 120px;
    height: 40px;
    margin-left: auto;
    overflow: hidden;
    flex-shrink: 0;
}

.chase-weevil {
    position: absolute;
    height: 16px;
    top: 8px;
    animation: weevil-fly 4s ease-in-out infinite;
    opacity: 0.85;
}

.chase-boar {
    position: absolute;
    height: 28px;
    top: 8px;
    animation: boar-chase 4s ease-in-out infinite;
}

@keyframes weevil-fly {
    0%   { left: 90px; transform: translateY(0) rotate(0deg); }
        15% {
            left: 80px;
            transform: translateY(-6px) rotate(-8deg);
        }
    
        30% {
            left: 65px;
            transform: translateY(2px) rotate(4deg);
        }
    
        50% {
            left: 50px;
            transform: translateY(-8px) rotate(-6deg);
        }
    
        70% {
            left: 65px;
            transform: translateY(0px) rotate(2deg);
        }
    
        85% {
            left: 80px;
            transform: translateY(-4px) rotate(-4deg);
        }
    100% { left: 90px; transform: translateY(0) rotate(0deg); }
}

@keyframes boar-chase {
    0% {
            left: 40px;
        }
    
        15% {
            left: 25px;
        }
    
        30% {
            left: 12px;
        }
    
        50% {
            left: 0px;
        }
    
        70% {
            left: 12px;
        }
    
        85% {
            left: 25px;
        }
    
        100% {
            left: 40px;
        }
}

@media (max-width: 768px) {
    .chase-scene { display: none; }
}

/* --------------------------------------------------------------------------
   4. Board Summary Bar
   -------------------------------------------------------------------------- */

.board-summary {
    display: flex;
    gap: 1.5rem;
    padding: 0.6rem 2rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.summary-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.summary-dot { background: var(--text-muted); }
.summary-item.done .summary-dot { background: var(--accent); }

/* --------------------------------------------------------------------------
   5. Board – Column Grid
   -------------------------------------------------------------------------- */

.board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    padding: 1rem;
    min-height: calc(100vh - 100px);
}

.column {
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 120px);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.column-done {
    background: var(--bg-secondary);
}

.column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

.column-header h2 {
    font-size: 1.0625rem;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.02em;
}

.column-header h2 { color: var(--text); }

.col-count {
    font-size: 0.75rem;
    font-weight: 700;
    background: var(--border);
    color: var(--text-muted);
    min-width: 22px;
    height: 22px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 7px;
    transition: background-color 0.25s ease, color 0.25s ease;
}

.column-desc {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.add-btn {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    cursor: pointer;
    font-size: 1.35rem;
    line-height: 1;
    transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, transform 0.2s ease;
}

.add-btn:active {
    transform: scale(0.92);
}

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

/* --------------------------------------------------------------------------
   6. Cards
   -------------------------------------------------------------------------- */

.cards {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.875rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.3s cubic-bezier(0.22, 1, 0.36, 1),
                border-color 0.3s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border-color: var(--text-muted);
    text-decoration: none;
}

.card:active {
    transform: translateY(0);
    transition-duration: 0.1s;
}



.card.rejected {
    opacity: 0.6;
    border-left-color: var(--danger);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.card-id {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 700;
    font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', monospace;
}

.card h3 {
    font-size: 0.9375rem;
    font-weight: 900;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    letter-spacing: -0.015em;
    color: var(--text);
}

.card-desc,
.card-criteria {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.card-criteria {
    background: var(--bg-secondary);
    padding: 0.375rem 0.5rem;
    border-radius: 4px;
    border-left: 2px solid var(--border);
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
}

.card-time,
.card-type {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.card-actions {
    display: flex;
    gap: 0.25rem;
}

.card-actions button {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.25s ease;
}

.card-actions button:hover {
    background: var(--bg-secondary);
    color: var(--text);
}

.accept-btn:hover {
    border-color: var(--accent) !important;
    color: var(--accent) !important;
}

.reject-btn:hover {
    border-color: var(--danger) !important;
    color: var(--danger) !important;
}

/* Keyboard-focused card */
.card.kb-focused {
    outline: 2px solid var(--accent);
    outline-offset: -1px;
    box-shadow: 0 0 0 3px var(--accent-light);
}

/* --------------------------------------------------------------------------
   7. Status Badges
   -------------------------------------------------------------------------- */

.card-status,
.status-badge {
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-weight: 700;
    display: inline-block;
    transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.card-status,
.status-badge {
    background: var(--bg-secondary);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.card-status.done,
.status-badge.done {
    color: var(--accent);
    border-color: var(--accent-light);
    background: var(--accent-subtle);
}

.card-status.rejected,
.status-badge.rejected {
    color: var(--rose);
    border-color: var(--rose);
    background: var(--rose-subtle);
}

/* --------------------------------------------------------------------------
   8. Floating Action Button
   -------------------------------------------------------------------------- */

.fab {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--text);
    color: #ffffff;
    border: none;
    font-size: 1.85rem;
    font-weight: 400;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.3s cubic-bezier(0.22, 1, 0.36, 1),
                background-color 0.25s ease;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fab:hover {
    transform: scale(1.08);
    background: var(--accent);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.fab:active {
    transform: scale(0.95);
    transition-duration: 0.1s;
}

/* --------------------------------------------------------------------------
   9. Keyboard Search Bar
   -------------------------------------------------------------------------- */

.kb-search-bar {
    padding: 0.5rem 2rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.kb-search-inner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    max-width: 500px;
}

.kb-search-icon {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', monospace;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.125rem 0.5rem;
}

#kb-search-input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    font-size: 0.9375rem;
    font-weight: 500;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: inherit;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

#kb-search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.kb-search-hint {
    font-size: 0.7rem;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.125rem 0.375rem;
    font-family: inherit;
    white-space: nowrap;
}

/* --------------------------------------------------------------------------
   10. Empty State
   -------------------------------------------------------------------------- */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    border: 1.5px dashed var(--border);
    border-radius: 10px;
    margin: 0.5rem;
    transition: border-color 0.3s ease;
}

.empty-state-sm {
    text-align: center;
    padding: 1rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

/* --------------------------------------------------------------------------
   11. Buttons
   -------------------------------------------------------------------------- */

.btn-primary,
.btn-secondary,
.btn-danger,
.btn-promote,
.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.65rem 1.125rem;
    font-size: 0.9375rem;
    font-family: inherit;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease,
        box-shadow 0.25s ease, transform 0.2s ease;
    line-height: 1.2;
}

.btn-primary:active,
.btn-secondary:active,
.btn-danger:active,
.btn-promote:active {
    transform: scale(0.97);
    transition-duration: 0.1s;
}

.btn-primary {
    background: var(--text);
    border: 1px solid var(--text);
    color: #ffffff;
    font-weight: 700;
}

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

.btn-primary:active {
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    border-color: #bbb;
}

.btn-danger {
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
}

.btn-danger:hover {
    background: var(--danger);
    color: #ffffff;
}

.btn-promote {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
}

.btn-promote:hover {
    background: var(--accent);
    color: #ffffff;
}

.btn-ghost {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    padding: 0.5rem 0.75rem;
}

.btn-ghost:hover {
    color: var(--text);
    background: var(--bg-secondary);
}

/* --------------------------------------------------------------------------
   12. Forms
   -------------------------------------------------------------------------- */

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.9375rem;
    font-weight: 700;
    margin-bottom: 0.375rem;
    color: var(--text);
    letter-spacing: -0.01em;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.7rem 0.85rem;
    font-size: 0.9375rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: inherit;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.form-group textarea {
    resize: vertical;
    min-height: 60px;
}

.form-hint {
    display: block;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 4px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

/* --------------------------------------------------------------------------
   13. Modal
   -------------------------------------------------------------------------- */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: fadeIn 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal-content {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 90%;
    max-width: 520px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.14);
    animation: slideUp 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 900;
    letter-spacing: -0.02em;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    transition: color 0.25s ease, transform 0.2s ease;
}

.close-btn:active {
    transform: scale(0.9);
}

.close-btn:hover {
    color: var(--text);
}

/* Form areas inside modals */
#item-form,
#issue-form,
#project-form,
#project-edit-form,
#project-settings-form {
    padding: 1.25rem;
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* Settings page */
.settings-page {
    max-width: 600px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.settings-page h2 {
    margin-bottom: 1.5rem;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.settings-divider {
    margin: 2rem 0;
    border: none;
    border-top: 1px solid var(--border);
}

.danger-zone {
    padding: 1rem;
    border: 1px solid #dc3545;
    border-radius: 8px;
}

.danger-zone h3 {
    color: #dc3545;
    margin-bottom: 0.75rem;
}

.btn-danger {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
}

.btn-danger:hover {
    background: #c82333;
}

.flash-message {
    background: var(--accent-bg, #e8f5e9);
    border: 1px solid var(--accent, #4caf50);
    color: var(--text);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

/* Detail modal (wider variant) */
.detail-modal-content {
    max-width: 600px;
}

/* Task modal (overlay on top of detail) */
#task-modal {
    z-index: 200;
}

.task-modal-content {
    max-width: 500px;
}

.task-modal-content .detail-section {
    font-size: 0.875rem;
}

/* --------------------------------------------------------------------------
   14. Issue Detail Page / Panel
   -------------------------------------------------------------------------- */

.detail-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
}

.detail-header {
    margin-bottom: 1.5rem;
}

.detail-header .back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 1rem;
    transition: color 0.25s ease;
}

.detail-header .back-link:hover {
    color: var(--accent);
    text-decoration: none;
}

.detail-header h1 {
    font-size: 1.75rem;
    font-weight: 900;
    line-height: 1.25;
    letter-spacing: -0.03em;
}

.detail-body {
    padding: 1.25rem;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.detail-chip {
    font-size: 0.8125rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    font-weight: 600;
    transition: background-color 0.25s ease, border-color 0.25s ease;
}

.detail-chip.status-reported,
.detail-chip.status-triaged,
.detail-chip.status-started { background: var(--bg-secondary); color: var(--text-muted); border-color: var(--border); }
.detail-chip.status-done     { background: var(--accent-subtle); color: var(--accent); border-color: var(--accent-light); }

.detail-section {
    margin-bottom: 1rem;
    font-size: 1rem;
    line-height: 1.65;
    color: var(--text);
}

.detail-section.criteria {
    background: var(--bg-secondary);
    padding: 0.75rem;
    border-radius: 6px;
    border-left: 3px solid var(--border);
}

.detail-section.criteria::before {
    content: "Acceptance Criteria: ";
    font-weight: 600;
    color: var(--text);
}

.detail-section.links {
    display: flex;
    gap: 0.75rem;
}

.detail-time {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-weight: 500;
}

/* --------------------------------------------------------------------------
   15. Detail Actions
   -------------------------------------------------------------------------- */

.detail-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.detail-actions button {
    padding: 0.5rem 1rem;
    font-size: 0.9375rem;
    font-family: inherit;
    font-weight: 600;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    cursor: pointer;
    transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, transform 0.2s ease;
}

.detail-actions button:active {
    transform: scale(0.97);
    transition-duration: 0.1s;
}

.detail-actions button:hover {
    background: var(--bg-secondary);
}

.detail-actions button.promote {
    border-color: var(--accent);
    color: var(--accent);
}

.detail-actions button.promote:hover {
    background: var(--accent);
    color: #ffffff;
}

.detail-actions button.accept {
    border-color: var(--accent);
    color: var(--accent);
}

.detail-actions button.accept:hover {
    background: var(--accent);
    color: #ffffff;
}

.detail-actions button.reject {
    border-color: var(--danger);
    color: var(--danger);
}

.detail-actions button.reject:hover {
    background: var(--danger);
    color: #ffffff;
}

.detail-actions button.delete {
    border-color: transparent;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.detail-actions button.delete:hover {
    color: var(--danger);
    background: var(--rose-subtle);
}

.detail-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1.5rem 0;
}

.review-links {
    display: flex;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

.link-btn {
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
}

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

.link-btn:hover {
    background: var(--accent);
    color: #ffffff;
    text-decoration: none;
}

/* --------------------------------------------------------------------------
   16. Tasks Section
   -------------------------------------------------------------------------- */

.tasks-section {
    margin: 1rem 0;
}

.tasks-section h3 {
    font-size: 1.125rem;
    font-weight: 900;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.task-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.85rem;
    border-left: 3px solid var(--border);
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.25s ease;
}

.task-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.task-item.status-open       { border-left-color: var(--border); }
.task-item.status-started    { border-left-color: var(--text-muted); }
.task-item.status-review-ready { border-left-color: var(--text-muted); }
.task-item.status-done       { border-left-color: var(--accent); }

.task-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.375rem;
}

.task-item-id {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.task-status-badge {
    font-size: 0.7rem;
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
    font-weight: 500;
}

.task-status-badge.open         { background: var(--bg-secondary); color: var(--text-muted); border: 1px solid var(--border); }
.task-status-badge.started      { background: var(--bg-secondary); color: var(--text-muted); border: 1px solid var(--border); }
.task-status-badge.review-ready { background: var(--bg-secondary); color: var(--text-muted); border: 1px solid var(--border); }
.task-status-badge.done         { background: var(--accent-subtle); color: var(--accent); border: 1px solid var(--accent-light); }

.task-item-title {
    font-size: 0.9375rem;
    font-weight: 900;
    line-height: 1.4;
    letter-spacing: -0.01em;
}

.task-item-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    line-height: 1.5;
}

.task-item-actions {
    margin-top: 0.5rem;
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
    align-items: center;
}

.task-action-btn {
    font-size: 0.8125rem;
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: transparent;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, transform 0.2s ease;
    font-family: inherit;
}

.task-action-btn:active {
    transform: scale(0.95);
    transition-duration: 0.1s;
}

.task-action-btn.start  { color: var(--accent); border-color: var(--accent); }
.task-action-btn.start:hover  { background: var(--accent); color: #ffffff; }
.task-action-btn.accept { color: var(--accent); border-color: var(--accent); }
.task-action-btn.accept:hover { background: var(--accent); color: #ffffff; }
.task-action-btn.reject { color: var(--danger); border-color: var(--danger); }
.task-action-btn.reject:hover { background: var(--danger); color: #ffffff; }

.review-actions {
    display: flex;
    gap: 0.375rem;
    align-items: center;
    flex-wrap: wrap;
}

/* Tasks bullet list (compact variant) */
.tasks-bullet-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.task-bullet-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.task-bullet-item:last-child {
    border-bottom: none;
}

.task-bullet-title {
    font-size: 0.875rem;
    font-weight: 500;
}

/* --------------------------------------------------------------------------
   17. Comments Section
   -------------------------------------------------------------------------- */

.comments-section h3 {
    font-size: 1.125rem;
    font-weight: 900;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.comments-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 1rem;
    overscroll-behavior: contain;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
}

.comment {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.85rem;
    margin-bottom: 0.5rem;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.comment-author {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.comment-time {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.comment-content {
    font-size: 0.9375rem;
    line-height: 1.6;
    white-space: pre-wrap;
}

.no-comments {
    text-align: center;
    padding: 1rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Comment form */
#comment-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

#comment-form textarea {
    width: 100%;
    padding: 0.7rem 0.85rem;
    resize: vertical;
    border-radius: 10px;
    font-size: 0.9375rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: inherit;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

#comment-form textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

#comment-form button {
    align-self: flex-end;
    font-size: 0.8rem;
    padding: 0.5rem 0.875rem;
}

/* --- Comment variants --- */

/* Error comment */
.comment-error {
    border-color: var(--danger);
}

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

/* Thinking / processing comment */
.comment-thinking {
    border-left: 3px solid var(--accent);
}

.thinking-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--accent);
    font-size: 0.875rem;
}

/* Work-complete comment */
.comment-work-complete {
    border-left: 3px solid var(--accent);
}

.work-complete-title {
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.work-complete-desc {
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.work-complete-links {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.work-screenshots {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.work-screenshot {
    max-width: 200px;
    max-height: 150px;
    border-radius: 4px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: border-color 0.15s;
}

.work-screenshot:hover {
    border-color: var(--accent);
}

/* Task-proposal comment */
.comment-task-proposal {
    border-left: 3px solid var(--accent);
}

.comment-task-proposal.accepted {
    border-left-color: var(--accent);
}

.proposed-tasks-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.proposed-task-item {
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.proposed-task-item.accepted {
    border-color: var(--accent);
    opacity: 0.7;
}

.proposed-task-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.proposed-task-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    line-height: 1.4;
    white-space: pre-wrap;
}

.proposed-task-criteria {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.proposed-task-action {
    margin-top: 0.75rem;
}

.btn-accept-task {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 4px;
    border: 1px solid var(--accent);
    background: transparent;
    color: var(--accent);
    cursor: pointer;
    font-family: inherit;
    transition: background-color 0.15s, color 0.15s;
}

.btn-accept-task:hover {
    background: var(--accent);
    color: #ffffff;
}

.btn-accept-all {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 4px;
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #ffffff;
    cursor: pointer;
    font-family: inherit;
    transition: opacity 0.15s;
}

.btn-accept-all:hover {
    opacity: 0.85;
}

.accepted-label {
    color: var(--accent);
    font-size: 0.85rem;
}

/* Assistant-log comment */
.comment-assistant-log {
    border-left: 3px solid var(--text-muted);
}

.comment-assistant-log .assistant-log-output {
    margin: 0;
}

/* Markdown content inside comments */
.comment-content.markdown-body {
    white-space: normal;
}

.comment-content.markdown-body p {
    margin: 0.25em 0;
}

.comment-content.markdown-body pre {
    background: var(--bg);
    border-radius: 6px;
    padding: 0.75em 1em;
    overflow-x: auto;
    margin: 0.5em 0;
}

.comment-content.markdown-body code {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.85em;
}

.comment-content.markdown-body :not(pre) > code {
    background: var(--bg);
    padding: 0.15em 0.35em;
    border-radius: 3px;
}

.comment-content.markdown-body ul,
.comment-content.markdown-body ol {
    padding-left: 1.5em;
    margin: 0.25em 0;
}

.comment-content.markdown-body blockquote {
    border-left: 3px solid var(--border);
    margin: 0.5em 0;
    padding-left: 0.75em;
    color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   18. Projects Page
   -------------------------------------------------------------------------- */

.projects-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem;
}

.projects-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.projects-header h2 {
    font-size: 1.5rem;
    font-weight: 400;
    letter-spacing: -0.03em;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.project-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.35rem;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.3s cubic-bezier(0.22, 1, 0.36, 1),
                border-color 0.3s ease;
    cursor: pointer;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.09);
    border-color: var(--text-muted);
    text-decoration: none;
}

.project-card:active {
    transform: translateY(0);
    transition-duration: 0.1s;
}

.project-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.project-card-header h3 {
    font-size: 1.125rem;
    font-weight: 900;
    letter-spacing: -0.02em;
}

.project-card-title {
    flex: 1;
}

.project-card-edit {
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.25s ease;
}

.project-card-edit:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-subtle);
}

.project-card-desc {
    font-size: 0.9375rem;
    color: var(--text-muted);
    line-height: 1.55;
    margin-bottom: 0.85rem;
}

.project-card-footer {
    display: flex;
    gap: 1rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-weight: 600;
}

.project-stat.done {
    color: var(--text);
}

/* --------------------------------------------------------------------------
   19. Assistant Logs
   -------------------------------------------------------------------------- */

.assistant-log-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.375rem;
}

.assistant-log-type {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.assistant-log-time {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.assistant-logs-list {
    max-height: 300px;
    overflow-y: auto;
}

.assistant-log {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.625rem;
    margin-bottom: 0.5rem;
}

.assistant-log-output {
    font-size: 0.75rem;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 150px;
    overflow-y: auto;
    background: var(--bg);
    padding: 0.5rem;
    border-radius: 4px;
    border: 1px solid var(--border);
}

/* --------------------------------------------------------------------------
   20. Accordion
   -------------------------------------------------------------------------- */

.accordion {
    margin-top: 1rem;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.accordion-header {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 0.85rem;
    background: var(--bg-secondary);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text);
    text-align: left;
    font-family: inherit;
    transition: background-color 0.25s ease;
}

.accordion-header:hover {
    background: var(--accent-subtle);
}

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

.accordion-chevron {
    margin-left: auto;
    font-size: 0.625rem;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.accordion.open .accordion-chevron {
    transform: rotate(90deg);
}

.accordion-content {
    padding: 0.75rem;
    border-top: 1px solid var(--border);
}

/* --------------------------------------------------------------------------
   21. Pagination
   -------------------------------------------------------------------------- */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
}

.pagination-btn {
    padding: 0.4rem 0.85rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    cursor: pointer;
    font-family: inherit;
    transition: background-color 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
}

.pagination-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.pagination-btn:hover:not(:disabled) {
    background: var(--accent-subtle);
    border-color: var(--accent);
}

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

.pagination-info {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* --------------------------------------------------------------------------
   22. Toast Notifications
   -------------------------------------------------------------------------- */

.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.toast {
    padding: 0.7rem 1.125rem;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #ffffff;
    background: #333333;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: auto;
    max-width: 380px;
    animation: slideInRight 0.35s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.toast-visible {
    opacity: 1;
    transform: translateX(0);
}

.toast-success { background: var(--text); }
.toast-error   { background: var(--rose); }
.toast-info    { background: var(--text); }

.toast.toast-exit {
    animation: fadeOut 0.3s ease forwards;
}

/* --------------------------------------------------------------------------
   23. Animations / Keyframes
   -------------------------------------------------------------------------- */

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

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

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(24px); }
    to   { opacity: 1; transform: translateX(0); }
}

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

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

/* --- Entrance: columns cascade in from bottom --- */
@keyframes columnIn {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

.animate-entrance .column {
    animation: columnIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}
.animate-entrance .column:nth-child(1) { animation-delay: 0.04s; }
.animate-entrance .column:nth-child(2) { animation-delay: 0.1s; }
.animate-entrance .column:nth-child(3) { animation-delay: 0.16s; }
.animate-entrance .column:nth-child(4) { animation-delay: 0.22s; }

/* --- Entrance: cards cascade in --- */
@keyframes cardIn {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.animate-entrance .card {
    animation: cardIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}
.animate-entrance .cards .card:nth-child(1) { animation-delay: 0.08s; }
.animate-entrance .cards .card:nth-child(2) { animation-delay: 0.14s; }
.animate-entrance .cards .card:nth-child(3) { animation-delay: 0.20s; }
.animate-entrance .cards .card:nth-child(4) { animation-delay: 0.26s; }
.animate-entrance .cards .card:nth-child(5) { animation-delay: 0.32s; }
.animate-entrance .cards .card:nth-child(n+6) { animation-delay: 0.36s; }

/* --- Entrance: project cards cascade --- */
.animate-entrance .project-card {
    animation: cardIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}
.animate-entrance .projects-grid .project-card:nth-child(1) { animation-delay: 0.05s; }
.animate-entrance .projects-grid .project-card:nth-child(2) { animation-delay: 0.1s; }
.animate-entrance .projects-grid .project-card:nth-child(3) { animation-delay: 0.15s; }
.animate-entrance .projects-grid .project-card:nth-child(4) { animation-delay: 0.2s; }
.animate-entrance .projects-grid .project-card:nth-child(5) { animation-delay: 0.25s; }
.animate-entrance .projects-grid .project-card:nth-child(n+6) { animation-delay: 0.28s; }



/* --- Entrance: FAB pops in --- */
@keyframes fabIn {
    from { opacity: 0; transform: scale(0.5) rotate(-45deg); }
    to   { opacity: 1; transform: scale(1) rotate(0deg); }
}
.animate-entrance .fab {
    animation: fabIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.3s backwards;
}

/* --- Entrance: detail page content --- */
@keyframes detailIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
.animate-entrance .detail-page {
    animation: detailIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) 0.05s backwards;
}



/* --- Entrance: task items stagger in --- */
.animate-entrance .task-item {
    animation: cardIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}
.animate-entrance .tasks-list .task-item:nth-child(1) { animation-delay: 0.05s; }
.animate-entrance .tasks-list .task-item:nth-child(2) { animation-delay: 0.1s; }
.animate-entrance .tasks-list .task-item:nth-child(3) { animation-delay: 0.15s; }
.animate-entrance .tasks-list .task-item:nth-child(4) { animation-delay: 0.2s; }
.animate-entrance .tasks-list .task-item:nth-child(n+5) { animation-delay: 0.25s; }

/* --- Entrance: comments stagger in --- */
.animate-entrance .comment {
    animation: cardIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}
.animate-entrance .comments-list .comment:nth-child(1) { animation-delay: 0.05s; }
.animate-entrance .comments-list .comment:nth-child(2) { animation-delay: 0.1s; }
.animate-entrance .comments-list .comment:nth-child(3) { animation-delay: 0.15s; }
.animate-entrance .comments-list .comment:nth-child(n+4) { animation-delay: 0.18s; }

/* --- Modal exit animation --- */
.modal.modal-closing {
    animation: fadeOut-modal 0.25s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.modal.modal-closing .modal-content {
    animation: slideDown 0.25s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes fadeOut-modal {
    from { opacity: 1; }
    to   { opacity: 0; }
}
@keyframes slideDown {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to   { opacity: 0; transform: translateY(12px) scale(0.97); }
}



/* --- Page exit transitions (content only, header stays) --- */
@keyframes contentOpen {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(-20px); }
}

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

body.page-exit-open,
body.page-exit-close {
    pointer-events: none;
}

body.page-exit-open header,
body.page-exit-close header {
    /* Header stays rock-solid */
}

body.page-exit-open > *:not(header):not(.toast-container) {
    animation: contentOpen 0.18s cubic-bezier(0.32, 0, 0.67, 0) forwards;
}

body.page-exit-close > *:not(header):not(.toast-container) {
    animation: contentClose 0.18s cubic-bezier(0.32, 0, 0.67, 0) forwards;
}

/* --- Respect reduced motion preference --- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-delay: 0s !important;
        transition-duration: 0.01ms !important;
    }
}

/* --------------------------------------------------------------------------
   24. Thinking Spinner
   -------------------------------------------------------------------------- */

.thinking-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   25. Custom Scrollbars (Webkit)
   -------------------------------------------------------------------------- */

.cards::-webkit-scrollbar,
.comments-list::-webkit-scrollbar,
.assistant-logs-list::-webkit-scrollbar {
    width: 6px;
}

.cards::-webkit-scrollbar-track,
.comments-list::-webkit-scrollbar-track,
.assistant-logs-list::-webkit-scrollbar-track {
    background: transparent;
}

.cards::-webkit-scrollbar-thumb,
.comments-list::-webkit-scrollbar-thumb,
.assistant-logs-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.cards::-webkit-scrollbar-thumb:hover,
.comments-list::-webkit-scrollbar-thumb:hover,
.assistant-logs-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* --------------------------------------------------------------------------
   26. Responsive Breakpoints
   -------------------------------------------------------------------------- */

/* Tablet: 2-column board */
@media (max-width: 1100px) {
    .board {
        grid-template-columns: repeat(2, 1fr);
    }

    .column {
        max-height: none;
    }
}

/* Mobile: single-column, stacked header */
@media (max-width: 768px) {
    .board {
        grid-template-columns: 1fr;
        padding: 0.75rem;
        gap: 0.75rem;
    }

    .column {
        max-height: none;
    }

    header {
        padding: 0.75rem 1rem;
    }

    .header-inner {
        flex-direction: column;
        gap: 0.25rem;
    }

    .header-nav {
        margin-left: 0;
    }

    .project-breadcrumb {
        margin-left: 0;
    }

    .board-summary {
        padding: 0.5rem 1rem;
        gap: 1rem;
        flex-wrap: wrap;
    }

    .kb-search-bar {
        padding: 0.5rem 1rem;
    }

    .detail-page {
        padding: 1rem;
    }

    .detail-header h1 {
        font-size: 1.5rem;
    }

    .detail-actions {
        flex-direction: column;
    }

    .detail-actions button {
        width: 100%;
    }

    .projects-page {
        padding: 1rem;
    }

    .fab {
        bottom: 1rem;
        right: 1rem;
        width: 48px;
        height: 48px;
        font-size: 1.5rem;
    }
}

/* --------------------------------------------------------------------------
   27. SVG Mascot Integrations
   -------------------------------------------------------------------------- */

/* --- Empty state illustrations --- */
.empty-icon {
    width: 48px;
    height: 48px;
    opacity: 0.3;
    filter: grayscale(0.5);
    transition: opacity 0.4s ease, filter 0.4s ease, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.empty-state:hover .empty-icon {
    opacity: 0.6;
    filter: grayscale(0);
    transform: scale(1.1);
}

.empty-icon-weevil {
    animation: weevil-idle 3s ease-in-out infinite;
}

.empty-icon-run {
    animation: run-idle 1.5s ease-in-out infinite;
}

.empty-icon-sleep {
    width: 72px;
    height: auto;
    filter: grayscale(0.3);
    opacity: 0.3;
    animation: sleep-bob 4s ease-in-out infinite;
}

.empty-state:hover .empty-icon-sleep {
    filter: grayscale(0);
    opacity: 0.55;
}

@keyframes sleep-bob {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(0.97); }
}

@keyframes weevil-idle {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-3px) rotate(-3deg); }
}

@keyframes run-idle {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(4px); }
}

/* --- Large empty state (projects page) --- */
.empty-state-large {
    padding: 3rem 1.5rem;
    grid-column: 1 / -1;
}

.empty-icon-hero {
    width: 120px;
    height: auto;
    opacity: 0.18;
    filter: grayscale(0.4);
    transition: opacity 0.5s ease, filter 0.5s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
    animation: hero-run 3s ease-in-out infinite;
}

.empty-state-large:hover .empty-icon-hero {
    opacity: 0.5;
    filter: grayscale(0);
}

@keyframes hero-run {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(12px); }
}

/* --- Inline empty icon (comments) --- */
.empty-icon-inline {
    width: 20px;
    height: 20px;
    opacity: 0.35;
    vertical-align: middle;
    margin-right: 0.25rem;
}


/* --- Thinking boar (replaces spinner) --- */
.thinking-boar {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    animation: thinking-gallop 0.6s ease-in-out infinite;
}

@keyframes thinking-gallop {
    0%, 100% { transform: translateX(0) scaleY(1); }
    25% { transform: translateX(2px) scaleY(0.95); }
    50% { transform: translateX(4px) scaleY(1); }
    75% { transform: translateX(2px) scaleY(1.02); }
}

/* --- FAB with weevil --- */
.fab {
    overflow: hidden;
}

.fab-icon {
    width: 28px;
    height: 28px;
    filter: brightness(0) invert(1);
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
}

.fab-plus {
    position: absolute;
    opacity: 0;
    transform: scale(0.5) rotate(-90deg);
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
    font-size: 1.85rem;
    line-height: 1;
}

.fab:hover .fab-icon {
    transform: scale(0) rotate(90deg);
    opacity: 0;
}

.fab:hover .fab-plus {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

/* --- Project card subtle mascot watermark --- */
.project-card {
    position: relative;
    overflow: hidden;
}

.project-card::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: -8px;
    width: 64px;
    height: 64px;
    background: url('/static/boar-head.svg') no-repeat center / contain;
    opacity: 0.035;
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
}

.project-card:hover::after {
    opacity: 0.08;
    transform: scale(1.1) rotate(-5deg);
}

/* --- Done column sleeping boar --- */
.column-done .column-header h2::after {
    content: '';
    display: inline-block;
    width: 24px;
    height: 16px;
    background: url('/static/boar-sleep.svg') no-repeat center / contain;
    margin-left: 0.5rem;
    vertical-align: middle;
    opacity: 0.5;
}
