@import url('tokens.css');
/* The palette lives in tokens.css so token-only consumers can link it
   alone. Everything below is this stylesheet's own element styling. */

body {
    background-color: var(--color-bg); /* Deep Charcoal */
    background-image:
        radial-gradient(circle at 12% 18%, rgba(var(--color-accent-gold-rgb), 0.16) 0%, rgba(var(--color-accent-gold-rgb), 0.05) 22%, transparent 44%),
        radial-gradient(circle at 88% 82%, rgba(var(--color-accent-red-rgb), 0.24) 0%, rgba(var(--color-accent-red-rgb), 0.06) 24%, transparent 44%),
        linear-gradient(135deg, var(--color-bg-alt-1) 0%, var(--color-bg-alt-2) 50%, var(--color-bg) 100%);
    background-attachment: fixed;
    color: var(--color-text-primary);            /* Clean White */
    font-family: 'Montserrat', sans-serif; /* Global font */
    margin: 0;
    padding: 0;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(ellipse at 20% 20%, rgba(var(--color-accent-gold-rgb), 0.10) 0, transparent 32%),
        radial-gradient(ellipse at 80% 60%, rgba(var(--color-accent-gold-rgb), 0.08) 0, transparent 28%),
        radial-gradient(ellipse at 50% 100%, rgba(var(--color-accent-red-rgb), 0.14) 0, transparent 36%);
    mix-blend-mode: screen;
    opacity: 0.9;
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(var(--bg-grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--bg-grid-line) 1px, transparent 1px);
    background-size: 32px 32px;
    /* Tokenised so light mode can redraw the grid warm; white lines are
       invisible on parchment. Dark resolves to the same rgba(255,255,255,0.025)
       at 0.18 it has always used. */
    opacity: var(--bg-grid-opacity);
    mask-image: linear-gradient(to bottom, rgba(0,0,0,0.65), transparent 90%);
}

/* Add this to frontend/static/css/styles.css */
header {
    height: 70px; /* Lock the header height */
    box-sizing: border-box;
}

/* Technical inputs keep the monospace look */
input, textarea, pre, code {
    font-family: 'JetBrains Mono', monospace;
}

/* Consistent Headers. h1 gets the distinct Space Grotesk display face (real
   personality, contrasted against the Montserrat body text) per
   .claude/design-system.md; h2/h3 stay in Montserrat but at true weight 700
   now that it's actually loaded, still a clear step up from body's 400. */
h1, h2, h3 {
    color: var(--color-text-primary);
}

h1 {
    font-family: 'Space Grotesk', 'Montserrat', sans-serif;
    font-weight: 700;
}

h2, h3 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
}

#processBtn {
    min-width: 220px;
    min-height: 45px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

@keyframes apex-pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(0.98); opacity: 0.6; }
    100% { transform: scale(1); opacity: 1; }
}

.processing-active {
    animation: apex-pulse 1.5s infinite ease-in-out !important;
    background-color: var(--color-accent-red-active) !important; /* Deep red active state */
    cursor: not-allowed;
}
/* Base styles for desktop */
.dashboard-container {
    display: flex;
    flex-direction: row;
    gap: 20px;
}

/* Premium APEX Mentor Sidebar with Geometric Overlay */
.mentor-sidebar {
    position: fixed;
    top: 0;
    right: -450px; /* Hidden off-screen by default */
    width: 400px;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;

    background-color: var(--color-bg);
    background-image:
        radial-gradient(circle at top left, rgba(var(--color-accent-gold-rgb), 0.16) 0%, transparent 28%),
        radial-gradient(circle at bottom right, rgba(var(--color-accent-red-rgb), 0.22) 0%, transparent 34%),
        linear-gradient(135deg, rgba(var(--color-bg-rgb), 0.97) 0%, rgba(var(--color-bg-alt-2-rgb), 0.97) 100%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cg fill='none' stroke='%23E6D6B8' stroke-opacity='0.16' stroke-width='1'%3E%3Cpath d='M0 110h220'/%3E%3Cpath d='M110 0v220'/%3E%3Cpath d='M30 30l160 160'/%3E%3Cpath d='M190 30L30 190'/%3E%3Ccircle cx='110' cy='110' r='42'/%3E%3Ccircle cx='110' cy='110' r='72'/%3E%3C/g%3E%3C/svg%3E");
    background-size: cover, cover, cover, 220px 220px;

    border-left: 2px solid var(--color-accent-gold);
    box-shadow: -5px 0 35px rgba(var(--color-accent-gold-rgb), 0.15);
    transition: right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    color: var(--color-text-primary);
    font-family: 'Montserrat', sans-serif;
}

.mentor-sidebar.visible { right: 0; }

/* Subtle top gloss overlay */
.mentor-sidebar::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 170px;
    background: linear-gradient(180deg, rgba(var(--color-accent-gold-rgb), 0.10) 0%, transparent 100%);
    pointer-events: none;
}

.mentor-sidebar::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at 20% 20%, rgba(var(--color-white-rgb), 0.04) 0, transparent 32%);
    opacity: 0.8;
}

.mentor-header {
    padding: 20px;
    border-bottom: 1px solid rgba(var(--color-accent-gold-rgb), 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-sidebar-btn {
    background: transparent;
    color: var(--color-accent-gold);
    border: none;
    font-size: 28px;
    cursor: pointer;
    transition: transform 0.2s;
}
.close-sidebar-btn:hover { transform: scale(1.1); }

.chat-history {
    flex: 1 1 auto;
    min-height: 0;
    padding: 20px;
    overflow-y: auto;
}

.mentor-input {
    padding: 20px;
    border-top: 1px solid rgba(var(--color-accent-gold-rgb), 0.3);
    background: var(--color-bg);
    flex-shrink: 0;
    overflow-y: auto;
    max-height: 45vh;
}

.action-item-cb {
    margin-right: 12px;
    accent-color: var(--color-accent-gold);
    transform: scale(1.2);
    cursor: pointer;
}

.status-dot {
    height: 8px;
    width: 8px;
    background-color: var(--color-accent-red);
    border-radius: 50%;
    display: inline-block;
}

.accent-btn {
    background: var(--color-accent-red); /* Deep Red */
    color: var(--color-text-primary);
    border: none;
    padding: 0.5rem 1rem;
    width: 100%;
    cursor: pointer;
    font-weight: bold;
}
/* Mobile Optimization: Triggered for phones */
@media (max-width: 768px) {
    .dashboard-container {
        flex-direction: column; /* Stack items vertically */
        padding: 10px;
    }

    /* Ensure inputs don't overflow the screen */
    input, textarea, button {
        width: 100%;
        box-sizing: border-box; /* Ensures padding doesn't push elements off-screen */
    }

    /* Make buttons tap-friendly */
    button {
        padding: 15px;
        font-size: 16px; /* Prevents iOS from auto-zooming on focus */
    }
}

/* Champagne Gold Accents for APEX Branding */
.card {
    border: 1px solid var(--color-accent-red);
    transition: 0.3s;
}

/* Add a gold glow on hover for active elements */
.card:hover {
    border-color: var(--color-accent-gold);
    box-shadow: 0 0 15px rgba(var(--color-accent-gold-rgb), 0.1);
}

/* Gold graphic accent for headings */
h2::after {
    content: "";
    display: block;
    width: 50px;
    height: 2px;
    background: var(--color-accent-gold);
    margin: 10px auto;
}

/* Modal specific gold styling */
#qcAssistantModal .modal-content {
    border-left: 4px solid var(--color-accent-gold) !important;
}

/* --- 1. Bulletproof Floating Button --- */
#floating-mentor-btn {
    position: fixed;
    z-index: 99999;
    transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
}

