/* Nexus Solutions — Dark Luxury Theme */

@import url('https://fonts.googleapis.com/css2?family=Cormorant:ital,wght@0,400;0,500;0,600;0,700&family=Outfit:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    --gold: #c9a84c;
    --gold-light: #d4b86a;
    --gold-dark: #a08530;
    --gold-dim: rgba(201, 168, 76, 0.12);
    --gold-text: rgba(201, 168, 76, 0.7);
    --bg: #08080d;
    --bg-card: rgba(14, 14, 22, 0.85);
    --bg-card-hover: rgba(20, 20, 32, 0.9);
    --surface: rgba(255, 255, 255, 0.03);
    --border: rgba(201, 168, 76, 0.08);
    --border-hover: rgba(201, 168, 76, 0.2);
    --text: #d4d0c8;
    --text-dim: rgba(212, 208, 200, 0.45);
    --text-muted: rgba(212, 208, 200, 0.25);
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg);
    min-height: 100vh;
    color: var(--text);
    padding-bottom: 32px;
}

/* ── Gource Section (canvas + flanking panels) ──────── */

.gource-section {
    position: relative;
    width: 100%;
    height: 45vh;
    min-height: 320px;
    overflow: hidden;
}

.task-panels {
    display: flex;
    width: 100%;
    height: calc(55vh - 80px);
    min-height: 200px;
    border-top: 1px solid var(--border);
}

.gource-container {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    overflow: hidden;
    transition: opacity 0.4s ease;
}

.gource-active {
    opacity: 1;
    z-index: 2;
    pointer-events: auto;
}

.gource-hidden {
    opacity: 0;
    z-index: 1;
    pointer-events: none;
}

#gourceCanvas,
#repoCanvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* ── Gource toggle switcher ─────────────────────────── */

.gource-toggle {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    display: flex;
    gap: 1px;
    background: rgba(8, 8, 13, 0.7);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 1px;
    backdrop-filter: blur(6px);
}

.gource-toggle .toggle-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 8px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 2px 12px;
    cursor: pointer;
    border-radius: 2px;
    transition: all 0.2s;
}

.gource-toggle .toggle-btn:hover {
    color: var(--text-dim);
}

.gource-toggle .toggle-btn.active {
    background: rgba(201, 168, 76, 0.15);
    color: var(--gold);
}

/* gource-right border removed — toggle replaces side-by-side */

.repo-header {
    display: none;
}

/* ── Task Panels ────────────────────────────────────── */

