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

:root {
    --accent: #1a1a2e;
    --accent-hover: #2a2a4e;
}

body.brainstorm-active {
    --accent: #0d7377;
    --accent-hover: #0a5c5f;
}
body.peers-active {
    --accent: var(--peers-accent, #8e44ad);
    --accent-hover: var(--peers-accent-hover, #732d91);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f8f9fa;
    color: #1a1a1a;
}

/* Header */
header {
    padding: 12px 24px;
    background: #1a1a2e;
    color: #fff;
    display: flex;
    align-items: baseline;
    gap: 12px;
    position: relative;
    z-index: 150;
}
header h1 { font-size: 20px; font-weight: 600; }
header .subtitle { font-size: 14px; color: #8b8fa3; margin-right: auto; }

/* Sidebar toggle (hamburger) */
.sidebar-toggle {
    font-size: 18px;
    cursor: pointer;
    background: transparent;
    border: none;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: inherit;
    line-height: 1;
}
.sidebar-toggle:hover { background: rgba(255,255,255,0.1); }

/* User dropdown menu */
.user-menu {
    position: relative;
    margin-left: auto;
}
.user-menu-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    transition: background 0.15s;
}
.user-menu-toggle:hover { background: rgba(255,255,255,0.1); }
.user-display-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.caret { font-size: 10px; opacity: 0.7; }
.user-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 200px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    z-index: 200;
    padding: 8px 0;
}
.user-dropdown.open { display: block; }
.user-email {
    padding: 8px 16px;
    font-size: 12px;
    color: #888;
    border-bottom: 1px solid #f0f0f0;
}
.logout-btn {
    display: block;
    width: 100%;
    padding: 8px 16px;
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
    color: #444;
    transition: background 0.15s;
}
.logout-btn:hover { background: #f5f5f5; }

/* Tab bar */
.tab-bar {
    display: flex;
    gap: 0;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    padding: 0 24px;
    flex-shrink: 0;
}
.tab {
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
    color: #888;
    transition: color 0.15s, border-color 0.15s;
}
.tab:hover {
    color: #555;
}
.tab.active {
    color: var(--accent);
    font-weight: 600;
    border-bottom-color: var(--accent);
}
.tab-contrast {
    background: #2c3e50;
    color: #fff;
    border-radius: 4px;
    margin: 4px 0;
    font-weight: 600;
    letter-spacing: 0.5px;
    font-size: 11px;
}
.tab-contrast:hover {
    color: #e0e0e0;
}
.tab-contrast.active {
    background: #1a252f;
    color: #fff;
    border-bottom-color: transparent;
}
.tab-badge {
    display: inline-block;
    padding: 1px 6px;
    background: #fff3cd;
    color: #856404;
    font-size: 10px;
    font-weight: 600;
    border-radius: 4px;
    vertical-align: middle;
    margin-left: 4px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

/* Demo banner */
.demo-banner {
    background: #fff3cd;
    color: #664d03;
    border-bottom: 1px solid #ffecb5;
    padding: 8px 16px;
    font-size: 0.85rem;
    text-align: center;
}

/* Phase stepper (brainstorm mode only) */
.phase-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 10px 24px;
    background: #f0f7f7;
    border-bottom: 1px solid #d4e8e8;
}
.phase-step {
    display: flex;
    align-items: center;
    gap: 6px;
}
.phase-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid #b0c4c4;
    background: transparent;
    transition: all 0.3s;
}
.phase-step.active .phase-dot {
    background: var(--accent);
    border-color: var(--accent);
}
.phase-step.completed .phase-dot {
    background: var(--accent);
    border-color: var(--accent);
}
.phase-label {
    font-size: 12px;
    color: #999;
    font-weight: 400;
    transition: all 0.3s;
}
.phase-step.active .phase-label {
    color: var(--accent);
    font-weight: 600;
}
.phase-step.completed .phase-label {
    color: var(--accent);
    font-weight: 500;
}
.phase-connector {
    width: 40px;
    height: 2px;
    background: #d0d0d0;
    margin: 0 8px;
}

/* Suggestion chip groups (per tab) */
.suggestions-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-width: 440px;
    width: 100%;
    justify-content: center;
}