.floating-btn-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
}

.floating-btn-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

#floating-mentor-btn button {
    background-color: var(--color-bg);
    border: 1px solid var(--color-accent-red);
    color: var(--color-text-invert-soft);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: 'Montserrat', sans-serif;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(var(--color-black-rgb), 0.4);
    display: flex;
    align-items: center;
    gap: 6px;
}

#floating-mentor-btn button:hover {
    background-color: var(--color-bg-hover-slate);
    border-color: var(--color-accent-gold-bright);
    color: var(--color-accent-gold-bright);
}

/* --- 2. HTML-Structured Audit Tooltip --- */
.apex-edit-history {
    position: relative;
    border-bottom: 2px dashed var(--color-accent-gold-bright);
    cursor: pointer;
    background-color: rgba(var(--color-accent-gold-bright-rgb), 0.1);
    border-radius: 2px;
}

.apex-edit-history .audit-tooltip {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--color-bg);
    border: 1px solid var(--color-accent-red);
    color: var(--color-text-invert-soft);
    padding: 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: 'Montserrat', sans-serif;
    width: max-content;
    max-width: 350px;
    box-shadow: 0 8px 16px rgba(var(--color-black-rgb), 0.6);
    z-index: 10000;
    pointer-events: none;
    transition: opacity 0.2s ease-in-out;
    text-align: left;
}

.apex-edit-history:hover .audit-tooltip {
    visibility: visible;
    opacity: 1;
}

.audit-tooltip del {
    color: var(--color-danger);
}

.clean-edit-approved {
    color: var(--color-success);
    transition: color 0.5s ease-in;
}

.sparkle-icon {
    color: var(--color-accent-gold-bright);
}

