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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #0f1117;
    color: #e0e0e0;
    height: 100vh;
    overflow: hidden;
}

main {
    height: 100vh;
}

/* Layout shell */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 1400px;
    margin: 0 auto;
}

.chat-header {
    padding: 16px 24px;
    border-bottom: 1px solid #1e2030;
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-header-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 600;
    color: #c0c0c0;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: color 0.15s;
}

.chat-header-logo:hover {
    color: #e0e0e0;
}

.chat-header-icon {
    width: 20px;
    height: 20px;
    color: #4ade80;
    flex-shrink: 0;
}

.environment-badge {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 4px;
    background: #1a3a2a;
    color: #4ade80;
    border: 1px solid #2a4a3a;
}

/* View toggle */
.view-toggle {
    margin-left: auto;
    display: flex;
    gap: 2px;
    background: #1e2030;
    border-radius: 8px;
    padding: 2px;
}

.view-toggle-btn {
    padding: 6px 16px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #8b8fa3;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.session-tokens {
    font-size: 11px;
    font-family: "SF Mono", "Fira Code", "Consolas", monospace;
    color: #555;
}

.view-toggle-btn:hover { color: #e0e0e0; }

.view-toggle-btn--active {
    background: #2563eb;
    color: #fff;
}

/* ═══════════════════════════════════════════════
   Dashboard view
   ═══════════════════════════════════════════════ */

.dashboard {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

.dashboard-updated {
    text-align: right;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.3px;
    color: #8b8fa3;
    margin-top: 32px;
}

.dashboard-updated-time {
    margin-bottom: 4px;
}

.dashboard-usage {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dashboard-usage li {
    line-height: 1.5;
}

.dashboard-loading {
    color: #8b8fa3;
    text-align: center;
    padding: 48px 0;
    font-size: 14px;
}

.dashboard-error {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 480px;
    margin: 48px auto;
    padding: 16px 20px;
    background: #2a1520;
    border: 1px solid #4a2030;
    border-radius: 12px;
}

.dashboard-error-title {
    font-size: 14px;
    font-weight: 600;
    color: #f87171;
}

.dashboard-error-detail {
    font-size: 13px;
    color: #d1d5db;
    font-family: "SF Mono", "Fira Code", "Consolas", monospace;
    word-break: break-all;
}

.dashboard-error-hint {
    font-size: 12px;
    color: #8b8fa3;
    font-style: italic;
}

.dashboard-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #f87171;
    margin-bottom: 8px;
}

.pulse--live {
    background: #f87171;
}

.dashboard-section-title--live {
    justify-content: space-between;
}

.dashboard-section-title-label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dashboard-section-title--history {
    color: #6b7280;
    margin-top: 4px;
    margin-bottom: 10px;
    justify-content: space-between;
}

.timeline-range-label {
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    font-family: "SF Mono", "Fira Code", "Consolas", monospace;
    font-size: 10px;
    color: #9ca3af;
}

.dashboard-section-title--attention {
    color: #facc15;
    margin-bottom: 8px;
    justify-content: space-between;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.dashboard-grid:last-child {
    margin-bottom: 0;
}

/* Card */
.dashboard-card {
    background: #1e2030;
    border: 1px solid #2a2d3e;
    border-left: 4px solid #6b7280;
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dashboard-card--healthy { border-left-color: #4ade80; }
.dashboard-card--degraded { border-left-color: #facc15; }
.dashboard-card--unhealthy { border-left-color: #f87171; }

.dashboard-card--clickable {
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.dashboard-card--clickable:hover {
    border-color: #555;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.dashboard-card--unhealthy {
    border-color: #7f1d1d;
    background: #1a1520;
    box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.15);
}

.dashboard-card--degraded {
    border-color: #713f12;
    background: #1a1a20;
    box-shadow: 0 0 0 1px rgba(250, 204, 21, 0.1);
}

.dashboard-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
}


.dashboard-card-name {
    font-size: 15px;
    font-weight: 600;
    color: #e0e0e0;
}

.dashboard-card-badge {
    margin-left: auto;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid #2a2d3e;
    color: #6b7280;
}

.dashboard-card-badge--healthy { color: #4ade80; border-color: #2a4a3a; background: rgba(74, 222, 128, 0.08); }
.dashboard-card-badge--degraded { color: #facc15; border-color: #4a4a2a; background: rgba(250, 204, 21, 0.08); }
.dashboard-card-badge--unhealthy { color: #f87171; border-color: #4a2a2a; background: rgba(248, 113, 113, 0.08); }


/* Alert callout — worst metric when not healthy */
.dashboard-card-alert {
    font-size: 13px;
    color: #f87171;
    padding: 6px 10px;
    background: rgba(248, 113, 113, 0.08);
    border-radius: 6px;
    border-left: 2px solid #f87171;
}

.dashboard-card--degraded .dashboard-card-alert {
    color: #facc15;
    background: rgba(250, 204, 21, 0.06);
    border-left-color: #facc15;
}

/* Per-source section */
.dashboard-card-source {
    border-top: 1px solid #2a2d3e;
    padding-top: 10px;
}

.dashboard-card-source-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #8b8fa3;
    margin-bottom: 6px;
}


.dashboard-card-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px 16px;
}

.dashboard-metric {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
}

.dashboard-metric-label { color: #6b7280; }

.dashboard-metric-value {
    font-family: "SF Mono", "Fira Code", "Consolas", monospace;
    color: #d1d5db;
    text-align: right;
}

/* Healthy apps — table layout */
.dashboard-healthy-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
}

.dashboard-healthy-table tr {
    background: #1e2030;
}

.dashboard-healthy-table td {
    padding: 10px 12px;
    border-top: 1px solid #2a2d3e;
    border-bottom: 1px solid #2a2d3e;
}


.dashboard-healthy-table td:first-child {
    border-left: 4px solid #4ade80;
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
    padding-left: 16px;
}

.dashboard-healthy-table tr.app-row--degraded td:first-child  { border-left-color: #facc15; }
.dashboard-healthy-table tr.app-row--unhealthy td:first-child { border-left-color: #f87171; }

.dashboard-healthy-table td:last-child {
    border-right: 1px solid #2a2d3e;
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
    padding-right: 16px;
}

.dashboard-slim-name {
    font-size: 14px;
    font-weight: 600;
    color: #e0e0e0;
    white-space: nowrap;
    position: relative;
}

.dashboard-healthy-table .dashboard-card-badge {
    margin-left: 0;
}

.dashboard-slim-timeline {
    width: 100%;
    padding: 0 16px 0 8px;
}

/* 7-day hourly health timeline */
.app-timeline {
    display: flex;
    direction: rtl; /* newest bar first in DOM renders on the right */
    gap: 6px;
    height: 44px;        /* 28px bars + 8px dot space above + 8px deploy marker space below */
    padding-top: 8px;
    padding-bottom: 8px;
    align-items: stretch;
    box-sizing: border-box;
}

.timeline-type-label {
    position: absolute;
    top: 4px;
    left: 16px;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.2);
    pointer-events: none;
}

.app-timeline--loading {
    background: repeating-linear-gradient(
        90deg,
        #1e2030 0px,
        #1e2030 3px,
        transparent 3px,
        transparent 4px
    );
    border-radius: 2px;
    opacity: 0.4;
}

.timeline-bar {
    flex: 1;
    min-width: 2px;
    border-radius: 4px;
    direction: ltr;
    position: relative;
    cursor: pointer;
    transition: opacity 0.1s, transform 0.1s;
}

.app-timeline:hover .timeline-bar:not(.timeline-bar--live) { opacity: 0.35 !important; transform: scaleY(0.85); }
.app-timeline .timeline-bar:hover:not(.timeline-bar--live) { opacity: 1 !important; transform: scaleY(1.1) !important; z-index: 1; }

/* Immediate CSS tooltip via data-tooltip attribute */
.timeline-bar::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #1a1d2e;
    border: 1px solid #2a2d3e;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 11px;
    line-height: 1.6;
    white-space: pre;
    z-index: 200;
    pointer-events: none;
    color: #e0e0e0;
    min-width: 160px;
    opacity: 0;
    transition: opacity 0.1s;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.timeline-bar:hover::after { opacity: 1; }

.timeline-bar--live {
    flex: 0 0 12px;
    border-radius: 3px;
    animation: live-bar-pulse 3.5s ease-in-out infinite;
    cursor: pointer;
}

@keyframes live-bar-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.35; }
}

.timeline-bar--healthy   { background: rgba(74, 222, 128, 0.55); }
.timeline-bar--degraded  { background: linear-gradient(to top, #92600a, #facc15); }
.timeline-bar--unhealthy { background: linear-gradient(to top, #9b1c1c, #f87171); }
.timeline-bar--no-data   { background: rgba(255, 255, 255, 0.1); }

/* Glowing dot above bars that have investigation reports */
.timeline-bar--has-report::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 6px 2px rgba(255, 255, 255, 0.4);
}

/* Blue glowing circle below bars that have deployments.
   Mirrors the white report dot above (::before) but uses a child span to
   avoid conflicting with the ::after tooltip pseudo-element on .timeline-bar. */
.deploy-marker {
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.95);
    box-shadow: 0 0 6px 2px rgba(59, 130, 246, 0.4);
    pointer-events: none;
}

.dashboard-no-data {
    font-size: 12px;
    color: #6b7280;
    font-style: italic;
}

/* Attention Required section */

.dashboard-attention-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 28px;
}


.dashboard-report-severity {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1px 6px;
    border-radius: 3px;
    flex-shrink: 0;
}

.dashboard-report-severity--critical { color: #f87171; background: rgba(248, 113, 113, 0.12); }
.dashboard-report-severity--warning  { color: #facc15; background: rgba(250, 204, 21, 0.10); }
.dashboard-report-severity--info     { color: #60a5fa; background: rgba(96, 165, 250, 0.10); }

.dashboard-report-trigger {
    font-size: 10px;
    color: #9ca3af;
    flex-shrink: 0;
}

.dashboard-report-app {
    font-size: 11px;
    color: #cbd5e1;
    flex-shrink: 0;
    min-width: 60px;
    text-align: left;
}

.dashboard-report {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    font-size: 12px;
    font-family: inherit;
    padding: 4px 8px;
    border-radius: 4px;
    border: none;
    background: rgba(248, 113, 113, 0.06);
    cursor: pointer;
    transition: background 0.15s;
}

.dashboard-report:hover {
    background: rgba(248, 113, 113, 0.12);
}

.dashboard-report--critical { border-left: 2px solid #f87171; }
.dashboard-report--warning  { border-left: 2px solid #facc15; }
.dashboard-report--info     { border-left: 2px solid #60a5fa; }

.dashboard-report--new { font-weight: 600; }
.dashboard-report--reviewed { opacity: 0.5; }

.report-badge {
    display: inline-block;
    font-size: 0.75em;
    border-radius: 4px;
    padding: 1px 7px;
    font-weight: 500;
    vertical-align: middle;
    margin-left: 6px;
}

.report-badge--trigger {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* Currently-active/ongoing incident (issue still Active in the registry, not just a fresh report). */
.report-badge--ongoing {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.dashboard-attention-empty {
    color: #6b7280;
    font-size: 0.9em;
    padding: 10px 4px 16px;
}

.dashboard-report-text { color: #d1d5db; flex: 1; text-align: left; }

.dashboard-report-wrapper {
    display: flex;
    flex-direction: column;
    margin-bottom: 2px;
}

.dashboard-report-main {
    display: contents;
    background: none;
    border: none;
    cursor: pointer;
    font: inherit;
    flex: 1;
}

.dashboard-report-expand {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 0 4px;
    font-size: 0.6rem;
    flex-shrink: 0;
    line-height: 1;
}

.dashboard-report-expand:hover {
    color: #d1d5db;
}

.dashboard-report-body {
    padding: 6px 10px 8px 10px;
    border-top: 1px solid rgba(255,255,255,0.06);
    font-size: 0.75rem;
    color: #94a3b8;
    margin-bottom: 2px;
}

.dashboard-report-body--text {
    white-space: pre-wrap;
    word-break: break-word;
    font-family: inherit;
    margin: 0;
    line-height: 1.5;
}

.dashboard-report-body--loading,
.dashboard-report-body--empty {
    font-style: italic;
    opacity: 0.6;
}

.dashboard-report-age {
    color: #9ca3af;
    font-size: 11px;
    flex-shrink: 0;
}

@media (max-width: 800px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* ═══════════════════════════════════════════════
   Timeline modal
   ═══════════════════════════════════════════════ */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal {
    background: #1e2030;
    border: 1px solid #2a2d3e;
    border-radius: 12px;
    min-width: 320px;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid #2a2d3e;
}

.modal-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.modal-title {
    font-size: 14px;
    font-weight: 600;
    color: #e0e0e0;
    white-space: nowrap;
}

.modal-subtitle {
    font-size: 12px;
    color: #6b7280;
    white-space: nowrap;
}

.modal-close {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    flex-shrink: 0;
    transition: color 0.15s;
}

.modal-close:hover { color: #e0e0e0; }

.modal-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.modal-deploys {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-bottom: 10px;
    border-bottom: 1px solid #2a2d3e;
    margin-bottom: 10px;
}

.modal-deploy-version {
    font-size: 12px;
    color: rgba(96, 165, 250, 0.9);
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: 4px;
    padding: 3px 8px;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}

.modal-deploy-version:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.5);
    color: rgba(147, 197, 253, 1);
}

.modal-report-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid #2a2d3e;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    transition: background 0.15s, border-color 0.15s;
}

.modal-report-item:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: #3a3d4e;
}

.modal-report-title {
    font-size: 13px;
    color: #d1d5db;
    flex: 1;
    min-width: 0;
}

.modal-status-btn {
    width: 100%;
    padding: 10px 16px;
    background: rgba(37, 99, 235, 0.1);
    border: 1px solid rgba(37, 99, 235, 0.3);
    border-radius: 8px;
    color: #93c5fd;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s;
}

.modal-status-btn:hover { background: rgba(37, 99, 235, 0.2); }

/* ═══════════════════════════════════════════════
   Chat view
   ═══════════════════════════════════════════════ */

/* Messages area */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 20px;
    padding: 24px;
}

.empty-state-intro {
    font-size: 14px;
    color: #8b8fa3;
}

.sample-questions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: 100%;
    max-width: 720px;
}

.sample-question-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 16px 18px;
    background: #1e2030;
    border: 1px solid #2a2d3e;
    border-radius: 12px;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s, border-color 0.15s;
    font-family: inherit;
    color: inherit;
    outline: none;
}

.sample-question-card--featured {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 20px 28px;
    background: #161a2e;
    border-color: #2d3a6e;
    text-align: center;
}

.sample-question-card--featured .sample-question-text {
    font-size: 15px;
    font-weight: 600;
    color: #93c5fd;
}

.sample-question-card--featured .sample-question-hint {
    font-size: 12px;
    color: #6b7280;
}

.sample-question-card--featured:hover {
    background: #1a1f38;
    border-color: #3b63c0;
}

.sample-question-card:hover {
    background: #1a1d2e;
    border-color: #2563eb;
}

.sample-question-card:focus-visible {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.35);
}

.sample-question-text {
    font-size: 14px;
    font-weight: 500;
    color: #e0e0e0;
    line-height: 1.4;
}

.sample-question-hint {
    font-size: 12px;
    color: #8b8fa3;
    line-height: 1.5;
}

@media (max-width: 600px) {
    .sample-questions-grid {
        grid-template-columns: 1fr;
    }
}

/* New Chat button */
.new-chat-btn {
    padding: 6px 14px;
    border: none;
    border-radius: 6px;
    background: #1e2030;
    color: #8b8fa3;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.new-chat-btn:hover {
    background: #2a2d3e;
    color: #e0e0e0;
}

/* Session history */
.session-history {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    max-width: 720px;
    margin-top: 24px;
    max-height: 260px;
    overflow-y: auto;
}

.session-history-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #8b8fa3;
    margin-bottom: 2px;
}

.session-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 14px;
    background: #1e2030;
    border: 1px solid #2a2d3e;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    transition: background 0.15s, border-color 0.15s;
}

.session-item:hover {
    background: #1a1d2e;
    border-color: #2563eb;
}

.session-item-title {
    font-size: 14px;
    font-weight: 500;
    color: #e0e0e0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.session-item-meta {
    font-size: 12px;
    color: #555;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Message bubbles */
.message {
    display: flex;
    max-width: 90%;
}

.message-user {
    align-self: flex-end;
}

.message-assistant {
    align-self: flex-start;
}

.message-tool {
    align-self: flex-start;
    max-width: 100%;
}

.message-tool .message-content {
    padding: 0;
    background: none;
}

.message-content {
    padding: 12px 16px;
    border-radius: 12px;
    line-height: 1.6;
    font-size: 14px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.message-user .message-content {
    background: #2563eb;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.message-assistant .message-content {
    background: #1e2030;
    color: #e0e0e0;
    border-bottom-left-radius: 4px;
}

.message-assistant .message-content h1,
.message-assistant .message-content h2,
.message-assistant .message-content h3 {
    color: #f0f0f0;
    margin: 16px 0 8px 0;
    line-height: 1.3;
}

.message-assistant .message-content h2 { font-size: 16px; }
.message-assistant .message-content h3 { font-size: 14px; }

.message-assistant .message-content p {
    margin: 6px 0;
}

.message-assistant .message-content ul,
.message-assistant .message-content ol {
    margin: 6px 0;
    padding-left: 20px;
}

.message-assistant .message-content hr {
    border: none;
    border-top: 1px solid #2a2d3e;
    margin: 12px 0;
}

.message-assistant .message-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 10px 0;
    font-size: 13px;
}

.message-assistant .message-content th,
.message-assistant .message-content td {
    border: 1px solid #2a2d3e;
    padding: 6px 10px;
    text-align: left;
}

.message-assistant .message-content th {
    background: #161822;
    color: #c0c0c0;
    font-weight: 600;
}

.message-assistant .message-content td {
    background: #1a1d2e;
}

.message-assistant .message-content strong {
    color: #f0f0f0;
}

.message-error {
    align-self: flex-start;
}

.message-error .message-content {
    background: #2a1520;
    border: 1px solid #4a2030;
    border-bottom-left-radius: 4px;
}

.error-block {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #f0a0a0;
    font-size: 14px;
}

.error-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #6b2030;
    color: #f0a0a0;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

.message-assistant .message-content code {
    background: #161822;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    font-family: "SF Mono", "Fira Code", "Consolas", monospace;
}

.message-assistant .message-content pre {
    background: #161822;
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 8px 0;
}

.message-assistant .message-content pre code {
    background: none;
    padding: 0;
}

/* Tool cards */
.tool-card {
    font-size: 12px;
    padding: 8px 12px;
    border-radius: 6px;
    background: #131622;
    border: 1px solid #1e2235;
    border-left: 2px solid #3b82f6;
}

.tool-card-name {
    color: #93c5fd;
    font-family: "SF Mono", "Fira Code", "Consolas", monospace;
    font-weight: 500;
    font-size: 11px;
}

.tool-card-args {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #1e2235;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tool-arg {
    display: flex;
    gap: 0;
    font-family: "SF Mono", "Fira Code", "Consolas", monospace;
    font-size: 12px;
    line-height: 1.6;
}

.tool-arg-key {
    color: #6b7280;
    flex-shrink: 0;
    min-width: 0;
}

.tool-arg-key::after {
    content: ":\00a0";
}

.tool-arg-value {
    color: #d1d5db;
    word-break: break-all;
}

/* Tool indicators (activity) */
.tool-active {
    color: #60a5fa;
    background: #172040;
}

.tool-error {
    color: #f87171;
    background: #2a1520;
}

/* Activity indicator (pulsing dot + label) */
.activity-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #8b8fa3;
    margin-top: 4px;
}

.pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #60a5fa;
    animation: pulse 1.5s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes pulse {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* Hunt mode */

.chat-container.hunt-active .chat-messages::-webkit-scrollbar-thumb {
    background: rgba(251, 191, 36, 0.4);
}

.chat-container.hunt-active .chat-input-area {
    border-top-color: rgba(251, 191, 36, 0.3);
    background: #161210;
}

.chat-container.hunt-active .chat-input-area textarea {
    border-color: rgba(251, 191, 36, 0.25);
    background: #1a1510;
}

.chat-container.hunt-active .chat-input-area textarea:focus {
    border-color: #fbbf24;
}

.chat-container.hunt-active .chat-input-area button {
    background: #b45309;
}

.chat-container.hunt-active .chat-input-area button:hover:not(:disabled) {
    background: #92400e;
}

/* System messages */
.message-system {
    align-self: center;
    max-width: 100%;
}

.message-system .message-content {
    background: none;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #c084fc;
    text-align: center;
}

/* Save as finding */
.save-report-trigger {
    display: block;
    margin-top: 8px;
    margin-left: auto;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    color: #93c5fd;
    background: rgba(37, 99, 235, 0.1);
    border: 1px solid rgba(37, 99, 235, 0.3);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.save-report-trigger:hover {
    background: rgba(37, 99, 235, 0.2);
    border-color: #2563eb;
}

.save-report-form {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    margin-left: auto;
    align-items: center;
    justify-content: flex-end;
}

.save-report-select {
    padding: 4px 8px;
    font-size: 12px;
    font-family: inherit;
    color: #e0e0e0;
    background: #161822;
    border: 1px solid #2a2d3e;
    border-radius: 6px;
    outline: none;
}

.save-report-select:focus {
    border-color: #2563eb;
}

.save-report-input {
    flex: 1;
    padding: 4px 10px;
    font-size: 12px;
    font-family: inherit;
    color: #e0e0e0;
    background: #161822;
    border: 1px solid #2a2d3e;
    border-radius: 6px;
    outline: none;
}

.save-report-input:focus {
    border-color: #2563eb;
}

.save-report-btn {
    padding: 4px 12px;
    font-size: 11px;
    font-family: inherit;
    font-weight: 500;
    color: #fff;
    background: #2563eb;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

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

.save-report-cancel {
    padding: 4px 10px;
    font-size: 11px;
    font-family: inherit;
    color: #6b7280;
    background: none;
    border: 1px solid #2a2d3e;
    border-radius: 6px;
    cursor: pointer;
}

/* Token info */
.token-info {
    align-self: center;
    font-size: 11px;
    color: #555;
    padding: 4px 0;
}

/* Input area */
.chat-input-area {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #1e2030;
    background: #0f1117;
}

.chat-input-area textarea {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #2a2d3e;
    border-radius: 12px;
    background: #161822;
    color: #e0e0e0;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    outline: none;
    line-height: 1.5;
    min-height: 90px;
    max-height: 300px;
}

.chat-input-area textarea:focus {
    border-color: #2563eb;
}

.chat-input-area textarea::-webkit-resizer           { background: #2a2d3e; }
.chat-input-area textarea::-webkit-scrollbar         { width: 6px; }
.chat-input-area textarea::-webkit-scrollbar-track   { background: #161822; border-radius: 3px; }
.chat-input-area textarea::-webkit-scrollbar-thumb   { background: #3a3d4e; border-radius: 3px; }
.chat-input-area textarea::-webkit-scrollbar-thumb:hover { background: #4a4d5e; }
.chat-input-area textarea { scrollbar-color: #3a3d4e #161822; scrollbar-width: thin; }

.chat-input-area textarea:disabled {
    opacity: 0.5;
}

.chat-input-area button {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    background: #2563eb;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}

.chat-input-area button:hover:not(:disabled) {
    background: #1d4ed8;
}

.chat-input-area button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Scrollbar styling */
.chat-messages::-webkit-scrollbar,
.dashboard::-webkit-scrollbar,
.dashboard-attention-list::-webkit-scrollbar {
    width: 4px;
}

.chat-messages::-webkit-scrollbar-track,
.dashboard::-webkit-scrollbar-track,
.dashboard-attention-list::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb,
.dashboard::-webkit-scrollbar-thumb,
.dashboard-attention-list::-webkit-scrollbar-thumb {
    background: #2a2d3e;
    border-radius: 3px;
}