.task-panel {
    flex: 1;
    min-width: 0;
    background: rgba(8, 8, 13, 0.95);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.task-panel-active {
    border-right: 1px solid var(--border);
}

.task-panel-done {
    border-left: none;
}

.panel-header {
    padding: 10px 12px;
    font-family: 'Cormorant', serif;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 2px;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.panel-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 4px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(201, 168, 76, 0.1) transparent;
}

.panel-list::-webkit-scrollbar { width: 3px; }
.panel-list::-webkit-scrollbar-track { background: transparent; }
.panel-list::-webkit-scrollbar-thumb { background: rgba(201, 168, 76, 0.15); border-radius: 2px; }

/* Task item in panel */
.task-entry {
    padding: 8px 14px;
    border-bottom: 1px solid rgba(201, 168, 76, 0.04);
    font-family: 'JetBrains Mono', monospace;
    animation: taskSlideIn 0.35s ease;
    cursor: default;
    transition: background 0.2s;
}

.task-entry:hover {
    background: rgba(201, 168, 76, 0.04);
}

@keyframes taskSlideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.task-entry .task-agent {
    font-size: 10px;
    font-weight: 600;
    color: var(--gold-text);
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 6px;
}

.task-entry .task-role {
    font-weight: 400;
    color: var(--text-dim);
    margin-left: 4px;
}

.task-entry .task-time {
    font-size: 8px;
    font-weight: 400;
    color: var(--text-muted);
    flex-shrink: 0;
}

.task-entry .task-desc {
    font-size: 9px;
    color: var(--text-dim);
    margin-top: 3px;
    line-height: 1.4;
    word-break: break-word;
    white-space: normal;
}

.task-entry .task-chain {
    font-size: 7px;
    color: rgba(201, 168, 76, 0.18);
    margin-top: 1px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    letter-spacing: 0.3px;
}

/* Animation: slide from active panel to done panel */
.task-entry.completing {
    animation: taskSlideOut 0.5s ease forwards;
}

@keyframes taskSlideOut {
    0% { opacity: 1; transform: translateX(0); }
    100% { opacity: 0; transform: translateX(40px); }
}

.task-entry.arriving {
    animation: taskArriveFromLeft 0.5s ease;
}

@keyframes taskArriveFromLeft {
    0% { opacity: 0; transform: translateX(-40px); }
    100% { opacity: 1; transform: translateX(0); }
}

/* Active panel: gold left accent on entries */
.task-panel-active .task-entry {
    border-left: 2px solid rgba(201, 168, 76, 0.2);
}

/* Done panel: dimmed entries */
.task-panel-done .task-entry .task-agent { color: var(--text-dim); }
.task-panel-done .task-entry .task-desc { color: var(--text-muted); }
.task-panel-done .task-entry { border-left: 2px solid rgba(201, 168, 76, 0.06); }

/* Engine task entries */
.task-panel-active .task-entry.engine-entry {
    border-left: 2px solid rgba(80, 200, 220, 0.3);
}

.task-panel-active .task-entry.engine-entry .task-agent span:first-child {
    color: rgba(80, 200, 220, 0.6);
}

.task-panel-active .task-entry.engine-entry .task-chain {
    color: rgba(80, 200, 220, 0.2);
}

.task-entry.engine-passed {
    border-left-color: rgba(34, 197, 94, 0.3) !important;
}

.task-entry.engine-retry {
    border-left-color: rgba(239, 68, 68, 0.3) !important;
}

/* Ticker: engine-specific types */
.ticker-type.merge { background: rgba(80, 200, 220, 0.1); color: rgba(80, 200, 220, 0.6); }

@media (max-width: 1100px) {
    .task-panels { flex-direction: column; height: auto; }
    .task-panel { border-right: none !important; }
    .task-entry { padding: 6px 10px; }
}

@media (max-width: 600px) {
    .gource-section { flex-direction: column; height: auto; }
    .task-panel-done { border-top: 1px solid var(--border); border-bottom: none; }
    .gource-container { height: 40vh; min-height: 280px; }
}

/* ── Site Header (overlay on canvas) ────────────────── */

.site-header {
    position: absolute;
    top: 24px;
    left: 28px;
    z-index: 10;
    max-width: 400px;
}

.site-header .footer-name {
    margin-bottom: 8px;
}

.site-header .footer-pitch,
.site-header .footer-tagline {
    text-align: left;
}

.header-stats {
    position: absolute;
    top: 24px;
    right: 28px;
    display: flex;
    gap: 16px;
    font-size: 11px;
    color: var(--text-dim);
    font-family: 'JetBrains Mono', monospace;
    z-index: 10;
}

.header-stats .stat {
    display: flex;
    align-items: center;
    gap: 5px;
}

.header-stats .stat-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
}

.header-stats .stat-dot.active { background: var(--gold); }
.header-stats .stat-dot.queued { background: rgba(201, 168, 76, 0.4); }
.header-stats .stat-dot.done { background: var(--text-muted); }

/* ── Task Submission Bar ────────────────────────────── */

.task-submit {
    max-width: 1600px;
    margin: 0 auto;
    padding: 8px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.submit-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(201, 168, 76, 0.15);
    flex-shrink: 0;
    transition: background 0.3s;
}

.submit-dot.connected { background: var(--gold); }