/* Workspace dashboard styles extracted from frontend/templates/index.html */
            /* Global Box Sizing */
            *, *::before, *::after { box-sizing: border-box; }

            /* Base Styles */
            body { background-color: var(--color-bg); color: var(--color-text-primary); font-family: 'Montserrat', sans-serif; display: flex; flex-direction: column; align-items: center; width: 100%; padding: 50px; }
            .hub-container { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; max-width: 800px; width: 100%; }
            .card { background: rgba(var(--color-white-rgb), 0.05); padding: 30px; border-radius: 15px; border: 1px solid var(--color-accent-red); cursor: pointer; transition: 0.3s; }
            .card:hover { background: rgba(var(--color-accent-red-rgb), 0.2); }
            h1 { color: var(--color-accent-red); text-align: center; }
            .todo-panel-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
            .todo-panel-header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
            .todo-panel-toggle { width: auto; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--color-accent-gold); background: transparent; color: var(--color-accent-gold); cursor: pointer; }
            .todo-panel-content.collapsed { display: none; }
            .todo-panel-summary { margin-top: 8px; color: var(--color-accent-gold); font-size: 0.9rem; }
            .todo-panel-summary.hidden { display: none; }
            .project-context-panel { width: min(900px, 100%); margin-top: 18px; background: rgba(var(--color-white-rgb), 0.05); border: 1px solid rgba(var(--color-accent-gold-rgb), 0.25); border-radius: 16px; padding: 18px 20px; }
            .project-context-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
            .project-context-row label { color: var(--color-accent-gold); font-weight: 600; }
            .project-context-select { flex: 1; min-width: 260px; padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(var(--color-accent-gold-rgb), 0.24); background: var(--color-bg); color: var(--color-text-primary); font-family: 'Montserrat', sans-serif; }
            .project-context-action { width: auto; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--color-accent-gold); background: transparent; color: var(--color-accent-gold); cursor: pointer; }
            .project-context-note { margin-top: 10px; color: var(--color-text-muted); font-size: 0.88rem; line-height: 1.45; }

            /* To-Do Panel Styles */
            .todo-panel { width: min(900px, 100%); margin-top: 24px; background: rgba(var(--color-white-rgb), 0.05); border: 1px solid rgba(var(--color-accent-gold-rgb), 0.25); border-radius: 16px; padding: 20px; }
            .todo-list { display: flex; flex-direction: column; gap: 10px; }

            /* DESKTOP: Grid Layout */
            .todo-item { display: grid; grid-template-columns: 1.3fr 0.8fr 0.9fr 0.7fr 0.8fr 0.7fr; gap: 10px; align-items: center; background: rgba(var(--color-black-rgb), 0.2); padding: 12px 14px; border-radius: 10px; border: 1px solid rgba(var(--color-accent-gold-rgb), 0.12); }
            .todo-item.in-progress-active { border-left: 4px solid var(--color-accent-gold); background: rgba(var(--color-accent-gold-rgb), 0.1); }
            .todo-item .label { color: var(--color-accent-gold); font-size: 0.9rem; }
            .todo-item .value { color: var(--color-text-primary); font-size: 0.9rem; }
            .muted { color: var(--color-text-muted-soft); font-size: 0.85rem; }
            .todo-task-display { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
            .todo-in-progress-btn { width: auto; min-width: 0; padding: 5px 8px; border-radius: 6px; border: 1px solid var(--color-accent-gold); background: transparent; color: var(--color-accent-gold); font-size: 0.78rem; cursor: pointer; }
            .todo-in-progress-btn:hover { background: var(--color-accent-gold); color: var(--color-bg-deep); }
            .todo-in-progress-btn:disabled { opacity: 0.45; cursor: not-allowed; }
            .todo-task-editor { display: none; width: 100%; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
            .todo-reassign-panel { display: none; width: 100%; gap: 8px; margin-top: 8px; }
            .todo-reassign-field { position: relative; flex: 1; min-width: 0; }
            .todo-edit-input,
            .todo-reassign-input { width: 100%; padding: 8px 10px; border-radius: 6px; border: 1px solid rgba(var(--color-accent-gold-rgb), 0.25); background: var(--color-bg); color: var(--color-text-primary); font-family: 'Montserrat', sans-serif; box-sizing: border-box; }
            .todo-edit-input { min-height: 92px; resize: vertical; line-height: 1.45; }
            .todo-reassign-dropdown { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20; display: none; max-height: 180px; overflow-y: auto; border: 1px solid rgba(var(--color-accent-gold-rgb), 0.22); border-radius: 8px; background: var(--color-bg-alt-1); box-shadow: 0 12px 24px rgba(var(--color-black-rgb), 0.28); }
            .todo-reassign-dropdown.visible { display: block; }
            .todo-reassign-option { width: 100%; padding: 9px 10px; border: none; border-bottom: 1px solid rgba(var(--color-accent-gold-rgb), 0.08); background: transparent; color: var(--color-text-primary); text-align: left; cursor: pointer; }
            .todo-reassign-option:hover,
            .todo-reassign-option:focus { background: rgba(var(--color-accent-gold-rgb), 0.08); outline: none; }
            .todo-reassign-option small { display: block; color: var(--color-text-muted-soft); margin-top: 2px; }
            .todo-assignee-badge { display: inline-flex; align-items: center; margin-left: 6px; padding: 2px 6px; border-radius: 999px; background: rgba(var(--color-accent-gold-rgb), 0.12); color: var(--color-accent-gold); font-size: 0.72rem; letter-spacing: 0.02em; }
            /* docs/specs/task-milestone-targeting.md §6.6 -- rendered inside the Due
               cell, under the date input, not as a new grid column. --color-accent-gold(-rgb)
               is already theme-aware (tokens.css), so no separate [data-theme="light"]
               override is needed, same as .todo-assignee-badge above. */
            .todo-milestone-badge { display: inline-block; margin-top: 4px; padding: 2px 8px; border-radius: 999px; background: rgba(var(--color-accent-gold-rgb), 0.12); border: 1px solid rgba(var(--color-accent-gold-rgb), 0.35); color: var(--color-accent-gold); font-size: 0.68rem; letter-spacing: 0.02em; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
            .todo-item .value .todo-milestone-badge { display: block; width: fit-content; max-width: 100%; }
            .todo-bucket-title { margin: 14px 0 8px; color: var(--color-accent-gold); font-size: 0.95rem; font-weight: 600; letter-spacing: 0.02em; }
            .todo-reassign-status { color: var(--color-text-muted-soft); font-size: 0.82rem; padding: 8px 10px; }
            .todo-item.editing .todo-task-display { display: none; }
            .todo-item.editing .todo-task-editor { display: flex; }
            .todo-item.editing .todo-reassign-panel { display: flex; }
            .todo-task-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
            .todo-task-actions button { width: auto; min-width: 0; padding: 7px 10px; border-radius: 6px; border: 1px solid var(--color-accent-gold); background: transparent; color: var(--color-accent-gold); cursor: pointer; }
            .todo-task-actions .todo-source-btn { border-color: rgba(var(--color-accent-gold-rgb), 0.75); color: var(--color-accent-gold); }
            .todo-task-actions .todo-source-btn:hover,
            .todo-task-actions .todo-source-btn:focus-visible { background: rgba(var(--color-accent-gold-rgb), 0.14); color: var(--color-text-warm-3); outline: none; }
            .todo-task-actions .todo-edit-save { background: var(--color-accent-red); border-color: var(--color-accent-red); color: var(--color-text-primary); }
            .todo-task-actions .todo-edit-cancel { border-color: rgba(var(--color-accent-gold-rgb), 0.35); color: var(--color-text-warm-4); }

            /* Mentor + Popout UI */
            .dashboard-mentor-toggle { margin-bottom: 12px; background: linear-gradient(145deg, rgba(var(--color-accent-gold-rgb), 0.16), rgba(var(--color-accent-gold-rgb), 0.03)); border: 1px solid var(--color-accent-gold); color: var(--color-accent-gold); padding: 8px 12px; border-radius: 10px; width: auto; cursor: pointer; box-shadow: 0 0 0 1px rgba(var(--color-accent-gold-rgb), 0.12), 0 10px 18px rgba(var(--color-black-rgb), 0.2); transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease; }
            .dashboard-mentor-toggle:hover, .dashboard-mentor-toggle:focus-visible { transform: translateY(-1px); border-color: rgba(var(--color-accent-gold-rgb), 0.85); box-shadow: 0 0 0 1px rgba(var(--color-accent-gold-rgb), 0.24), 0 0 18px rgba(var(--color-accent-gold-rgb), 0.24); outline: none; }
            .dashboard-mentor-overlay { position: fixed; inset: 0; background: rgba(var(--color-black-rgb), 0.65); opacity: 0; pointer-events: none; transition: opacity 0.25s ease; z-index: 1900; }
            .dashboard-mentor-overlay.visible { opacity: 1; pointer-events: auto; }
            .dashboard-mentor-sidebar { position: fixed; top: 0; right: 0; width: min(420px, 100%); height: 100%; background: radial-gradient(circle at 14% 12%, rgba(var(--color-accent-gold-rgb), 0.16) 0%, transparent 34%), radial-gradient(circle at 86% 88%, rgba(var(--color-accent-red-rgb), 0.24) 0%, transparent 38%), linear-gradient(150deg, rgba(var(--color-bg-rgb), 0.98) 0%, rgba(var(--color-bg-alt-2-rgb), 0.98) 100%), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cg fill='none' stroke='%23E6D6B8' stroke-opacity='0.16' stroke-width='1'%3E%3Cpath d='M0 110h220'/%3E%3Cpath d='M110 0v220'/%3E%3Cpath d='M30 30l160 160'/%3E%3Cpath d='M190 30L30 190'/%3E%3Ccircle cx='110' cy='110' r='40'/%3E%3Ccircle cx='110' cy='110' r='72'/%3E%3C/g%3E%3C/svg%3E"); background-size: cover, cover, cover, 220px 220px; border-left: 2px solid rgba(var(--color-accent-gold-rgb), 0.72); box-shadow: -16px 0 34px rgba(var(--color-black-rgb), 0.42); transform: translateX(calc(100% + 20px)); transition: transform 0.28s ease; z-index: 2000; display: flex; flex-direction: column; padding: 0; box-sizing: border-box; overflow: hidden; }
            .dashboard-mentor-sidebar.visible { transform: translateX(0); }
            .dashboard-mentor-sidebar::before,
            .dashboard-mentor-sidebar::after { content: ''; position: absolute; inset: 0; pointer-events: none; }
            .dashboard-mentor-sidebar::before { background: linear-gradient(180deg, rgba(var(--color-accent-gold-rgb), 0.2) 0%, rgba(var(--color-accent-gold-rgb), 0.06) 20%, transparent 36%); }
            .dashboard-mentor-sidebar::after { background-image: linear-gradient(rgba(var(--color-white-rgb), 0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(var(--color-white-rgb), 0.03) 1px, transparent 1px), repeating-linear-gradient(138deg, transparent 0 20px, rgba(var(--color-accent-gold-rgb), 0.2) 20px 22px, transparent 22px 44px), repeating-linear-gradient(38deg, transparent 0 24px, rgba(var(--color-accent-red-rgb), 0.21) 24px 26px, transparent 26px 50px), radial-gradient(circle at 16% 24%, rgba(var(--color-accent-gold-rgb), 0.6) 0 2px, transparent 2.8px), radial-gradient(circle at 76% 16%, rgba(var(--color-accent-gold-rgb), 0.52) 0 1.9px, transparent 2.7px), radial-gradient(circle at 36% 72%, rgba(var(--color-accent-gold-rgb), 0.48) 0 1.8px, transparent 2.6px), radial-gradient(circle at 88% 66%, rgba(var(--color-accent-gold-rgb), 0.46) 0 1.75px, transparent 2.5px); background-size: 30px 30px, 30px 30px, 240px 240px, 280px 280px, 220px 220px, 190px 190px, 220px 220px, 210px 210px; background-position: 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0; opacity: 0.58; mask-image: linear-gradient(to bottom, rgba(0,0,0,0.74), transparent 86%); animation: mentorBackgroundFlow 9.5s linear infinite; }
            .dashboard-mentor-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0; padding: 14px 14px 12px; border-bottom: 1px solid rgba(var(--color-accent-gold-rgb), 0.22); background: linear-gradient(90deg, rgba(var(--color-accent-gold-rgb), 0.06), rgba(var(--color-accent-gold-rgb), 0)); color: var(--color-accent-gold); position: relative; z-index: 1; }
            .dashboard-mentor-header button { width: auto; padding: 6px 10px; border: 1px solid var(--color-accent-gold); background: linear-gradient(145deg, rgba(var(--color-accent-gold-rgb), 0.16), rgba(var(--color-accent-gold-rgb), 0.04)); color: var(--color-accent-gold); border-radius: 10px; cursor: pointer; position: relative; overflow: hidden; box-shadow: 0 0 0 1px rgba(var(--color-accent-gold-rgb), 0.12), 0 10px 18px rgba(var(--color-black-rgb), 0.2); transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease; }
            .mentor-chat { display: flex; flex-direction: column; gap: 10px; min-height: 160px; max-height: 320px; overflow-y: auto; padding: 14px; padding-right: 10px; background: linear-gradient(180deg, rgba(var(--color-white-rgb), 0.02), rgba(var(--color-black-rgb), 0)); position: relative; z-index: 1; }
            .mentor-bubble { padding: 10px 12px; border-radius: 10px; line-height: 1.45; font-size: 0.95rem; max-width: 92%; }
            .mentor-bubble.user { align-self: flex-end; background: rgba(var(--color-accent-red-rgb), 0.12); color: var(--color-text-primary); border: 1px solid rgba(var(--color-accent-red-rgb), 0.25); box-shadow: none; }
            .mentor-bubble.mentor { align-self: flex-start; background: rgba(var(--color-accent-gold-rgb), 0.08); color: var(--color-text-warm-1); border: 1px solid rgba(var(--color-accent-gold-rgb), 0.16); box-shadow: none; }
            .mentor-input { margin-top: auto; display: flex; gap: 8px; padding: 12px 14px 14px; border-top: 1px solid rgba(var(--color-accent-gold-rgb), 0.2); background: rgba(var(--color-bg-overlay-rgb), 0.86); position: relative; z-index: 1; }
            .mentor-input textarea { flex: 1; min-height: 44px; max-height: 90px; resize: vertical; padding: 8px 10px; border-radius: 8px; border: 1px solid rgba(var(--color-accent-gold-rgb), 0.25); background: var(--color-bg); color: var(--color-text-primary); }
            .mentor-input button { width: auto; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--color-accent-gold); background: linear-gradient(145deg, rgba(var(--color-accent-gold-rgb), 0.16), rgba(var(--color-accent-gold-rgb), 0.04)); color: var(--color-accent-gold); cursor: pointer; box-shadow: 0 0 0 1px rgba(var(--color-accent-gold-rgb), 0.12), 0 10px 18px rgba(var(--color-black-rgb), 0.2); transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease; }
            .dashboard-mentor-header button:hover,
            .dashboard-mentor-header button:focus-visible,
            .mentor-input button:hover,
            .mentor-input button:focus-visible { transform: translateY(-1px); border-color: rgba(var(--color-accent-gold-rgb), 0.85); box-shadow: 0 0 0 1px rgba(var(--color-accent-gold-rgb), 0.24), 0 0 18px rgba(var(--color-accent-gold-rgb), 0.24); outline: none; }

            .mentor-source-panel { margin-top: 8px; padding: 10px; border-radius: 10px; border: 1px solid rgba(var(--color-accent-gold-rgb), 0.22); background: rgba(var(--color-accent-gold-rgb), 0.06); }
            .mentor-source-title { font-weight: 600; color: var(--color-accent-gold); margin-bottom: 8px; }
            .mentor-source-entry { margin-top: 8px; padding: 9px; border-radius: 8px; background: rgba(var(--color-black-rgb), 0.2); border: 1px solid rgba(var(--color-accent-gold-rgb), 0.12); }
            .mentor-source-entry summary { cursor: pointer; color: var(--color-text-warm-2); font-size: 0.89rem; }
            .mentor-source-entry p { margin: 6px 0 0; color: var(--color-text-warm-5); font-size: 0.86rem; line-height: 1.4; }
            .mentor-risk-panel { margin-top: 8px; padding: 10px; border-radius: 10px; border: 1px solid rgba(var(--color-danger-rgb), 0.45); background: linear-gradient(145deg, rgba(var(--color-accent-red-rgb), 0.24), rgba(var(--color-accent-red-deep-rgb), 0.2)); }
            .mentor-risk-title { font-weight: 600; color: var(--color-danger-soft); margin-bottom: 8px; }
            .mentor-risk-item { color: var(--color-danger-softer); font-size: 0.88rem; line-height: 1.4; margin-bottom: 6px; }

            @keyframes mentorBackgroundFlow {
                0% { background-position: 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0; }
                50% { background-position: 0 0, 0 0, 30px -24px, -24px 20px, 24px -18px, -20px 18px, 16px -14px, -14px 16px; }
                100% { background-position: 0 0, 0 0, 60px -48px, -48px 40px, 48px -36px, -40px 36px, 32px -28px, -28px 32px; }
            }

            .todo-popout-overlay { position: fixed; inset: 0; background: rgba(var(--color-black-rgb), 0.7); opacity: 0; pointer-events: none; transition: opacity 0.25s ease; z-index: 1700; }
            .todo-popout-overlay.visible { opacity: 1; pointer-events: auto; }
            .todo-popout-panel { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.96); width: min(760px, calc(100% - 32px)); max-height: min(80vh, 720px); overflow: auto; background: var(--color-bg-panel); border: 1px solid rgba(var(--color-accent-gold-rgb), 0.18); border-radius: 16px; box-shadow: 0 18px 44px rgba(var(--color-black-rgb), 0.35); padding: 18px; box-sizing: border-box; z-index: 1800; opacity: 0; pointer-events: none; transition: all 0.25s ease; }
            .todo-popout-panel.visible { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
            .todo-popout-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; color: var(--color-accent-gold); }
            .todo-popout-header button { width: auto; padding: 6px 10px; border: 1px solid var(--color-accent-gold); background: transparent; color: var(--color-accent-gold); border-radius: 6px; cursor: pointer; }
            .todo-group-card { border: 1px solid rgba(var(--color-accent-gold-rgb), 0.16); border-radius: 12px; padding: 12px; background: rgba(var(--color-black-rgb), 0.14); }
            .todo-group-card.collapsed .todo-group-preview { display: none; }
            .todo-group-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
            .todo-group-title-wrap { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
            .todo-group-toggle { width: auto; min-width: 40px; padding: 6px 10px; border: 1px solid rgba(var(--color-accent-gold-rgb), 0.28); background: transparent; color: var(--color-accent-gold); border-radius: 8px; cursor: pointer; }
            .todo-group-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
            .todo-group-actions button { width: auto; padding: 6px 10px; border: 1px solid var(--color-accent-gold); background: transparent; color: var(--color-accent-gold); border-radius: 8px; cursor: pointer; }
            .todo-group-preview { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
            .todo-preview-note { margin-top: 4px; }

            /* MOBILE: Transformation to Stacked Cards */
            @media (max-width: 768px) {
                body { align-items: stretch; padding: 18px 12px; }
                .hub-container { grid-template-columns: 1fr; }
                h1 { margin: 12px 0 16px; font-size: 1.55rem; }
                .card { padding: 20px; }

                .todo-panel-header { flex-direction: column; align-items: stretch; }
                .todo-panel-header h2 { font-size: 1.1rem; }
                .todo-panel-header-actions { width: 100%; }

                .dashboard-mentor-sidebar { width: 100%; }
                .dashboard-mentor-toggle,
                .todo-panel-toggle,
                .dashboard-mentor-header button,
                .mentor-input button,
                .todo-popout-header button { width: auto; }
                .dashboard-mentor-toggle { width: 100%; }
                .todo-panel-toggle { width: 100%; }

                .todo-popout-panel { width: calc(100% - 16px); max-height: 90vh; padding: 14px; }
                .todo-popout-header { flex-direction: column; align-items: flex-start; gap: 8px; }

                /* Hide desktop headers */
                .todo-item-header { display: none; }

                /* Force each item to be a vertical stack */
                .todo-item {
                    display: flex;
                    flex-direction: column;
                    align-items: flex-start;
                    gap: 8px;
                    padding: 16px;
                }

                .todo-item .value {
                    width: 100%;
                    display: flex;
                    align-items: flex-start;
                    gap: 8px;
                    min-width: 0;
                }

                .todo-item .value::before {
                    flex: 0 0 76px;
                    color: var(--color-accent-gold);
                    font-weight: 600;
                }

                /* Inject labels only on mobile */
                .todo-item .value:nth-child(2)::before { content: "Created:"; }
                .todo-item .value:nth-child(3)::before { content: "Due:"; }
                .todo-item .value:nth-child(4)::before { content: "Assigned:"; }
                .todo-item .value:nth-child(5)::before { content: "Status:"; }

                .todo-item .value:not(:first-child) {
                    overflow-wrap: anywhere;
                    word-break: break-word;
                }

                .todo-item .todo-due-date {
                    width: 100%;
                    min-width: 0;
                }

                .todo-item .todo-complete,
                .todo-item input[type="checkbox"] {
                    width: auto;
                    flex: 0 0 auto;
                    margin: 0;
                }

                /* FIX: Ensure checkbox/text doesn't overflow */
                .todo-item .value:first-child {
                    align-items: flex-start;
                    font-weight: bold;
                }

                .todo-item .value:first-child span {
                    min-width: 0;
                    white-space: normal;
                    overflow-wrap: break-word;
                    word-break: break-word;
                    flex: 1;
                }

                .todo-task-actions {
                    width: 100%;
                    justify-content: flex-start;
                }
            }

/* Workspace dashboard visual refresh */
body.workspace-dashboard {
    display: block;
    padding: 0 0 28px;
}

body.workspace-dashboard::before {
    background-image:
        radial-gradient(circle at 14% 18%, rgba(var(--color-accent-gold-rgb), 0.2) 0%, transparent 36%),
        radial-gradient(circle at 84% 20%, rgba(var(--color-accent-red-rgb), 0.22) 0%, transparent 34%),
        radial-gradient(circle at 78% 84%, rgba(var(--color-accent-rose-rgb), 0.2) 0%, transparent 36%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 800'%3E%3Cdefs%3E%3ClinearGradient id='w1' x1='0%25' y1='100%25' x2='100%25' y2='0%25'%3E%3Cstop offset='0%25' stop-color='%23e6d6b8'/%3E%3Cstop offset='100%25' stop-color='%238b0000'/%3E%3C/linearGradient%3E%3ClinearGradient id='w2' x1='0%25' y1='0%25' x2='100%25' y2='100%25'%3E%3Cstop offset='0%25' stop-color='%23c75468'/%3E%3Cstop offset='100%25' stop-color='%23e6d6b8'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cg fill='none' stroke-linecap='round'%3E%3Cpath d='M40 620 C220 480, 340 420, 540 500 C740 580, 900 520, 1160 360' stroke='url(%23w1)' stroke-width='2.4' opacity='0.45'/%3E%3Cpath d='M20 500 C240 360, 380 380, 560 440 C760 510, 950 450, 1180 250' stroke='url(%23w2)' stroke-width='1.6' opacity='0.42'/%3E%3Cpath d='M80 700 C280 560, 420 560, 620 640 C840 720, 980 650, 1180 500' stroke='url(%23w1)' stroke-width='1.3' opacity='0.34'/%3E%3Cpath d='M120 200 C360 90, 640 120, 840 220 C980 290, 1080 320, 1180 280' stroke='url(%23w2)' stroke-width='1.1' opacity='0.36'/%3E%3Cpath d='M0 300 C170 220, 320 210, 520 270 C770 350, 940 330, 1200 180' stroke='url(%23w1)' stroke-width='0.9' opacity='0.3'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 100% 100%, 100% 100%, 100% 100%, cover;
    background-position: center, center, center, center;
    /* screen in dark, multiply in light: the curve colours are baked into the
       SVG data-URI above and cannot be tokenised, so the blend mode is what
       keeps them visible when the ground flips. */
    opacity: var(--flow-line-opacity);
    mix-blend-mode: var(--flow-line-blend);
    animation: workspaceLineGlowDrift 20s ease-in-out infinite alternate;
}

body.workspace-dashboard::after {
    /* Denser variant of the base body::after grid, and more specific than it, so
       it needs the same tokens -- otherwise the workspace keeps a white grid on
       parchment while every other page gets the warm one. */
    background-image:
        linear-gradient(var(--bg-grid-line-workspace) 1px, transparent 1px),
        linear-gradient(90deg, var(--bg-grid-line-workspace) 1px, transparent 1px),
        repeating-linear-gradient(132deg, rgba(var(--color-accent-gold-rgb), 0.12) 0, rgba(var(--color-accent-gold-rgb), 0.12) 1px, transparent 1px, transparent 32px);
    background-size: 30px 30px, 30px 30px, 180px 180px;
    opacity: var(--bg-grid-opacity-workspace);
    animation: workspaceGridSweep 28s linear infinite;
}

@keyframes workspaceLineGlowDrift {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
        filter: saturate(1) brightness(1);
    }
    50% {
        transform: translate3d(0.8%, -1.1%, 0) scale(1.03);
        filter: saturate(1.12) brightness(1.08);
    }
    100% {
        transform: translate3d(-0.8%, 1%, 0) scale(1.05);
        filter: saturate(1.16) brightness(1.12);
    }
}

@keyframes workspaceGridSweep {
    from {
        background-position: 0 0, 0 0, 0 0;
    }
    to {
        background-position: 0 0, 0 0, 180px -180px;
    }
}

.workspace-dashboard-main {
    width: min(1160px, calc(100% - 24px));
    margin: 18px auto 0;
    display: grid;
    /* Dynamic Canvas: six modular tracks instead of one implicit column, so
       two page-level modules can share a row. Modules opt in to a narrower
       span via the .canvas-span-* utilities below; anything that doesn't
       stays full-bleed, so adding a module never silently shrinks it. */
    grid-template-columns: repeat(6, minmax(0, 1fr));
    align-items: start;
    gap: 18px;
}

/* Grid items default to min-width: auto (their min-content width) -- that
   exact default is what let the Active Project select's 260px min-width push
   a whole shared track past the viewport. Guard every canvas child up front
   rather than one widget at a time after the fact. */
.workspace-dashboard-main > * {
    grid-column: 1 / -1;
    min-width: 0;
}

.workspace-dashboard-main > .canvas-span-2 { grid-column: span 2 / span 2; }
.workspace-dashboard-main > .canvas-span-3 { grid-column: span 3 / span 3; }
.workspace-dashboard-main > .canvas-span-4 { grid-column: span 4 / span 4; }
.workspace-dashboard-main > .canvas-span-full { grid-column: 1 / -1; }

/* align-self re-opts into stretch: the canvas is align-items: start so a
   short module never balloons to its neighbour's height, but a two-row
   module has to fill the rows it claims. */
.workspace-dashboard-main > .canvas-tall {
    grid-row: span 2 / span 2;
    align-self: stretch;
}

.workspace-dashboard-hero {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 18px;
    align-items: stretch;
}

.workspace-dashboard-eyebrow {
    margin: 0 0 6px;
    color: var(--color-accent-gold);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.74rem;
    font-weight: 700;
}

body.workspace-dashboard #dashboardHeading {
    margin: 0;
    color: var(--color-text-primary);
    text-align: left;
    font-size: clamp(1.75rem, 2.8vw, 2.7rem);
}

.workspace-dashboard-subtitle {
    margin: 10px 0 0;
    color: var(--color-text-secondary);
    line-height: 1.55;
    max-width: 740px;
}

.workspace-scope-widget,
body.workspace-dashboard .project-context-panel,
body.workspace-dashboard .todo-panel,
body.workspace-dashboard .team-roster-widget,
body.workspace-dashboard .daily-capacity-widget,
body.workspace-dashboard .workspace-hub-grid .card {
    /* No backdrop-filter -- see .claude/design-system.md's glassmorphism
       ban. The semi-opaque background alone already gives these cards
       enough separation from the textured page background to stay
       readable; the blur was pure decoration on top of that. */
    background: rgba(var(--color-panel-translucent-rgb), 0.82);
    border: 1px solid rgba(var(--color-accent-gold-rgb), 0.16);
    border-radius: 18px;
    box-shadow: 0 16px 38px rgba(var(--color-black-rgb), 0.35);
}

/* "Fluid Graph" depth, the non-glassmorphic way: soft multi-stop radial
   gradients that read as organic data flow, layered over the card surface
   above rather than replacing it. background-image only -- the 0.82
   background-color set above is what these blend against, so a .fluid-panel
   is always also a card. The second selector is only there to out-specify
   the .workspace-hub-grid .card surface rule if a hub tile ever opts in. */
body.workspace-dashboard .fluid-panel,
body.workspace-dashboard .workspace-hub-grid .card.fluid-panel {
    background-image:
        radial-gradient(120% 88% at 6% -8%,
            rgba(var(--color-accent-gold-rgb), 0.11) 0%,
            rgba(var(--color-accent-gold-rgb), 0.045) 26%,
            transparent 58%),
        radial-gradient(105% 92% at 104% 10%,
            rgba(var(--color-accent-red-rgb), 0.32) 0%,
            rgba(var(--color-accent-red-rgb), 0.11) 32%,
            transparent 64%),
        radial-gradient(150% 130% at 50% 112%,
            rgba(var(--color-bg-rgb), 0.6) 0%,
            rgba(var(--color-panel-translucent-rgb), 0.24) 42%,
            transparent 78%);
    background-repeat: no-repeat;
    /* 180ms ease-out per .claude/design-system.md section 3, not the 0.3s
       ease used by the older card rules. */
    transition: border-color 180ms ease-out, box-shadow 180ms ease-out;
}

body.workspace-dashboard .fluid-panel:hover,
body.workspace-dashboard .fluid-panel:focus-within {
    border-color: rgba(var(--color-accent-gold-rgb), 0.32);
    box-shadow: 0 20px 44px rgba(var(--color-black-rgb), 0.44);
}

.workspace-scope-widget {
    padding: 16px;
    display: grid;
    gap: 12px;
    min-width: 0;
    transition: all 180ms ease-out;
}

.workspace-scope-widget:hover,
.workspace-scope-widget:focus-within {
    transform: translateY(-3px);
    border-color: rgba(var(--color-accent-gold-rgb), 0.3);
    box-shadow: 0 20px 44px rgba(var(--color-black-rgb), 0.44);
}

.workspace-scope-widget-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.workspace-scope-widget-eyebrow {
    margin: 0 0 4px;
    color: var(--color-accent-gold);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.7rem;
    font-weight: 700;
}

.workspace-scope-widget h2 {
    margin: 0;
    font-size: 1.06rem;
}

.workspace-scope-widget-badge {
    white-space: nowrap;
    background: rgba(var(--color-accent-red-rgb), 0.4);
    color: var(--color-text-primary);
    border: 1px solid rgba(var(--color-accent-gold-rgb), 0.26);
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 0.78rem;
    font-weight: 700;
}

.workspace-scope-widget-body {
    display: grid;
    gap: 10px;
}

.workspace-scope-widget-metric,
.workspace-scope-widget-list li {
    border: 1px solid rgba(var(--color-accent-gold-rgb), 0.14);
    border-radius: 12px;
    background: rgba(var(--color-black-rgb), 0.22);
    padding: 11px 12px;
    transition: all 0.3s ease;
}

.workspace-scope-widget-label,
.workspace-scope-widget-item-meta {
    color: var(--color-text-muted);
    font-size: 0.84rem;
}

.workspace-scope-widget-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 9px;
}

.workspace-scope-widget-list li:hover {
    border-color: rgba(var(--color-accent-gold-rgb), 0.3);
    background: rgba(var(--color-accent-gold-rgb), 0.08);
    transform: translateY(-2px);
}

.workspace-scope-widget-item-title,
.workspace-scope-widget-item-meta {
    display: block;
}

body.workspace-dashboard .project-context-panel {
    margin-top: 0;
    padding: 20px;
    /* Same grid-blowout guard as .team-roster-widget/.daily-capacity-widget
       below: without this, the project-select's min-width forces the whole
       shared single-column grid track (and every other row in it) past the
       viewport on mobile instead of letting this row's content wrap. */
    min-width: 0;
}

body.workspace-dashboard .project-context-action,
body.workspace-dashboard .todo-panel-toggle,
body.workspace-dashboard .dashboard-mentor-toggle,
body.workspace-dashboard .todo-popout-header button,
body.workspace-dashboard .dashboard-mentor-header button,
body.workspace-dashboard .mentor-input button,
body.workspace-dashboard .workspace-hub-grid .card button {
    transition: all 0.3s ease;
}

body.workspace-dashboard .project-context-action:hover,
body.workspace-dashboard .todo-panel-toggle:hover,
body.workspace-dashboard .dashboard-mentor-toggle:hover,
body.workspace-dashboard .todo-popout-header button:hover,
body.workspace-dashboard .dashboard-mentor-header button:hover,
body.workspace-dashboard .mentor-input button:hover,
body.workspace-dashboard .workspace-hub-grid .card button:hover,
body.workspace-dashboard .project-context-action:focus-visible,
body.workspace-dashboard .todo-panel-toggle:focus-visible,
body.workspace-dashboard .dashboard-mentor-toggle:focus-visible,
body.workspace-dashboard .todo-popout-header button:focus-visible,
body.workspace-dashboard .dashboard-mentor-header button:focus-visible,
body.workspace-dashboard .mentor-input button:focus-visible,
body.workspace-dashboard .workspace-hub-grid .card button:focus-visible {
    border-color: rgba(var(--color-accent-gold-rgb), 0.85);
    background: rgba(var(--color-accent-gold-rgb), 0.14);
    transform: translateY(-1px);
    color: var(--color-text-primary);
    box-shadow: 0 10px 20px rgba(var(--color-black-rgb), 0.25);
}

body.workspace-dashboard .todo-panel {
    width: 100%;
    margin-top: 0;
    min-width: 0;
}

/* Roster governance alert: prominent, sticky banner shown when a task
   assignment was forced to Unassigned because the assignee isn't on the
   project's approved team roster. */
.roster-governance-alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    /* background-color under the gradient, not `background:` alone. The wash is
       translucent, so on its own it takes the colour of whatever is behind it --
       parchment in light mode -- and the fixed cream ink below stops working.
       With the ground pinned, this banner renders identically in both themes. */
    background-color: var(--on-risk-ground);
    background-image: linear-gradient(120deg, rgba(var(--color-accent-red-rgb), 0.55), rgba(var(--color-accent-red-deep-rgb), 0.7));
    border: 1px solid rgba(var(--color-accent-gold-rgb), 0.55);
    /* --on-risk, NOT --color-text-warm-1: this banner's red ground is
       theme-fixed (--color-accent-red-rgb is identical in both themes), so
       text that follows the theme lands near-black on dark red in light mode.
       Measured 2.1:1 before this change -- the worst contrast in the theme. */
    color: var(--on-risk);
    font-weight: 600;
    box-shadow: 0 14px 30px rgba(var(--color-black-rgb), 0.4);
}

.roster-governance-alert[hidden] {
    display: none;
}

.roster-governance-alert-dismiss {
    width: auto;
    background: transparent;
    /* Sits on the same theme-fixed red ground as the banner text above. */
    border: 1px solid var(--on-risk-line);
    color: var(--on-risk);
    border-radius: 8px;
    padding: 2px 10px;
    font-size: 1rem;
    line-height: 1.4;
    cursor: pointer;
}

body.workspace-dashboard .team-roster-widget {
    padding: 20px;
    /* .workspace-dashboard-main is a grid container, and grid items default
       to min-width: auto -- without this, the wide weekly-hours table (many
       nowrap columns) forces this whole widget past the grid track instead
       of scrolling inside its own overflow-x wrapper below. */
    min-width: 0;
}

.team-roster-widget-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.team-roster-content.collapsed {
    display: none;
}

.team-roster-status {
    color: var(--color-text-muted);
    font-size: 0.86rem;
    margin-bottom: 10px;
    min-height: 1.1em;
}

.team-roster-table-wrap,
.team-roster-hours-table-wrap {
    position: relative;
    overflow-x: auto;
    max-width: 100%;
    border-radius: 12px;
    border: 1px solid rgba(var(--color-accent-gold-rgb), 0.14);
    /* Firefox: make the scrollbar itself an obvious, themed affordance --
       the default thin/overlay scrollbar otherwise gives no hint that a
       table cut off at the container edge has more columns to the right. */
    scrollbar-width: thin;
    scrollbar-color: rgba(var(--color-accent-gold-rgb), 0.45) rgba(var(--color-black-rgb), 0.25);
}

.team-roster-table-wrap::-webkit-scrollbar,
.team-roster-hours-table-wrap::-webkit-scrollbar {
    height: 10px;
}

.team-roster-table-wrap::-webkit-scrollbar-track,
.team-roster-hours-table-wrap::-webkit-scrollbar-track {
    background: rgba(var(--color-black-rgb), 0.25);
}

.team-roster-table-wrap::-webkit-scrollbar-thumb,
.team-roster-hours-table-wrap::-webkit-scrollbar-thumb {
    background: rgba(var(--color-accent-gold-rgb), 0.45);
    border-radius: 8px;
}

.team-roster-table-wrap::-webkit-scrollbar-thumb:hover,
.team-roster-hours-table-wrap::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--color-accent-gold-rgb), 0.75);
}

