/* SENTINEL CHAT INTERFACE & STACK (Right Column) */

.header-main {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 15px;
}

/* Falcon Protocol branding styles removed per redesign */

/* The Container Stack */
.right-column-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    /* Grid slot handled by parent .dashboard-grid */
}

/* 1. TOP CARD: SENTINEL (Chat + Exports) */
.sentinel-card {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.sentinel-scroll-area {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    
    /* Scrollbar styling */
    scrollbar-width: thin;
    scrollbar-color: rgba(232, 232, 236, 0.2) transparent;
}

.sentinel-scroll-area::-webkit-scrollbar {
    width: 6px;
}

.sentinel-scroll-area::-webkit-scrollbar-track {
    background: transparent;
}

.sentinel-scroll-area::-webkit-scrollbar-thumb {
    background: rgba(232, 232, 236, 0.15);
    border-radius: 10px;
}

.sentinel-scroll-area::-webkit-scrollbar-thumb:hover {
    background: rgba(232, 232, 236, 0.25);
}

.execution-dashboard {
    flex: 0 0 auto;
    max-height: 280px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(232, 232, 236, 0.18) transparent;
}

.execution-dashboard::-webkit-scrollbar {
    width: 6px;
}

.execution-dashboard::-webkit-scrollbar-track {
    background: transparent;
}

.execution-dashboard::-webkit-scrollbar-thumb {
    background: rgba(232, 232, 236, 0.16);
    border-radius: 10px;
}

.execution-dashboard::-webkit-scrollbar-thumb:hover {
    background: rgba(232, 232, 236, 0.24);
}

/* 2. BOTTOM CARD: AUX (Telemetry only - compact log) */
.aux-card {
    flex: 1 1 40%;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 12px;
}


/* --- SENTINEL INTERNALS --- */

.sentinel-header {
    border-bottom: 1px solid rgba(232, 232, 236, 0.08);
    padding: 16px 16px 12px 16px;
    margin-bottom: 0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sentinel-header h2 {
    font-family: var(--font-head);
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 4px;
}

.sentinel-subtitle {
    font-size: 13px;
    color: var(--accent-gold);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    text-shadow: 0 0 10px rgba(245, 168, 0, 0.18);
    opacity: 0.8;
}

.comms-thread-summary,
.revision-impact-strip {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 14px;
}

.comms-thread-summary.is-collapsed,
.revision-impact-strip.is-collapsed,
.comms-activity-feed.is-collapsed {
    display: none;
}

.comms-activity-feed {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(232, 232, 236, 0.08);
    background: linear-gradient(180deg, rgba(18, 18, 18, 0.96), rgba(12, 12, 12, 0.98));
}

/* Pinned Live Revision Feed — sits directly below tactical input */
.comms-activity-feed.comms-activity-pinned {
    margin-top: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: transparent;
    padding: 10px 14px;
    flex-shrink: 0;
}

.followup-spotlight {
    display: none;
    flex-direction: column;
    gap: 12px;
    margin: 0;
    padding: 14px 16px 16px;
    border-top: none;
    border-right: none;
    border-bottom: 1px solid rgba(245, 168, 0, 0.2);
    border-left: none;
    border-radius: 0;
    background:
        linear-gradient(180deg, rgba(28, 22, 10, 0.98), rgba(10, 10, 14, 0.99));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.03),
        inset 0 -1px 0 rgba(245, 168, 0, 0.06);
    flex-shrink: 0;
    min-height: clamp(180px, 28vh, 260px);
    max-height: 38vh;
    overflow: hidden;
    resize: none;
}

.followup-spotlight.is-visible {
    display: flex;
}

.followup-spotlight-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.followup-spotlight-label {
    font-family: var(--font-head);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(245, 168, 0, 0.9);
}

.followup-spotlight-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.followup-spotlight-open,
.followup-spotlight-dock {
    border: 1px solid rgba(245, 168, 0, 0.28);
    background: rgba(245, 168, 0, 0.1);
    color: #F5A800;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.followup-spotlight-dock {
    border-color: rgba(0, 255, 157, 0.25);
    background: rgba(0, 255, 157, 0.08);
    color: var(--accent-green);
}

.followup-spotlight-open:hover,
.followup-spotlight-dock:hover {
    filter: brightness(1.1);
    box-shadow: 0 0 14px rgba(245, 168, 0, 0.14);
}

.followup-spotlight-dock:disabled {
    opacity: 0.6;
    cursor: default;
    filter: none;
    box-shadow: none;
}

.followup-spotlight-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-right: 10px;
    font-size: 15px;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.9);
    white-space: pre-wrap;
    word-break: break-word;
}