.task-submit input {
    flex: 1;
    padding: 7px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: transparent;
    color: var(--text);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.task-submit input::placeholder { color: var(--text-muted); }

.task-submit input:focus {
    outline: none;
    border-color: rgba(201, 168, 76, 0.3);
    box-shadow: 0 0 0 1px rgba(201, 168, 76, 0.08);
}

.task-submit button {
    padding: 7px 16px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: transparent;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.task-submit button:hover:not(:disabled) {
    border-color: rgba(201, 168, 76, 0.3);
    color: var(--gold-text);
}

.task-submit button:disabled { opacity: 0.3; cursor: default; }

.submit-status {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    color: var(--gold-text);
    opacity: 0;
    transition: opacity 0.3s;
    white-space: nowrap;
}

.submit-status.visible { opacity: 1; }

/* ── Agent Browser ──────────────────────────────────── */

.agent-browser {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px 20px;
}

.dept-tabs {
    display: flex;
    gap: 4px;
    padding: 12px 0 8px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
}

.dept-tab {
    padding: 5px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: transparent;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.3px;
}

.dept-tab:hover {
    border-color: var(--border-hover);
    color: var(--text-dim);
}

.dept-tab.active {
    border-color: rgba(201, 168, 76, 0.3);
    color: var(--gold-text);
    background: var(--gold-dim);
}

.dept-tab .tab-count {
    color: var(--text-muted);
    margin-left: 4px;
    font-weight: 400;
}

.agent-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px 0 12px;
    min-height: 32px;
}

.agent-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.agent-chip:hover {
    border-color: var(--border-hover);
    background: var(--bg-card);
}

.agent-chip.selected {
    border-color: rgba(201, 168, 76, 0.3);
    background: var(--gold-dim);
}

.agent-chip.is-active {
    border-color: rgba(201, 168, 76, 0.25);
}

.agent-chip .chip-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(201, 168, 76, 0.12);
    flex-shrink: 0;
}

.agent-chip.is-active .chip-dot {
    background: var(--gold);
    animation: chipDotPulse 2s infinite;
}

@keyframes chipDotPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.agent-chip .chip-name {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    color: var(--text-dim);
    white-space: nowrap;
}

.agent-chip.selected .chip-name { color: var(--gold-text); }
.agent-chip.is-active .chip-name { color: var(--text); }

/* Agent detail card */
.agent-detail {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-card);
    min-height: 80px;
    overflow: hidden;
}

.detail-empty {
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
}

.detail-card {
    display: grid;
    grid-template-columns: auto 1fr 1fr;
    gap: 0;
}

.detail-profile {
    padding: 16px 20px;
    border-right: 1px solid var(--border);
    min-width: 200px;
}

.detail-profile .detail-name {
    font-family: 'Cormorant', serif;
    font-size: 18px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 2px;
}

.detail-profile .detail-title {
    font-size: 11px;
    color: var(--text-dim);
    margin-bottom: 8px;
}

.detail-profile .detail-meta {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    color: var(--text-muted);
    line-height: 1.6;
}

.detail-profile .detail-meta span {
    color: var(--text-dim);
}

.detail-profile .detail-status {
    margin-top: 8px;
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    font-weight: 500;
    background: var(--surface);
    color: var(--text-muted);
}

.detail-profile .detail-status.status-active {
    background: var(--gold-dim);
    color: var(--gold);
}

.detail-task {
    padding: 16px 20px;
    border-right: 1px solid var(--border);
}

.detail-task h4,
.detail-history h4 {
    font-size: 9px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
    font-weight: 500;
}

.detail-task .task-current {
    font-size: 12px;
    color: var(--text-dim);
    line-height: 1.4;
}

.detail-task .task-current.has-task {
    color: var(--gold-text);
}

.detail-task .task-queue-info {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    color: var(--text-muted);
    margin-top: 6px;
}

.detail-task .detail-chain {
    font-family: 'JetBrains Mono', monospace;
    font-size: 8px;
    color: rgba(201, 168, 76, 0.2);
    margin-top: 8px;
}

.detail-history {
    padding: 16px 20px;
}

.detail-history ul {
    list-style: none;
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    color: var(--text-muted);
}

.detail-history ul li {
    padding: 3px 0;
    border-bottom: 1px solid rgba(201, 168, 76, 0.03);
}

@media (max-width: 900px) {
    .detail-card {
        grid-template-columns: 1fr;
    }
    .detail-profile, .detail-task {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
}

/* ── Org Chart Container (hidden, data source only) ─── */

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px 20px;
}