/* Right-edge fade: an explicit "there's more, scroll me" cue, shown only
   while there's unscrolled content to the right (toggled in dashboard.js). */
.team-roster-table-wrap::after,
.team-roster-hours-table-wrap::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 32px;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(var(--color-bg-overlay-rgb), 0.92));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.team-roster-table-wrap.has-more-right::after,
.team-roster-hours-table-wrap.has-more-right::after {
    opacity: 1;
}

.team-roster-table,
.team-roster-hours-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.team-roster-table th,
.team-roster-table td,
.team-roster-hours-table th,
.team-roster-hours-table td {
    padding: 9px 10px;
    text-align: left;
    border-bottom: 1px solid rgba(var(--color-accent-gold-rgb), 0.12);
    white-space: nowrap;
}

.team-roster-table th,
.team-roster-hours-table th {
    color: var(--color-accent-gold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.72rem;
    background: rgba(var(--color-black-rgb), 0.25);
}

.team-roster-table select,
.team-roster-table input {
    background: var(--color-bg);
    color: var(--color-text-primary);
    border: 1px solid rgba(var(--color-accent-gold-rgb), 0.24);
    border-radius: 8px;
    padding: 6px 8px;
    font-family: inherit;
    font-size: 0.86rem;
}

.team-roster-remove-btn {
    width: auto;
    background: transparent;
    border: 1px solid rgba(var(--color-accent-red-rgb), 0.6);
    color: var(--color-text-warm-1);
    border-radius: 8px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 0.8rem;
}

.team-roster-remove-btn:hover {
    background: rgba(var(--color-accent-red-rgb), 0.35);
}

.team-roster-off-roster-row td {
    color: var(--color-danger-soft);
}

.team-roster-add-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0 6px;
}