.followup-spotlight-body::-webkit-scrollbar {
    width: 6px;
}

.followup-spotlight-body::-webkit-scrollbar-thumb {
    background: rgba(245, 168, 0, 0.22);
    border-radius: 999px;
}

.comms-activity-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.activity-kicker {
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--accent-gold);
}

.activity-copy {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.45;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.activity-item {
    display: flex;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(232, 232, 236, 0.06);
    background: rgba(255, 255, 255, 0.02);
}

.activity-item strong {
    display: block;
    margin-bottom: 4px;
    color: var(--text-primary);
    font-size: 13px;
}

.activity-item span:last-child {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.4;
}

.activity-dot {
    width: 8px;
    height: 8px;
    margin-top: 5px;
    border-radius: 50%;
    background: var(--text-tertiary);
    box-shadow: 0 0 0 4px rgba(61, 61, 61, 0.14);
    flex: 0 0 auto;
}

.activity-dot.is-ready {
    background: var(--accent-green);
    box-shadow: 0 0 0 4px rgba(76, 175, 125, 0.12);
}

.activity-dot.is-live {
    background: var(--accent-gold);
    box-shadow: 0 0 0 4px rgba(245, 168, 0, 0.12);
}

.activity-dot.is-alert {
    background: var(--accent-red);
    box-shadow: 0 0 0 4px rgba(255, 77, 77, 0.12);
}

.thread-summary-block,
.revision-impact-item {
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(232, 232, 236, 0.08);
    background: linear-gradient(180deg, rgba(24, 24, 24, 0.96), rgba(14, 14, 14, 0.98));
}

.thread-summary-label,
.impact-label {
    display: block;
    margin-bottom: 6px;
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text-tertiary);
}

.thread-summary-block strong,
.revision-impact-item strong {
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    text-overflow: ellipsis;
}

.thread-summary-block strong {
    -webkit-line-clamp: 4;
}

.revision-impact-item strong {
    -webkit-line-clamp: 3;
}

.comms-thread-summary .thread-summary-block:first-child {
    display: none;
}

.sentinel-chat-container {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    padding-right: 8px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    /* Messages stack from bottom like a chat */
    padding-bottom: 8px;
    position: relative;
}

.sentinel-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-message {
    font-family: var(--font-body);
    font-size: 13px;
    line-height: 1.5;
    padding: 10px 14px;
    border-radius: 8px;
    position: relative;
    max-width: 90%;
    animation: fadeIn 0.3s ease-out;
}

.chat-message.sentinel {
    background: rgba(255, 255, 255, 0.04);
    border-left: 2px solid var(--accent-gold);
    color: var(--text-primary);
    align-self: flex-start;
    border-top-left-radius: 2px;
}

.chat-message.user {
    background: rgba(0, 0, 0, 0.3);
    border-right: 2px solid var(--accent-taupe);
    color: var(--text-secondary);
    align-self: flex-end;
    border-top-right-radius: 2px;
    text-align: right;
}

.chat-text {
    display: block;
}

.comms-empty-state {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    pointer-events: none;
    transition: opacity 0.18s ease;
}

.comms-empty-state.hidden {
    opacity: 0;
}

.comms-empty-title {
    font-family: var(--font-head);
    font-size: 13px;
    color: rgba(255, 255, 255, 0.86);
    letter-spacing: 0.04em;
}

.comms-empty-text {
    font-family: var(--font-body);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.52);
}

.sentinel-input-area {
    display: flex;
    gap: 8px;
    background: rgba(10, 10, 10, 0.72);
    border: 1px solid rgba(232, 232, 236, 0.12);
    border-radius: 8px;
    padding: 8px;
    flex-shrink: 0;
    z-index: 3;
}