.org-chart {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

/* ── Levels ─────────────────────────────────────────── */

.level {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    padding: 16px;
    width: 100%;
}

.c-suite { padding: 24px; }
.executive-team { gap: 28px; }
.department-heads { gap: 16px; }

.department-heads .dept-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

/* ── Connector Lines ────────────────────────────────── */

.connector {
    width: 1px;
    height: 24px;
    background: linear-gradient(to bottom, var(--border), rgba(201, 168, 76, 0.04));
    position: relative;
}

.connector::before {
    content: '';
    position: absolute;
    top: 0;
    left: -80px;
    width: 160px;
    height: 1px;
    background: var(--border);
}

/* ── Nodes ──────────────────────────────────────────── */

.node {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 12px 16px;
    min-width: 160px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    border: 1px solid var(--border);
    backdrop-filter: blur(8px);
}

.node:hover {
    transform: translateY(-2px);
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    box-shadow: var(--shadow-lg);
}

.node.active {
    animation: activePulse 2.5s infinite;
    border-color: rgba(201, 168, 76, 0.3);
}

@keyframes activePulse {
    0%, 100% { box-shadow: 0 0 12px rgba(201, 168, 76, 0.15); }
    50% { box-shadow: 0 0 20px rgba(201, 168, 76, 0.25); }
}

.node.filtered { opacity: 0.15; }
.node.hidden { display: none; }

/* ── Avatar ─────────────────────────────────────────── */

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 11px;
    color: var(--gold);
    flex-shrink: 0;
    background: var(--gold-dim);
    border: 1px solid rgba(201, 168, 76, 0.15);
}

/* C-Suite avatars */
.ceo .avatar { background: rgba(201, 168, 76, 0.18); border-color: rgba(201, 168, 76, 0.3); }
.cfo .avatar, .cto .avatar, .coo .avatar, .cso .avatar {
    background: rgba(201, 168, 76, 0.12);
    border-color: rgba(201, 168, 76, 0.2);
}

/* ── Node Info ──────────────────────────────────────── */

.node .info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.node .name {
    font-weight: 500;
    font-size: 13px;
    color: var(--text);
}

.node .title {
    font-size: 11px;
    color: var(--text-dim);
    font-weight: 300;
}

/* ── Small Nodes ────────────────────────────────────── */

.node.small {
    min-width: 120px;
    padding: 8px 12px;
    flex-direction: column;
    text-align: center;
    gap: 2px;
}

.node.small .name { font-size: 12px; }
.node.small .title { font-size: 10px; }

/* ── Status Indicator ───────────────────────────────── */

.status-indicator {
    position: absolute;
    top: -3px;
    right: -3px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(201, 168, 76, 0.15);
    border: 1.5px solid var(--bg);
    transition: background 0.3s;
}

.status-indicator.active {
    background: var(--gold);
    animation: indicatorBlink 2s infinite;
}

@keyframes indicatorBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ── Queue Badge ────────────────────────────────────── */

.queue-badge {
    position: absolute;
    top: -5px;
    left: -5px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: rgba(201, 168, 76, 0.5);
    color: var(--bg);
    font-size: 9px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    border: 1.5px solid var(--bg);
    z-index: 2;
    pointer-events: none;
    animation: badgeIn 0.2s ease;
    font-family: 'JetBrains Mono', monospace;
}

@keyframes badgeIn {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

/* ── Done Indicator ─────────────────────────────────── */

.done-indicator {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--gold);
    color: var(--bg);
    font-size: 10px;
    line-height: 16px;
    text-align: center;
    border: 1.5px solid var(--bg);
    z-index: 3;
    pointer-events: none;
    animation: doneFlash 2.5s ease forwards;
}

@keyframes doneFlash {
    0% { transform: scale(0); opacity: 0; }
    15% { transform: scale(1.15); opacity: 1; }
    25% { transform: scale(1); opacity: 1; }
    75% { opacity: 0.8; }
    100% { opacity: 0; transform: scale(0.8); }
}

.node.task-done {
    animation: doneBorder 2.5s ease forwards;
}

@keyframes doneBorder {
    0% { border-color: var(--border); }
    15% { border-color: rgba(201, 168, 76, 0.4); }
    75% { border-color: rgba(201, 168, 76, 0.3); }
    100% { border-color: var(--border); }
}