.team-roster-add-row select,
.team-roster-add-row input {
    flex: 1;
    min-width: 160px;
}

.team-roster-unverified-note {
    color: var(--color-accent-gold);
    font-size: 0.82rem;
    margin-bottom: 12px;
}

.team-roster-unverified-note[hidden] {
    display: none;
}

.team-roster-hours-heading {
    margin: 18px 0 8px;
    font-size: 0.95rem;
    color: var(--color-text-primary);
}

.team-roster-hours-cell {
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
    font-variant-numeric: tabular-nums;
    border-radius: 4px;
}

body.workspace-dashboard .daily-capacity-widget {
    padding: 20px;
    min-width: 0;
}

.daily-capacity-widget-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.daily-capacity-content.collapsed {
    display: none;
}

.daily-capacity-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 10px;
}

.daily-capacity-legend-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--color-text-muted);
    font-size: 0.76rem;
}

.daily-capacity-legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 3px;
}

.daily-capacity-heatmap-wrap {
    position: relative;
    overflow-x: auto;
    max-width: 100%;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid rgba(var(--color-accent-gold-rgb), 0.14);
    background: rgba(var(--color-black-rgb), 0.2);
    scrollbar-width: thin;
    scrollbar-color: rgba(var(--color-accent-gold-rgb), 0.45) rgba(var(--color-black-rgb), 0.25);
}