/* Pinned at top of Global Comms, always visible */
.sentinel-input-top {
    margin: 0 0 0 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
    border-bottom: 1px solid rgba(245, 168, 0, 0.2);
    background:
        linear-gradient(180deg, rgba(22, 18, 10, 0.94), rgba(10, 10, 14, 0.98));
    padding: 12px 14px;
    flex-shrink: 0;
}

.sentinel-composer {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.sentinel-composer-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sentinel-composer-kicker {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent-gold);
}

.sentinel-composer-hint {
    color: rgba(255, 255, 255, 0.62);
    font-size: 12px;
    line-height: 1.45;
}

.sentinel-input-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 10px;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid rgba(245, 168, 0, 0.18);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015)),
        rgba(6, 6, 8, 0.72);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.sentinel-input {
    flex-grow: 1;
    background: transparent;
    border: none;
    color: #FFF;
    font-family: var(--font-body);
    font-size: 13px;
    outline: none;
    resize: none;
    min-height: 52px;
    max-height: 128px;
    line-height: 1.5;
    overflow-y: auto;
}

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

.sentinel-send {
    background: rgba(245, 168, 0, 0.15);
    border: 1px solid rgba(245, 168, 0, 0.35);
    color: var(--accent-gold);
    cursor: pointer;
    transition: transform 0.2s, color 0.2s, background 0.2s, border-color 0.2s;
    padding: 6px 10px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
    align-self: end;
}

.sentinel-send:hover {
    background: rgba(245, 168, 0, 0.25);
    border-color: rgba(245, 168, 0, 0.6);
    color: var(--accent-gold-bright);
    transform: translateX(2px);
    box-shadow: 0 0 10px rgba(245, 168, 0, 0.2);
}

.sentinel-send:active {
    transform: scale(0.95);
    background: rgba(245, 168, 0, 0.35);
}

.sentinel-input:disabled,
.sentinel-send:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

@media (max-width: 1024px) {
    .followup-spotlight {
        margin: 0;
        border-radius: 0;
        border-left: none;
        border-right: none;
        min-height: 72vh;
        max-height: 88vh;
        resize: none;
    }
}

/* Scrollbar */
.sentinel-chat-container::-webkit-scrollbar {
    width: 4px;
}

.sentinel-chat-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.sentinel-chat-container::-webkit-scrollbar-track {
    background: transparent;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === COMMS MODE TOGGLE (Chat/Dock Tabs) === */
.comms-mode-toggle {
    display: flex;
    gap: 4px;
    margin-left: auto;
}

.comms-tab {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #888;
    font-size: 10px;
    font-family: var(--font-mono);
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.comms-tab:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #FFF;
}

.comms-tab.active {
    background: rgba(245, 168, 0, 0.1);
    border-color: var(--accent-gold);
    color: var(--accent-gold-bright);
}

.comms-tab .dock-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 1px 5px;
    border-radius: 8px;
    font-size: 13px;
    margin-left: 4px;
}

.comms-tab.active .dock-count {
    background: var(--accent-green);
    color: #000;
}

/* Comms panels */
.comms-panel {
    display: none;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.comms-panel.active {
    display: flex;
}

/* === RESEARCH DOCK === */
#researchDock {
    padding-top: 12px;
}

.chat-toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 4px;
    flex-shrink: 0;
}

.dock-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    flex-shrink: 0;
}