/* App body — horizontal layout below header */
.app-body {
    flex: 1;
    display: flex;
    overflow: hidden;
    max-width: 1440px;
    margin: 0 auto;
    width: 100%;
}

.app-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

/* ═══ Chat/Canvas Split Layout ═══ */

.chat-panel {
    flex: 40;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e0e0e0;
    min-width: 0;
    background: #f8f9fa;
}

.canvas-panel {
    flex: 60;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: #f4f5f7;
    position: relative;
    overflow-y: auto;
}

.canvas-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.canvas-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 14px;
    font-style: italic;
}

/* Canvas card — the container for each tool output */
.canvas-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    animation: canvasCardIn 0.25s ease;
}

.canvas-card h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 14px;
}

.canvas-card .canvas-meta {
    font-size: 11px;
    color: #999;
    margin-top: 14px;
}

.canvas-card table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.canvas-card th {
    text-align: left;
    padding: 8px 10px 8px 0;
    color: #888;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    border-bottom: 1px solid #e0e0e0;
}

.canvas-card th:not(:first-child) { text-align: right; }

.canvas-card td {
    padding: 9px 10px 9px 0;
    border-bottom: 1px solid #f0f0f0;
}

.canvas-card td:not(:first-child) { text-align: right; }

.canvas-card tr.hl td {
    color: #1a1a2e;
    font-weight: 600;
}

.canvas-card .stats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 14px;
}

.canvas-card .stat .val {
    font-size: 22px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 2px;
}

.canvas-card .stat .lbl {
    font-size: 11px;
    color: #888;
}

.canvas-card .profile-info {
    margin-top: 14px;
    font-size: 12px;
    color: #888;
}

/* Canvas card sections */
.canvas-card .section-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
    margin-bottom: 8px;
}

.canvas-card .info-line {
    font-size: 13px;
    color: #888;
    margin-bottom: 2px;
}

/* Not-reported card (dashed border, muted) */
.canvas-card.not-reported {
    background: #fafafa;
    border-style: dashed;
}

.canvas-card.not-reported .section-label {
    color: #bbb;
}

.canvas-card.not-reported p {
    font-size: 13px;
    color: #aaa;
}

/* Status/traffic-light cards */
.canvas-card .status-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}