.daily-capacity-heatmap-wrap::-webkit-scrollbar {
    height: 10px;
}

.daily-capacity-heatmap-wrap::-webkit-scrollbar-track {
    background: rgba(var(--color-black-rgb), 0.25);
}

.daily-capacity-heatmap-wrap::-webkit-scrollbar-thumb {
    background: rgba(var(--color-accent-gold-rgb), 0.45);
    border-radius: 8px;
}

.daily-capacity-heatmap-wrap::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--color-accent-gold-rgb), 0.75);
}

.daily-capacity-heatmap-wrap::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 32px;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(var(--color-bg-overlay-rgb), 0.92));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.daily-capacity-heatmap-wrap.has-more-right::after {
    opacity: 1;
}

.daily-capacity-heatmap-grid {
    display: grid;
    gap: 4px;
    width: max-content;
    min-width: 100%;
}

.daily-capacity-header {
    text-align: center;
    color: var(--color-accent-gold);
    font-weight: 700;
    font-size: 0.78rem;
    padding: 4px 0 6px;
    border-bottom: 1px solid rgba(var(--color-accent-gold-rgb), 0.22);
}

.daily-capacity-row-label {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    font-weight: 700;
    font-size: 0.82rem;
    color: var(--color-text-secondary);
    white-space: nowrap;
}