.dock-action {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #AAA;
    font-size: 13px;
    font-family: var(--font-mono);
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.dock-action:hover {
    background: rgba(0, 255, 157, 0.1);
    border-color: var(--accent-green);
    color: var(--accent-green);
}

.dock-snippets {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 4px;
}

.dock-empty {
    text-align: center;
    color: #555;
    font-size: 12px;
    font-family: var(--font-mono);
    padding: 40px 20px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

/* Individual Snippet Card */
.dock-snippet {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 8px 10px;
    transition: all 0.2s;
    animation: fadeIn 0.3s ease-out;
}

.dock-snippet:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
}

.dock-snippet[data-type="table"],
.dock-snippet[data-type="csv"] {
    border-left: 2px solid #4285f4;
}

.dock-snippet[data-type="code"] {
    border-left: 2px solid #a855f7;
}

.dock-snippet[data-type="data"] {
    border-left: 2px solid #00FF9D;
}

.dock-snippet[data-type="mermaid"] {
    border-left: 2px solid #facc15;
}

.dock-snippet[data-type="text"] {
    border-left: 2px solid #888;
}

.snippet-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.snippet-icon {
    font-size: 14px;
}

.snippet-label {
    font-size: 10px;
    font-family: var(--font-mono);
    color: #AAA;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex: 1;
}

.snippet-actions {
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.2s;
}

.dock-snippet:hover .snippet-actions {
    opacity: 1;
}

.snippet-actions button {
    background: transparent;
    border: none;
    font-size: 12px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    transition: all 0.2s;
    opacity: 0.6;
}

.snippet-actions button:hover {
    background: rgba(255, 255, 255, 0.1);
    opacity: 1;
}

.snippet-preview {
    font-size: 13px;
    font-family: var(--font-mono);
    color: #777;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Scrollbar for dock */
.dock-snippets::-webkit-scrollbar {
    width: 4px;
}

.dock-snippets::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.dock-snippets::-webkit-scrollbar-track {
    background: transparent;
}

/* --- RESEARCH DOCK EVOLUTION UPDATES --- */

.btn-summarize {
    background: linear-gradient(135deg, rgba(0, 255, 157, 0.2), rgba(255, 176, 32, 0.1)) !important;
    border-color: var(--accent-green) !important;
    color: #FFF !important;
    font-weight: 700 !important;
    text-shadow: 0 0 8px rgba(0, 255, 157, 0.5);
    box-shadow: 0 0 10px rgba(0, 255, 157, 0.1);
    width: 100%;
    flex: 0 0 100%;
}

.btn-summarize:hover {
    background: linear-gradient(135deg, rgba(0, 255, 157, 0.3), rgba(255, 176, 32, 0.2)) !important;
    box-shadow: 0 0 15px rgba(0, 255, 157, 0.3);
    transform: translateY(-1px);
}

.snippet-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.tag-chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #AAA;
    font-size: 13px;
    padding: 2px 6px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}

.tag-chip:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #FFF;
}

.tag-close {
    cursor: pointer;
    font-size: 13px;
    color: #666;
}

.tag-close:hover {
    color: #ff4444;
}

.tag-add-input {
    background: transparent;
    border: 1px dashed rgba(255, 255, 255, 0.15);
    color: #666;
    font-size: 13px;
    padding: 2px 6px;
    border-radius: 4px;
    width: 45px;
    outline: none;
    transition: all 0.2s;
}

.tag-add-input:focus {
    width: 80px;
    border-color: var(--accent-green);
    color: #FFF;
    background: rgba(0, 255, 157, 0.05);
}

.tag-add-input::placeholder {
    color: #444;
}

/* --- EXECUTION DASHBOARD (Billing & Telemetry) --- */
.execution-dashboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    margin-bottom: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.dash-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dash-panel:last-child {
    grid-column: span 2;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 10px;
}

.dash-panel.mission-card-panel,
.dash-panel.contribution-panel {
    grid-column: span 2;
}

.dash-panel.mission-card-panel {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 10px;
}

.dash-panel.contribution-panel {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 10px;
}

.dash-panel-header {
    font-size: 0.65rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.dash-metrics {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dash-metric {
    display: flex;
    flex-direction: column;
}

.dm-label {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.3);
}

.dm-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    color: #fff;
}

.dash-mini-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
}

.text-accent {
    color: var(--accent-blue, #00f2ff);
}

.text-gold {
    color: var(--accent-gold, #ffb020);
}

.mission-card-shell {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: linear-gradient(180deg, rgba(17, 17, 17, 0.95), rgba(10, 10, 10, 0.98));
}

.mission-card-empty {
    font-size: 0.72rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.45);
}

.mission-card-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
}

.mission-card-title {
    font-family: var(--font-head);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: #fff;
}

.mission-card-badge {
    flex: 0 0 auto;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid rgba(245, 168, 0, 0.2);
    background: rgba(245, 168, 0, 0.08);
    color: var(--accent-gold, #ffb020);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.mission-card-summary {
    font-size: 0.8rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.82);
}

.mission-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.mission-card-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.02);
}

.mission-card-field.full-width {
    grid-column: 1 / -1;
}

.mission-card-label {
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.35);
}

.mission-card-value {
    font-size: 0.77rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.85);
}