.canvas-card .status-indicator.green { background: #22c55e; }
.canvas-card .status-indicator.yellow { background: #f59e0b; }
.canvas-card .status-indicator.red { background: #ef4444; }

/* Single-value card */
.canvas-card .single-value {
    font-size: 28px;
    font-weight: 600;
    color: #1a1a2e;
}

.canvas-card .single-value-label {
    font-size: 13px;
    color: #888;
    margin-top: 4px;
}

.canvas-divider {
    border: none;
    border-top: 1px solid #e8e8e8;
    margin: 0;
}

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

/* Sidebar strip (collapsed, 6px) */
.sidebar-strip {
    width: 6px;
    flex-shrink: 0;
    background: #eef0f4;
    border-right: 1px solid #e0e0e0;
    padding-top: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.sidebar-dot {
    width: 4px;
    height: 24px;
    background: #ccc;
    border-radius: 2px;
    transition: background 0.15s;
}
.sidebar-dot.active {
    background: var(--accent);
}

/* Sidebar overlay (expanded, 240px) */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 90px; /* header + tab bar height */
    left: 0;
    bottom: 0;
    width: 240px;
    background: #f5f6f8;
    border-right: 1px solid #e0e0e0;
    box-shadow: 4px 0 16px rgba(0,0,0,0.1);
    z-index: 150;
    padding: 12px;
    flex-direction: column;
    overflow-y: auto;
}
.sidebar-overlay.open {
    display: flex;
}

.sidebar-section-header {
    font-size: 10px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    padding-left: 4px;
}

.inquiry-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
}

/* Inquiry list item */
.inquiry-item {
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.1s;
}
.inquiry-item:hover {
    background: #eef0f4;
}
.inquiry-item.active {
    background: #fff;
    border: 1px solid #d0d5e0;
    border-left: 3px solid var(--accent);
}

.inquiry-title {
    font-size: 12px;
    color: #444;
    margin-bottom: 2px;
}
.inquiry-item.active .inquiry-title {
    font-weight: 600;
    color: var(--accent);
}

.inquiry-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.inquiry-time {
    font-size: 10px;
    color: #999;
}
.inquiry-status {
    font-size: 10px;
    color: #4a9eff;
}

.inquiry-preview {
    font-size: 10px;
    color: #888;
    margin-top: 4px;
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Inline rename input */
.inquiry-title-input {
    font-size: 12px;
    font-weight: 600;
    color: #1a1a2e;
    font-family: inherit;
    border: 1px solid #d0d5e0;
    border-radius: 4px;
    padding: 2px 4px;
    width: 100%;
    outline: none;
}
.inquiry-title-input:focus {
    border-color: #4a9eff;
}

.sidebar-empty {
    padding: 24px 8px;
    color: #bbb;
    font-size: 11px;
    text-align: center;
    line-height: 1.5;
}
/* Hide empty message when inquiry list has items */
.inquiry-list:not(:empty) + .sidebar-empty {
    display: none;
}

.sidebar-hint {
    margin-top: auto;
    padding: 8px;
    font-size: 10px;
    color: #bbb;
    text-align: center;
    border-top: 1px solid #e8e8e8;
}

/* Chat dimmer (behind sidebar overlay) */
.chat-dimmer {
    display: none;
    position: fixed;
    top: 90px; /* header + tab bar height */
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.15);
    z-index: 140;
}
.chat-dimmer.active {
    display: block;
}

/* Main chat area */
main {
    flex: 1;
    overflow-y: auto;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
}

#messages {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

/* Welcome / empty state */
.welcome {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.welcome.hidden {
    display: none;
}
.welcome-icon {
    font-size: 28px;
    margin-bottom: 8px;
}
.welcome-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 4px;
}
.welcome-subtitle {
    font-size: 13px;
    color: #888;
    margin-bottom: 24px;
}

/* Messages */
.message {
    padding: 14px 18px;
    border-radius: 8px;
    max-width: 100%;
    line-height: 1.7;
    font-size: 14px;
}
.message.user {
    background: var(--accent);
    color: #fff;
    align-self: flex-end;
    max-width: 85%;
}
.message.assistant {
    background: #fff;
    border: 1px solid #e0e0e0;
    align-self: flex-start;
}
.message.assistant table {
    border-collapse: collapse;
    width: 100%;
    margin: 8px 0;
    font-size: 14px;
}
.message.assistant th,
.message.assistant td {
    border: 1px solid #e0e0e0;
    padding: 6px 10px;
    text-align: left;
}
.message.assistant th { background: #f5f5f5; font-weight: 600; }

/* Assistant message markdown typography */
.message.assistant p {
    margin: 0 0 8px 0;
}
.message.assistant p:last-child { margin-bottom: 0; }

.message.assistant ul, .message.assistant ol {
    margin: 6px 0 8px 0;
    padding-left: 20px;
}
.message.assistant li {
    margin-bottom: 4px;
    line-height: 1.5;
}
.message.assistant li:last-child { margin-bottom: 0; }

.message.assistant h3, .message.assistant h4 {
    font-size: 13px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 12px 0 6px 0;
}
.message.assistant h3:first-child, .message.assistant h4:first-child { margin-top: 0; }

.message.assistant code {
    background: #f5f5f5;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 13px;
}
.message.assistant blockquote {
    border-left: 3px solid #e0e0e0;
    margin: 8px 0;
    padding: 4px 12px;
    color: #666;
}
.message.assistant hr {
    border: none;
    border-top: 1px solid #e8e8e8;
    margin: 10px 0;
}

/* Data vintage line (e.g., "Data: IPEDS 2022-23 collection year.") */
.message.assistant .data-vintage {
    font-size: 12px;
    color: #999;
    margin: 10px 0 4px 0;
}

/* Suggestion section */
.message.assistant .suggestions-heading {
    font-size: 12px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 12px 0 8px 0;
}

.message.assistant .suggestion-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.message.assistant .suggestion-list li {
    margin: 0;
}

.message.assistant .suggestion-btn {
    display: block;
    width: 100%;
    text-align: left;
    background: #f5f7fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    font-family: inherit;
    line-height: 1.4;
}

.message.assistant .suggestion-btn:hover {
    background: #edf0f5;
    border-color: #c0c8d4;
}

.message.assistant .suggestion-btn.capstone {
    background: #1a1a2e;
    color: #fff;
    border-color: #1a1a2e;
    font-weight: 600;
}

.message.assistant .suggestion-btn.capstone:hover {
    background: #2a2a4e;
    border-color: #2a2a4e;
}

/* ═══ Tour Guide Callouts ═══ */

.message.guide {
    align-self: stretch;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin: 10px 0;
    max-width: 100%;
    background: none;
    border: none;
    padding: 0;
}

.guide-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, #e0f0e6, #d0e8d8);
    border: 1.5px solid #6a7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #3a7050;
    margin-top: 2px;
}

.guide-body {
    flex: 1;
    background: #f0f7f2;
    border: 1px solid #d0e0d4;
    border-radius: 10px;
    padding: 10px 14px;
}

.guide-body .beat-label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #3a7050;
    font-weight: 600;
    margin-bottom: 4px;
}

.guide-body p {
    font-size: 12px;
    color: #5a7a60;
    line-height: 1.5;
    margin: 0;
}

.message a.bundle-link {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 12px;
    background: #e8f4fd;
    border: 1px solid #b3d9f2;
    border-radius: 4px;
    color: #1a6ba0;
    text-decoration: none;
    font-size: 13px;
}
.message a.bundle-link:hover { background: #d0ebf7; }

/* Suggestion chips */
.chip {
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #d0d0d0;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    color: #444;
    transition: all 0.15s;
}
.chip:hover { background: #e8f4fd; border-color: #b3d9f2; }

.typing-indicator {
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    align-self: flex-start;
    color: #888;
    font-style: italic;
}

/* Footer / input */
footer {
    padding: 16px 24px;
    background: #fff;
    border-top: 1px solid #e0e0e0;
}
#input-form {
    display: flex;
    gap: 8px;
    max-width: 800px;
    margin: 0 auto;
}
#user-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    font-size: 15px;
    outline: none;
}
#user-input:focus { border-color: #1a6ba0; }
#send-btn {
    padding: 10px 20px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
}
#send-btn:hover { background: var(--accent-hover); }
#send-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Action bar */
.action-wrapper {
    max-width: 800px;
    width: 100%;
    margin: -8px auto 16px;
}