.daily-capacity-cell {
    height: 34px;
    min-width: 34px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid transparent;
    font-size: 0.75rem;
    font-weight: 700;
    user-select: none;
    transition: transform 0.12s ease, border-color 0.12s ease;
}

.daily-capacity-cell:hover,
.daily-capacity-cell:focus-visible {
    transform: scale(1.05);
    border-color: var(--color-accent-gold);
    outline: none;
}

.daily-capacity-cell.high-risk {
    box-shadow: 0 0 0 1px rgba(255, 180, 180, 0.28), 0 0 14px rgba(var(--color-accent-red-rgb), 0.35);
}

.daily-capacity-cell.pto {
    border-color: rgba(var(--color-accent-gold-rgb), 0.55);
}

.daily-capacity-drilldown {
    display: none;
    margin-top: 16px;
    border-top: 1px solid rgba(var(--color-accent-gold-rgb), 0.18);
    padding-top: 14px;
}

.daily-capacity-drilldown-title {
    margin: 0 0 8px;
    color: var(--color-accent-gold);
    font-size: 0.98rem;
}

.daily-capacity-drilldown-hint {
    margin: 0 0 10px;
    color: var(--color-text-muted);
    font-size: 0.82rem;
}

.daily-capacity-drilldown-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 6px;
}