/* ── Teams Section ──────────────────────────────────── */

.teams {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
    padding: 20px 16px;
    width: 100%;
}

.team-section {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 16px;
    border: 1px solid var(--border);
    backdrop-filter: blur(8px);
}

.team-section h3 {
    font-family: 'Cormorant', serif;
    font-size: 15px;
    font-weight: 500;
    color: var(--gold-text);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.5px;
}

.team-section .count {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 6px;
    max-height: 400px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.team-grid.collapsed { max-height: 0; }

.team-grid .node {
    border-left: 2px solid rgba(201, 168, 76, 0.1);
}

.team-grid .node.character { border-left-color: rgba(140, 100, 220, 0.2); }
.team-grid .node.philosopher { border-left-color: rgba(150, 110, 220, 0.2); }

/* ── Toggle Button ──────────────────────────────────── */

.toggle-btn {
    width: 100%;
    padding: 8px;
    margin-top: 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: transparent;
    color: var(--text-dim);
    font-size: 11px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Outfit', sans-serif;
    letter-spacing: 0.5px;
}

.toggle-btn:hover {
    border-color: var(--border-hover);
    color: var(--gold-text);
}

/* ── Modal ──────────────────────────────────────────── */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #0e0e16;
    border: 1px solid var(--border);
    border-radius: 12px;
    width: 90%;
    max-width: 520px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(-12px); }
    to { opacity: 1; transform: translateY(0); }
}

.close {
    position: absolute;
    top: 14px;
    right: 18px;
    font-size: 22px;
    color: var(--text-dim);
    cursor: pointer;
    transition: color 0.2s;
    z-index: 2;
}

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

.modal-header {
    padding: 24px;
    background: linear-gradient(135deg, rgba(201, 168, 76, 0.08), rgba(201, 168, 76, 0.02));
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 16px;
}

.modal-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--gold-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 600;
    color: var(--gold);
    border: 1px solid rgba(201, 168, 76, 0.2);
}

.modal-title h2 {
    font-family: 'Cormorant', serif;
    font-size: 20px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 2px;
}

.modal-title p {
    color: var(--text-dim);
    font-size: 13px;
    font-weight: 300;
}

.modal-body { padding: 24px; }

.info-section { margin-bottom: 20px; }

.info-section h3 {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 10px;
    font-weight: 500;
}

.info-section p {
    margin-bottom: 6px;
    color: var(--text-dim);
    font-size: 13px;
}

.info-section p strong { color: var(--text); font-weight: 500; }

.info-section ul {
    list-style: none;
    font-size: 12px;
    color: var(--text-dim);
}

.info-section ul li {
    padding: 4px 0;
    border-bottom: 1px solid var(--surface);
}

.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    background: var(--surface);
    color: var(--text-dim);
    font-family: 'JetBrains Mono', monospace;
}

.status-badge.active { background: var(--gold-dim); color: var(--gold); }
.status-badge.busy { background: rgba(201, 168, 76, 0.08); color: var(--gold-dark); }

.modal-actions {
    display: flex;
    gap: 8px;
    padding: 0 24px 24px;
}

.modal-actions button {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-weight: 500;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Outfit', sans-serif;
    background: transparent;
    color: var(--text-dim);
}

.modal-actions button:hover {
    border-color: var(--border-hover);
    color: var(--gold-text);
}

#assignTaskBtn {
    background: var(--gold-dim);
    border-color: rgba(201, 168, 76, 0.2);
    color: var(--gold);
}

#assignTaskBtn:hover {
    background: rgba(201, 168, 76, 0.18);
}

/* ── Footer ─────────────────────────────────────────── */

footer {
    text-align: center;
    padding: 40px 24px;
    border-top: 1px solid var(--border);
}

.footer-brand {
    max-width: 480px;
    margin: 0 auto;
}