.action-bar {
    display: flex;
    gap: 6px;
    padding: 8px 12px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 8px 8px;
}

.action-btn {
    padding: 6px 14px;
    background: #fff;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #444;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 4px;
}
.action-btn:hover:not(:disabled) { background: #e8f4fd; border-color: #b3d9f2; }
.action-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.action-btn.done { background: #e8f8e8; border-color: #a3d9a3; color: #2a7a2a; }
.btn-icon { font-size: 14px; }

.spinner {
    display: inline-block;
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.file-tree {
    padding: 10px 14px;
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    font-size: 13px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
}
.tree-header {
    font-weight: 600;
    margin-bottom: 6px;
    color: #1a1a2e;
}
.tree-file {
    padding: 2px 0 2px 16px;
    color: #555;
}
.tree-file::before {
    content: "\251C\2500\2500 ";
    color: #999;
}
.tree-file:last-of-type::before {
    content: "\2514\2500\2500 ";
}
.file-size {
    color: #999;
    font-size: 11px;
    margin-left: 8px;
}
.tree-link {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 12px;
    background: #e8f4fd;
    border: 1px solid #b3d9f2;
    border-radius: 4px;
    color: #1a6ba0;
    text-decoration: none;
    font-size: 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.tree-link:hover { background: #d0ebf7; }

.action-error {
    padding: 4px 10px;
    color: #c00;
    font-size: 12px;
}

/* Usage info */
.usage-info {
    max-width: 800px;
    width: 100%;
    margin: -8px auto 4px;
    padding: 2px 16px;
    font-size: 11px;
    color: #999;
    text-align: right;
}

.bundle-cost {
    margin-left: auto;
    font-size: 11px;
    color: #999;
    padding: 4px 8px;
}

/* Release notes panel (admin only) — small widget pinned inside canvas */
#release-notes {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 220px;
    max-height: 300px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 14px 16px;
    font-size: 13px;
    z-index: 10;
    opacity: 0.85;
    transition: opacity 0.15s;
}
#release-notes:hover {
    opacity: 1;
}
.rn-release-divider {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e0e0e0;
}
.rn-header {
    font-weight: 700;
    font-size: 15px;
    color: #1a1a2e;
    margin-bottom: 2px;
}
.rn-date {
    font-size: 11px;
    color: #999;
    margin-bottom: 10px;
}
.rn-changes {
    list-style: none;
    padding: 0;
}
.rn-changes li {
    padding: 3px 0;
    border-top: 1px solid #f0f0f0;
    font-size: 12px;
    color: #555;
    line-height: 1.4;
}
.rn-changes li:first-child {
    border-top: none;
}
.rn-model {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
    font-size: 11px;
    color: #999;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
}

/* Artifact panel (futures mode) */
.artifact-panel {
    width: 420px;
    flex-shrink: 0;
    background: #faf8f5;
    border-left: 1px solid #e8e4df;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.artifact-panel-header {
    padding: 12px 16px;
    border-bottom: 1px solid #e8e4df;
    background: #f5f1ec;
}

.artifact-panel-title {
    font-size: 13px;
    font-weight: 600;
    color: #92400e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.artifact-content {
    flex: 1;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Artifact cards */
.artifact-card {
    background: #fff;
    border: 1px solid #e8e4df;
    border-radius: 8px;
    padding: 14px 16px;
    font-size: 13px;
    line-height: 1.5;
}

.artifact-card-header {
    font-size: 11px;
    font-weight: 600;
    color: #b45309;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 8px;
}

.artifact-card-title {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.artifact-card-body {
    color: #555;
}

/* Belief card (worldview phase) */
.belief-card {
    border-left: 3px solid #b45309;
}

.belief-confidence {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    margin-left: 8px;
}

.belief-confidence.high { background: #dcfce7; color: #166534; }
.belief-confidence.medium { background: #fef3c7; color: #92400e; }
.belief-confidence.low { background: #fee2e2; color: #991b1b; }

/* Data card (ground truth phase) */
.data-card {
    border-left: 3px solid #0d7377;
}

.data-card.contradicts {
    border-left-color: #b45309;
    background: #fffbeb;
}

.data-card-metric {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 4px 0;
}

.data-card-source {
    font-size: 10px;
    color: #999;
}

/* Scenario card (futures phase) */
.scenario-card {
    cursor: pointer;
    transition: box-shadow 0.15s;
}

.scenario-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.scenario-card.expanded .scenario-card-detail {
    display: block;
}

.scenario-card-detail {
    display: none;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
    font-size: 12px;
    color: #666;
}

/* Scenario matrix (2x2) */
.scenario-matrix {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.scenario-matrix-cell {
    padding: 10px;
    background: #fff;
    border: 1px solid #e8e4df;
    border-radius: 6px;
    font-size: 12px;
    text-align: center;
}

.scenario-matrix-cell.active {
    border-color: #b45309;
    background: #fffbeb;
}

.scenario-matrix-label {
    font-size: 10px;
    color: #999;
    text-align: center;
    padding: 4px;
}

/* Integration matrix (belief x scenario) */
.integration-matrix {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}

.integration-matrix th {
    background: #f5f1ec;
    padding: 6px 8px;
    text-align: left;
    font-weight: 600;
    color: #92400e;
    border: 1px solid #e8e4df;
}

.integration-matrix td {
    padding: 6px 8px;
    border: 1px solid #e8e4df;
}

.integration-matrix .holds { background: #dcfce7; color: #166534; }
.integration-matrix .challenged { background: #fee2e2; color: #991b1b; }
.integration-matrix .irrelevant { background: #f5f5f5; color: #999; }

/* Specialist status indicators */
.specialist-status {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.specialist-badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    background: #f0f0f0;
    color: #888;
}

.specialist-badge.running {
    background: #fef3c7;
    color: #92400e;
}

.specialist-badge.done {
    background: #dcfce7;
    color: #166534;
}

/* Demo account styles */
.demo-badge {
    background: #b45309;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    vertical-align: middle;
}

.tour-cta {
    font-size: 12px;
    color: #92400e;
    font-style: italic;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f0ebe4;
}

.budget-indicator {
    font-size: 11px;
    color: #666;
    text-align: center;
    padding: 4px;
}

.budget-indicator.warning {
    color: #b45309;
    display: block !important;
}

.budget-indicator.exhausted {
    color: #dc2626;
    font-weight: 600;
    display: block !important;
}

.message.budget-exceeded {
    border-left: 3px solid #b45309;
    background: #fffbeb;
}

/* Demo admin panel */
.demo-admin-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    max-height: 80vh;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
}

.demo-admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.demo-admin-header h3 {
    margin: 0;
    font-size: 16px;
    color: #1a1a1a;
}

.demo-admin-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
}

.demo-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.demo-row-info strong {
    display: block;
    font-size: 13px;
}

.demo-row-meta {
    font-size: 11px;
    color: #888;
}

.demo-row-actions {
    display: flex;
    gap: 6px;
}

.demo-action-btn {
    padding: 4px 10px;
    font-size: 11px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
}

.demo-action-btn:hover {
    background: #f5f5f5;
}

.demo-action-delete {
    color: #dc2626;
    border-color: #fca5a5;
}

.demo-action-preview {
    color: #2563eb;
    border-color: #93c5fd;
}

.demo-admin-actions {
    margin-top: 12px;
}

.demo-admin-btn {
    padding: 8px 16px;
    background: var(--accent, #1e3a5f);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

.demo-admin-btn:hover {
    opacity: 0.9;
}

.demo-admin-btn-secondary {
    padding: 8px 16px;
    background: #fff;
    color: #666;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

.demo-admin-btn-sm {
    padding: 4px 12px;
    font-size: 12px;
    background: var(--accent, #1e3a5f);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.demo-create-form {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #eee;
}

.demo-create-form h4 {
    margin: 0 0 12px;
    font-size: 14px;
}

.demo-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    margin-bottom: 8px;
    box-sizing: border-box;
}

.demo-input-sm {
    width: 80px;
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

.demo-institution-search {
    position: relative;
    margin-bottom: 8px;
}

.demo-institution-search .demo-input {
    width: 100%;
    margin-bottom: 0;
}

.demo-inst-ac {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1001;
    display: none;
}

.demo-inst-ac-item {
    padding: 8px 10px;
    cursor: pointer;
    font-size: 13px;
}

.demo-inst-ac-item:hover {
    background: #f0f0f0;
}

.demo-inst-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
    min-height: 20px;
}

.institution-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: #f0ebe4;
    border-radius: 12px;
    font-size: 12px;
    color: #92400e;
}

.institution-chip button {
    background: none;
    border: none;
    cursor: pointer;
    color: #92400e;
    font-size: 14px;
    padding: 0;
    line-height: 1;
}

.demo-peer-list {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 8px;
}

.demo-form-row {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 12px;
    font-size: 13px;
}

.demo-form-actions {
    display: flex;
    gap: 8px;
}

.demo-empty {
    color: #888;
    font-size: 13px;
    text-align: center;
    padding: 20px;
}

@media (max-width: 899px) {
    .app-body {
        flex-direction: column;
    }
    .chat-panel {
        flex: 1;
        border-right: none;
    }
    .canvas-panel {
        display: none;
    }
    .artifact-panel {
        display: none !important;
    }
}

/* ═══ Board Report Card ═══ */

.report-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
}

.report-header {
    background: #1a1a2e;
    color: #fff;
    padding: 28px 32px 22px;
}

.report-header h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
}

.report-header .report-subtitle {
    font-size: 13px;
    color: #a0a4b8;
    font-weight: 400;
}

.report-header .download-row {
    margin-top: 14px;
    display: flex;
    gap: 10px;
}

.report-header .download-btn {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    font-family: inherit;
}

.report-header .download-btn:hover {
    background: rgba(255,255,255,0.25);
}

.report-body {
    padding: 28px 32px;
}

.report-section {
    margin-bottom: 28px;
}

.report-section:last-child {
    margin-bottom: 0;
}

.report-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #1a1a2e;
    border-bottom: 2px solid #1a1a2e;
    padding-bottom: 6px;
    margin-bottom: 14px;
}

.report-section p {
    font-size: 14px;
    line-height: 1.75;
    margin-bottom: 10px;
    color: #444;
}

.report-section p:last-child {
    margin-bottom: 0;
}

.report-cite {
    color: #999;
    font-size: 11px;
    font-family: 'SF Mono', 'Menlo', monospace;
}

/* Report stat grid */
.report-stats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin: 16px 0;
    padding: 16px;
    background: #f8f9fb;
    border-radius: 8px;
}

.report-stat .val {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a2e;
}

.report-stat .lbl {
    font-size: 11px;
    color: #888;
    margin-top: 2px;
}

.report-stat .ctx {
    font-size: 11px;
    color: #aaa;
    margin-top: 1px;
}

/* Report chart area */
.report-chart {
    background: #f8f9fb;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 16px;
    margin: 12px 0;
}

.report-chart-title {
    font-size: 11px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.report-bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.report-bar-row:last-child {
    margin-bottom: 0;
}

.report-bar-label {
    font-size: 12px;
    color: #666;
    width: 110px;
    text-align: right;
    flex-shrink: 0;
}

.report-bar-track {
    flex: 1;
    height: 18px;
    background: #e8eaef;
    border-radius: 4px;
    overflow: hidden;
}

.report-bar-fill {
    height: 100%;
    background: #3b5998;
    border-radius: 4px;
}

.report-bar-fill.hl {
    background: #1a1a2e;
}

.report-bar-fill.alt {
    background: #e8734a;
}

.report-bar-fill.muted {
    background: #ccc;
}

.report-bar-val {
    font-size: 12px;
    color: #666;
    width: 50px;
}

/* Report comparison table */
.report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin: 12px 0;
}

.report-table th {
    text-align: left;
    padding: 8px 10px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    color: #888;
    border-bottom: 1px solid #e0e0e0;
}

.report-table th:not(:first-child) {
    text-align: right;
}

.report-table td {
    padding: 9px 10px;
    border-bottom: 1px solid #f0f0f0;
    color: #444;
}

.report-table td:not(:first-child) {
    text-align: right;
}

.report-table tr.hl td {
    font-weight: 600;
    color: #1a1a2e;
    background: #f8f9fb;
}

/* Report divider */
.report-divider {
    border: none;
    border-top: 1px solid #eee;
    margin: 24px 0;
}

/* Report data note / methodology callout */
.report-note {
    font-size: 12px;
    color: #888;
    line-height: 1.6;
    padding: 10px 14px;
    background: #fafafa;
    border-left: 3px solid #ddd;
    border-radius: 0 6px 6px 0;
    margin: 12px 0;
}

/* Report footer */
.report-footer {
    padding: 16px 32px;
    border-top: 1px solid #eee;
    font-size: 11px;
    color: #999;
}

/* Report card wrapper — remove default canvas-card padding/border since report-card has its own */
.canvas-card.report-card-wrapper {
    padding: 0;
    border: none;
    background: transparent;
}

/* --- Peer Groups Subtabs --- */
.peers-subtab-bar {
    display: flex;
    padding: 0 16px;
    background: #f0f0f0;
    border-bottom: 1px solid #ddd;
}
.peers-subtab {
    padding: 8px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    color: #666;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}
.peers-subtab:hover {
    color: #333;
}
.peers-subtab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    font-weight: 600;
}

/* --- Peer Groups Grid View --- */
.peer-groups-view {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}
.peer-groups-header {
    margin-bottom: 20px;
}
.peer-groups-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
}
.peer-groups-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
.peer-group-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.peer-group-card:hover {
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.peer-group-card-name {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
}
.peer-group-card-context {
    font-size: 12px;
    color: #888;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.peer-group-card-members {
    font-size: 12px;
    color: #555;
    line-height: 1.5;
}
.peer-group-card-members .more {
    color: #888;
    font-style: italic;
}
.peer-group-card-meta {
    margin-top: 8px;
    font-size: 11px;
    color: #aaa;
    display: flex;
    justify-content: space-between;
}

/* --- Empty State --- */
.peer-groups-empty {
    text-align: center;
    padding: 60px 20px;
    color: #888;
}
.peer-groups-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}
.peer-groups-empty-hint {
    font-size: 13px;
    color: #aaa;
    margin-top: 8px;
}

/* --- Detail/Edit View --- */
.peer-group-detail {
    max-width: 600px;
    margin: 0 auto;
}
.peer-group-detail-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 0;
    margin-bottom: 12px;
    font-size: 13px;
    color: #666;
    background: none;
    border: none;
    cursor: pointer;
}
.peer-group-detail-back:hover {
    color: var(--accent);
}
.peer-group-detail-name {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
}
.peer-group-detail-name-input {
    font-size: 20px;
    font-weight: 600;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px 8px;
    width: 100%;
    margin-bottom: 4px;
}
.peer-group-detail-context {
    font-size: 13px;
    color: #666;
    margin-bottom: 16px;
}
.peer-group-detail-section {
    margin-bottom: 16px;
}
.peer-group-detail-section h3 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
    margin-bottom: 8px;
}
.peer-group-detail-member {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
}
.peer-group-detail-member:last-child {
    border-bottom: none;
}
.peer-group-detail-member-name {
    color: #1a1a1a;
}
.peer-group-detail-member-rationale {
    font-size: 11px;
    color: #888;
}
.peer-group-detail-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #eee;
}
.peer-group-detail-actions button {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
    transition: background 0.15s;
}
.peer-group-detail-actions button:hover {
    background: #f5f5f5;
}
.peer-group-detail-actions .primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.peer-group-detail-actions .primary:hover {
    opacity: 0.9;
}
.peer-group-detail-actions .danger {
    color: #c0392b;
    border-color: #e0b4b0;
}
.peer-group-detail-actions .danger:hover {
    background: #fdf0ef;
}