.daily-capacity-drilldown-item {
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(var(--color-accent-gold-rgb), 0.14);
    background: rgba(var(--color-black-rgb), 0.18);
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: center;
}

.daily-capacity-drilldown-item.selectable {
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.daily-capacity-drilldown-item.selectable:hover,
.daily-capacity-drilldown-item.selectable:focus-visible {
    border-color: rgba(var(--color-accent-gold-rgb), 0.5);
    background: rgba(var(--color-black-rgb), 0.32);
    outline: none;
}

.daily-capacity-drilldown-due {
    display: inline-block;
    margin-left: 8px;
    color: var(--color-text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

.daily-capacity-drilldown-hours {
    color: var(--color-text-muted);
    font-size: 0.86rem;
    white-space: nowrap;
}

.daily-capacity-drilldown-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
    grid-column: 1 / -1;
}

.daily-capacity-drilldown-actions button {
    width: auto;
    min-height: 30px;
    padding: 5px 9px;
    border-radius: 6px;
    font-size: 0.76rem;
    border: 1px solid var(--color-accent-gold);
    background: transparent;
    color: var(--color-accent-gold);
    cursor: pointer;
}

.daily-capacity-drilldown-actions button.task-delete-btn {
    border-color: rgba(var(--color-danger-rgb), 0.6);
    color: var(--color-danger-soft);
}

.daily-capacity-drilldown-empty {
    padding: 8px 0;
    font-style: italic;
    color: var(--color-text-muted);
}

body.workspace-dashboard .workspace-hub-grid {
    /* 200px rather than 220px so all five route tiles land on one dense row
       at the canvas's 1160px max width instead of wrapping 4 + 1. */
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    max-width: none;
    gap: 16px;
}

body.workspace-dashboard .workspace-hub-grid .card {
    padding: 22px;
    transition: all 180ms ease-out;
}

body.workspace-dashboard .workspace-hub-grid .card:hover {
    transform: translateY(-4px);
    background: linear-gradient(165deg, rgba(var(--color-accent-red-rgb), 0.26), rgba(var(--color-panel-translucent-rgb), 0.72));
    border-color: rgba(var(--color-accent-gold-rgb), 0.42);
    box-shadow: 0 20px 34px rgba(var(--color-black-rgb), 0.44);
}

/* Scale press instead of an opacity fade, per .claude/design-system.md
   section 3. Restates the hover lift so the tile doesn't drop on press. */
body.workspace-dashboard .workspace-hub-grid .card:active {
    transform: translateY(-4px) scale(0.97);
}

body.workspace-dashboard .workspace-hub-grid .card p {
    color: var(--color-text-body);
}

@media (max-width: 900px) {
    .workspace-dashboard-main {
        width: calc(100% - 18px);
        margin-top: 14px;
        gap: 14px;
    }

    /* Collapse the canvas to a single track. Every span utility has to fall
       back to span 1 here or a half-width module would keep its half of a
       track that no longer exists. */
    .workspace-dashboard-main > .canvas-span-2,
    .workspace-dashboard-main > .canvas-span-3,
    .workspace-dashboard-main > .canvas-span-4,
    .workspace-dashboard-main > .canvas-span-full {
        grid-column: 1 / -1;
    }

    .workspace-dashboard-main > .canvas-tall {
        grid-row: auto;
    }

    .workspace-dashboard-hero {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    body.workspace-dashboard {
        padding-bottom: 20px;
    }

    .workspace-scope-widget,
    body.workspace-dashboard .project-context-panel,
    body.workspace-dashboard .todo-panel,
    body.workspace-dashboard .team-roster-widget,
    body.workspace-dashboard .daily-capacity-widget,
    body.workspace-dashboard .workspace-hub-grid .card {
        border-radius: 14px;
    }

    .workspace-dashboard-subtitle {
        font-size: 0.95rem;
    }

    body.workspace-dashboard .workspace-hub-grid {
        gap: 12px;
    }

    body.workspace-dashboard .workspace-hub-grid .card {
        padding: 18px;
    }

    .workspace-scope-widget-header {
        flex-direction: column;
    }

    .workspace-scope-widget-badge {
        width: fit-content;
    }

    /* Stack the Active Project row instead of relying on flex-wrap + the
       select's 260px min-width to happen to fit next to the label -- on
       narrow phones that combination was overflowing the viewport (see
       min-width: 0 fix on .project-context-panel above, which stops the
       shared grid track from being forced wider in the first place; this
       stacked layout is the intentional mobile presentation on top of that). */
    .project-context-row {
        flex-direction: column;
        align-items: stretch;
    }

    body.workspace-dashboard .project-context-select,
    body.workspace-dashboard .project-context-action {
        width: 100%;
        min-width: 0;
    }
}