.footer-name {
    font-family: 'Cormorant', serif;
    font-size: 18px;
    font-weight: 500;
    color: var(--gold);
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.footer-pitch {
    font-size: 11px;
    color: var(--text-dim);
    line-height: 1.6;
    letter-spacing: 0.3px;
}

.footer-tagline {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 8px;
    font-style: italic;
    letter-spacing: 0.5px;
}

/* ── Task Ticker ────────────────────────────────────── */

.task-ticker {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 30px;
    background: rgba(8, 8, 13, 0.95);
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--border);
    z-index: 900;
    display: flex;
    align-items: center;
    overflow: visible;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
}

.ticker-label {
    flex-shrink: 0;
    padding: 0 12px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 8px;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-right: 1px solid var(--border);
    height: 100%;
    display: flex;
    align-items: center;
    position: relative;
    cursor: default;
}

.version-tooltip {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 4px;
    background: rgba(12, 12, 18, 0.97);
    border: 1px solid var(--gold);
    border-radius: 4px;
    padding: 8px 10px;
    font-size: 9px;
    font-weight: 400;
    letter-spacing: 0.5px;
    text-transform: none;
    color: var(--text-dim);
    white-space: nowrap;
    z-index: 1000;
    box-shadow: 0 2px 12px rgba(0,0,0,0.5);
    pointer-events: none;
}

.version-tooltip .ver-line {
    display: flex;
    gap: 8px;
    line-height: 1.6;
}

.version-tooltip .ver-label {
    color: var(--text-muted);
}

.version-tooltip .ver-value {
    color: var(--gold-light);
}

.ticker-label:hover .version-tooltip {
    display: block;
}

.ticker-track {
    flex: 1;
    display: flex;
    align-items: center;
    overflow: hidden;
    padding: 0 8px;
    mask-image: linear-gradient(90deg, transparent 0%, black 3%, black 90%, transparent 100%);
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, black 3%, black 90%, transparent 100%);
}

.ticker-item {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0 12px;
    color: var(--text-muted);
    white-space: nowrap;
    animation: tickerSlide 0.35s ease;
    border-right: 1px solid rgba(201, 168, 76, 0.04);
}

.ticker-item:last-child { border-right: none; }

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

.ticker-item .ticker-type {
    font-size: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1px 4px;
    border-radius: 2px;
}

.ticker-type.queued { background: rgba(201, 168, 76, 0.1); color: var(--gold-dark); }
.ticker-type.active { background: rgba(201, 168, 76, 0.15); color: var(--gold); }
.ticker-type.done { background: var(--surface); color: var(--text-muted); }
.ticker-type.delegated { background: rgba(140, 100, 220, 0.1); color: rgba(140, 100, 220, 0.6); }

.ticker-item .ticker-arrow { color: rgba(201, 168, 76, 0.15); font-size: 9px; }
.ticker-item .ticker-agent { color: var(--text-dim); font-weight: 500; }
.ticker-item .ticker-task { color: var(--text-muted); max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.ticker-item .ticker-time { color: rgba(201, 168, 76, 0.12); font-size: 9px; }

.ticker-stats {
    flex-shrink: 0;
    padding: 0 12px;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    border-left: 1px solid var(--border);
    font-size: 9px;
    color: var(--text-muted);
}

.ticker-stat {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ticker-stat .stat-dot { width: 5px; height: 5px; border-radius: 50%; }
.stat-dot.active-dot { background: var(--gold); }
.stat-dot.queued-dot { background: rgba(201, 168, 76, 0.35); }
.stat-dot.done-dot { background: var(--text-muted); }
.ticker-stat .stat-val { font-weight: 600; color: var(--text-dim); font-variant-numeric: tabular-nums; }

/* ── Responsive ─────────────────────────────────────── */

@media (max-width: 768px) {
    .gource-container { height: 40vh; min-height: 280px; }
    .site-header h1 { font-size: 1.1rem; }
    .level { flex-direction: column; align-items: center; }
    .teams { grid-template-columns: 1fr; }
    .team-grid { grid-template-columns: repeat(2, 1fr); }
    .modal-content { width: 95%; }
}

@media print {
    .gource-container, .task-ticker, .toggle-btn, footer { display: none; }
    body { background: white; color: #1a1a1a; }
    .node { background: white; border-color: #ddd; }
    .team-grid { max-height: none !important; }
}