.mission-card-track-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.mission-card-track {
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid rgba(0, 255, 157, 0.15);
    background: rgba(0, 255, 157, 0.06);
    color: rgba(220, 255, 242, 0.92);
    font-size: 0.62rem;
    letter-spacing: 0.04em;
}

@media (max-width: 768px) {
    .mission-card-grid {
        grid-template-columns: 1fr;
    }
}

/* Contribution Bars */
.contribution-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}

.contribution-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.contrib-name {
    width: 80px;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contrib-bar-wrap {
    flex-grow: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.contrib-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #00f2ff, #0066ff);
    width: 0%;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 8px rgba(0, 242, 255, 0.3);
}

.contrib-score {
    width: 30px;
    font-size: 0.65rem;
    font-family: 'JetBrains Mono', monospace;
    color: rgba(255, 255, 255, 0.5);
    text-align: right;
}

.empty-contribution {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.2);
    font-style: italic;
    text-align: center;
    padding: 10px 0;
}

/* --- TACTICAL BILLING LEDGER --- */

.billing-nav-btn {
    background: rgba(255, 176, 32, 0.1);
    border: 1px solid rgba(255, 176, 32, 0.3);
    color: #FFB020;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
    margin-left: 10px;
}

.billing-nav-btn:hover {
    background: rgba(255, 176, 32, 0.2);
    box-shadow: 0 0 10px rgba(255, 176, 32, 0.2);
}

.billing-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.billing-modal {
    width: 900px;
    max-width: 95vw;
    max-height: 85vh;
    background: #0d0d0d;
    border: 1px solid #FFB02040;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.billing-modal-header {
    background: rgba(255, 176, 32, 0.05);
    padding: 20px;
    border-bottom: 1px solid #FFB02030;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.billing-modal-title {
    font-family: var(--font-head);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #FFB020;
}

.billing-modal-subtitle {
    font-size: 11px;
    color: #888;
    margin-top: 4px;
    letter-spacing: 0.5px;
}

.billing-close-btn {
    background: transparent;
    border: none;
    color: #888;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.billing-close-btn:hover {
    color: #fff;
}

.billing-modal-grid {
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    overflow-y: auto;
}

.billing-summary {
    grid-column: span 2;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed #FFB02040;
    padding: 24px;
    text-align: center;
}

.billing-panel {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
}

.panel-tag {
    font-size: 10px;
    color: #FFB020;
    font-weight: 700;
    margin-bottom: 15px;
    opacity: 0.8;
}

.total-cost-display {
    font-family: 'JetBrains Mono', monospace;
    font-size: 48px;
    font-weight: 700;
    color: #FFB020;
    text-shadow: 0 0 20px rgba(255, 176, 32, 0.4);
}

.cost-disclaimer {
    font-size: 11px;
    color: #666;
    margin-top: 10px;
}

.daily-chart-container, .provider-chart-container {
    height: 180px;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding-bottom: 10px;
}

.billing-bar-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.billing-bar {
    width: 100%;
    background: #FFB020;
    border-radius: 4px 4px 0 0;
    position: relative;
    transition: height 1s cubic-bezier(0.16, 1, 0.3, 1);
    min-height: 2px;
}

.billing-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0), rgba(255,255,255,0.2));
}

.bar-label {
    font-size: 9px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    text-align: center;
}

.bar-value {
    font-size: 9px;
    color: #FFB020;
    font-weight: 600;
    margin-bottom: 4px;
}

/* === EXECUTION DASHBOARD — RESPONSIVE SCALING === */

/* 1440px and below: shrink dashboard, hide Mission Card */
@media (max-width: 1440px) {
    .execution-dashboard {
        max-height: 200px;
    }
    .dash-panel.mission-card-panel {
        display: none;
    }
}

/* 1366px and below (common laptop): tighten further, hide Contribution too */
@media (max-width: 1366px) {
    .execution-dashboard {
        max-height: 160px;
    }
    .dash-panel.mission-card-panel,
    .dash-panel.contribution-panel {
        display: none;
    }
}

/* Short viewport (≤800px height): minimize dashboard height, show only Cost Matrix + Telemetry */
@media (max-height: 800px) {
    .execution-dashboard {
        max-height: 120px;
    }
    .dash-panel.mission-card-panel,
    .dash-panel.contribution-panel {
        display: none;
    }
}
