* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #0f172a;
    color: #e2e8f0;
}

:root {
    --scrollbar-thumb: rgba(148, 163, 184, 0.45);
    --scrollbar-thumb-hover: rgba(148, 163, 184, 0.7);
}

body,
.chat-thread,
.context-body,
.results-list,
.conversation-list,
.timeline-frame {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) transparent;
}

body::-webkit-scrollbar,
.chat-thread::-webkit-scrollbar,
.context-body::-webkit-scrollbar,
.results-list::-webkit-scrollbar,
.conversation-list::-webkit-scrollbar,
.timeline-frame::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

body::-webkit-scrollbar-track,
.chat-thread::-webkit-scrollbar-track,
.context-body::-webkit-scrollbar-track,
.results-list::-webkit-scrollbar-track,
.conversation-list::-webkit-scrollbar-track,
.timeline-frame::-webkit-scrollbar-track {
    background: transparent;
}

body::-webkit-scrollbar-thumb,
.chat-thread::-webkit-scrollbar-thumb,
.context-body::-webkit-scrollbar-thumb,
.results-list::-webkit-scrollbar-thumb,
.conversation-list::-webkit-scrollbar-thumb,
.timeline-frame::-webkit-scrollbar-thumb {
    background-color: var(--scrollbar-thumb);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

body::-webkit-scrollbar-thumb:hover,
.chat-thread::-webkit-scrollbar-thumb:hover,
.context-body::-webkit-scrollbar-thumb:hover,
.results-list::-webkit-scrollbar-thumb:hover,
.conversation-list::-webkit-scrollbar-thumb:hover,
.timeline-frame::-webkit-scrollbar-thumb:hover {
    background-color: var(--scrollbar-thumb-hover);
}

.sw-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.3);
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.sw-header h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
}

.sw-header .subtitle {
    margin: 4px 0 0;
    color: #94a3b8;
    font-size: 14px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #cbd5f5;
}

.header-user .user-name {
    opacity: 0.85;
}

.logout-link {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid rgba(248, 113, 113, 0.4);
    color: #fca5a5;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.logout-link:hover {
    background: rgba(248, 113, 113, 0.15);
    border-color: rgba(248, 113, 113, 0.7);
    color: #f87171;
}

.project-select label {
    display: block;
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 4px;
}

.project-select select {
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: rgba(15, 23, 42, 0.6);
    color: inherit;
}

.sw-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr) 320px;
    gap: 24px;
    padding: 24px 32px 80px;
    align-items: start;
}

.sw-sidebar,
.sw-detail {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sw-main-area {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

#filters-form {
    display: grid;
    gap: 12px;
}

#filters-form label {
    display: block;
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 4px;
}

#filters-form input,
#filters-form select,
#filters-form textarea {
    width: 100%;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: rgba(15, 23, 42, 0.6);
    color: inherit;
}

#filters-form input[type="date"] {
    color-scheme: dark;
}

#filters-form input[type="date"]::-webkit-calendar-picker-indicator {
    filter: brightness(0) saturate(100%) invert(75%) sepia(12%) saturate(746%) hue-rotate(156deg) brightness(102%) contrast(103%);
    opacity: 0.9;
    transition: opacity 0.2s ease;
}

#filters-form input[type="date"]:hover::-webkit-calendar-picker-indicator,
#filters-form input[type="date"]:focus::-webkit-calendar-picker-indicator {
    opacity: 1;
}

#filters-form button {
    padding: 10px 14px;
    border-radius: 6px;
    border: none;
    background: #6366f1;
    color: white;
    font-weight: 600;
    cursor: pointer;
}

#filters-form button:hover {
    background: #4f46e5;
}

.sw-stats {
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 10px;
    padding: 16px;
    background: rgba(15, 23, 42, 0.5);
    display: grid;
    gap: 12px;
}

.sw-stats h4 {
    margin: 0;
    font-size: 13px;
    color: #cbd5f5;
}

.sw-stats ul {
    list-style: none;
    padding: 0;
    margin: 6px 0 0;
    font-size: 13px;
    color: #94a3b8;
}

.sw-results {
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.55);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.results-list {
    overflow-y: auto;
    max-height: 360px;
}

.timeline-item {
    padding: 18px 20px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
    cursor: pointer;
    transition: background 0.2s;
}

.timeline-item:hover,
.timeline-item.selected {
    background: rgba(99, 102, 241, 0.18);
}

.timeline-item h3 {
    margin: 0 0 6px;
    font-size: 17px;
}

.timeline-item .meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    color: #94a3b8;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge.issue {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
}

.badge.source {
    background: rgba(20, 184, 166, 0.14);
    color: #5eead4;
}

.badge.confidence {
    background: rgba(234, 179, 8, 0.2);
    color: #facc15;
}

.badge.voice {
    background: rgba(34, 211, 238, 0.15);
    color: #67e8f9;
}

.sw-tabs {
    display: flex;
    gap: 12px;
    align-items: center;
}

.tab-button {
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: rgba(15, 23, 42, 0.6);
    color: #cbd5f5;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.tab-button:hover {
    border-color: rgba(34, 211, 238, 0.6);
    color: #67e8f9;
}

.tab-button.active {
    background: rgba(34, 211, 238, 0.16);
    border-color: rgba(34, 211, 238, 0.65);
    color: #22d3ee;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.timeline-frame {
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.55);
    padding: 20px;
    position: relative;
    min-height: 200px;
    overflow: hidden;
}

.timeline-canvas {
    position: relative;
    height: 160px;
    overflow: visible;
}

.timeline-canvas::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 2px;
    background: rgba(148, 163, 184, 0.25);
}

.timeline-empty {
    margin-top: 8px;
    font-size: 13px;
    color: #94a3b8;
    display: none;
}

.timeline-marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(34, 211, 238, 0.8);
    background: rgba(34, 211, 238, 0.3);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.timeline-marker:hover {
    transform: translate(-50%, -50%) scale(1.2);
    border-color: rgba(148, 163, 184, 0.9);
    background: rgba(148, 163, 184, 0.35);
    box-shadow: 0 0 12px rgba(148, 163, 184, 0.45);
}

.timeline-marker.active {
    transform: translate(-50%, -50%) scale(1.3);
    border-color: rgba(134, 239, 172, 0.95);
    background: rgba(74, 222, 128, 0.35);
    box-shadow: 0 0 16px rgba(74, 222, 128, 0.45);
}

.timeline-tooltip {
    position: fixed;
    font-size: 12px;
    line-height: 1.4;
    color: #f1f5f9;
    background: #0f172a;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(34, 211, 238, 0.6);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.8), 0 0 8px rgba(34, 211, 238, 0.2);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
    min-width: 200px;
    max-width: 280px;
    z-index: 10000;
    white-space: normal;
}

.timeline-tooltip[data-visible="true"] {
    opacity: 1;
    visibility: visible;
}

.timeline-tooltip .tooltip-date {
    font-size: 11px;
    color: #94a3b8;
    margin-bottom: 6px;
    font-weight: 500;
}

.timeline-tooltip .tooltip-person-inline {
    font-size: 10px;
    color: #64748b;
    font-weight: 400;
}

.timeline-tooltip .tooltip-snippet {
    font-size: 12px;
    color: #cbd5e1;
    line-height: 1.5;
    white-space: normal;
    word-wrap: break-word;
}

.timeline-month-marker {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(148, 163, 184, 0.15);
    pointer-events: none;
}

.timeline-month-label {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    color: #64748b;
    white-space: nowrap;
}

.timeline-axis-label {
    position: absolute;
    bottom: -4px;
    font-size: 11px;
    color: #94a3b8;
    pointer-events: none;
    font-weight: 600;
}

.timeline-axis-label.start {
    left: 0;
    text-align: left;
}

.timeline-axis-label.end {
    right: 0;
    text-align: right;
}

.sw-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.panel-section {
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    padding: 16px;
    background: rgba(15, 23, 42, 0.55);
}

.panel-section h3 {
    margin: 0 0 12px;
    font-size: 16px;
}

.context-body {
    max-height: 60vh;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.6;
    color: #cbd5f5;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    border-radius: 12px;
}

.context-body::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0;
    pointer-events: none;
}

.context-card {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.context-card h4 {
    margin: 0;
    font-size: 18px;
}

.context-card h5 {
    margin: 16px 0 6px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
}

.context-card .meta-line {
    font-size: 12px;
    color: #94a3b8;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.context-summary {
    margin: 8px 0 16px;
    font-size: 14px;
    line-height: 1.6;
    color: #e2e8f0;
}

.context-summary.muted {
    color: #94a3b8;
}

.context-card a {
    color: #38bdf8;
    text-decoration-color: rgba(56, 189, 248, 0.5);
}

.context-card a:hover,
.context-card a:focus {
    color: #0ea5e9;
    text-decoration-color: rgba(14, 165, 233, 0.8);
}

.context-card .context-tags {
    font-size: 12px;
    color: #67e8f9;
    margin-top: 4px;
}

.context-quote {
    margin: 0;
    font-size: 15px;
    font-style: italic;
    color: #f8fafc;
}

.context-text {
    margin: 0;
    white-space: pre-wrap;
}

.context-text.muted {
    color: #94a3b8;
}

.inline-citation {
    border: none;
    background: transparent;
    color: #22d3ee;
    cursor: pointer;
    font-weight: 600;
    padding: 0;
    display: inline;
}

.inline-citation:hover {
    text-decoration: underline;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.chat-header h3 {
    margin: 0;
    font-size: 16px;
}

.chat-clear {
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: transparent;
    color: #94a3b8;
    font-size: 12px;
    cursor: pointer;
}

.chat-clear:hover {
    border-color: #cbd5f5;
    color: #cbd5f5;
}

.chat-thread {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 40vh;
    overflow-y: auto;
    margin-bottom: 12px;
    padding-right: 4px;
}

.chat-empty {
    font-size: 13px;
    color: #94a3b8;
}

.chat-message {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(30, 41, 59, 0.7);
    font-size: 14px;
    line-height: 1.5;
}

.chat-message.user {
    background: rgba(236, 72, 153, 0.18);
    align-self: flex-end;
}

.chat-message.assistant {
    background: rgba(45, 212, 191, 0.16);
}

.chat-message.voice .message-meta {
    color: #fbbf24;
}

.message-meta {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
}

.message-content pre,
.message-content p {
    margin: 0;
    white-space: pre-wrap;
}

.message-reasoning {
    font-size: 12px;
    font-style: italic;
    color: #cbd5f5;
    line-height: 1.4;
    border-left: 2px solid rgba(148, 163, 184, 0.3);
    padding-left: 10px;
    margin-top: -4px;
    margin-bottom: 4px;
}

.message-reasoning .reasoning-line + .reasoning-line {
    margin-top: 2px;
}

.message-reasoning .reasoning-line::before {
    content: '• ';
    opacity: 0.7;
}

.message-citations {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.citation-pill {
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 11px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: transparent;
    color: #cbd5f5;
    cursor: pointer;
}

.citation-pill:hover {
    border-color: #22d3ee;
    color: #22d3ee;
}

.chat-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-form textarea {
    resize: vertical;
    min-height: 80px;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: rgba(15, 23, 42, 0.6);
    color: #e2e8f0;
}

.chat-section {
    flex: 1;
}

.conversation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.conversation-header h3 {
    margin: 0;
    font-size: 15px;
}

.pill-button {
    padding: 4px 12px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(30, 41, 59, 0.8);
    color: #e2e8f0;
    font-size: 12px;
    cursor: pointer;
}

.pill-button:hover {
    border-color: #22d3ee;
    color: #22d3ee;
}

.conversation-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 220px;
    overflow-y: auto;
}

.conversation-list .empty {
    margin: 0;
    font-size: 13px;
    color: #94a3b8;
}

.conversation-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    padding-right: 44px;
    border-radius: 8px;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid transparent;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
    position: relative;
}

.conversation-item.selected {
    border-color: rgba(34, 211, 238, 0.6);
    background: rgba(34, 211, 238, 0.12);
}

.conversation-item:hover {
    border-color: rgba(94, 234, 212, 0.35);
}

.conversation-item h4 {
    margin: 0;
    font-size: 13px;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.conversation-item .preview {
    font-size: 12px;
    color: #94a3b8;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-item .timestamp {
    font-size: 11px;
    color: #64748b;
}

.conversation-delete {
    position: absolute;
    top: 8px;
    right: 8px;
    border: none;
    background: rgba(15, 23, 42, 0.85);
    color: #f1f5f9;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    cursor: pointer;
    display: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.conversation-delete:hover,
.conversation-delete:focus-visible {
    background: rgba(248, 113, 113, 0.25);
    color: #fca5a5;
}

.conversation-delete[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
    background: rgba(15, 23, 42, 0.6);
    color: #94a3b8;
}

.conversation-delete[disabled]:hover,
.conversation-delete[disabled]:focus-visible {
    background: rgba(15, 23, 42, 0.6);
    color: #94a3b8;
}

.conversation-item:hover .conversation-delete,
.conversation-item.selected .conversation-delete {
    display: inline-flex;
}

.chat-message.system {
    background: rgba(148, 163, 184, 0.12);
    border: 1px dashed rgba(148, 163, 184, 0.3);
}

.chat-message.voice.user .message-content p {
    font-style: italic;
    opacity: 0.85;
}

.voice-status[data-state="error"] {
    color: #fda4af;
}

.chat-form-actions {
    display: flex;
    justify-content: flex-end;
}

.chat-form-actions .primary {
    padding: 8px 14px;
    border-radius: 6px;
    border: none;
    background: #22d3ee;
    color: #0f172a;
    font-weight: 600;
    cursor: pointer;
}

.chat-form-actions .primary:hover {
    background: #0ea5e9;
}

.chat-footer {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.voice-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: rgba(15, 23, 42, 0.8);
    color: #cbd5f5;
    cursor: pointer;
}

.voice-button[data-state="active"] {
    border-color: #22d3ee;
    color: #22d3ee;
}

.voice-button[data-state="active"] .voice-label {
    font-weight: 600;
}

.voice-indicator {
    --voice-level-neutral: 0;
    --voice-level-user: 0;
    --voice-level-assistant: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #64748b;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    transform: scale(calc(1 + (var(--voice-level-neutral, 0) * 0.5)));
    box-shadow: 0 0 0 rgba(34, 211, 238, 0);
}

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

.voice-button[data-state="active"] .voice-indicator {
    background: #22d3ee;
    animation: voice-pulse 1.2s ease-in-out infinite;
}

@keyframes voice-pulse-user {
    0% { transform: scale(1); box-shadow: 0 0 0 rgba(56, 189, 248, 0.6); }
    50% { transform: scale(1.7); box-shadow: 0 0 14px rgba(56, 189, 248, 0.75); }
    100% { transform: scale(1); box-shadow: 0 0 0 rgba(56, 189, 248, 0.3); }
}

@keyframes voice-pulse-assistant {
    0% { transform: scale(1); box-shadow: 0 0 0 rgba(250, 204, 21, 0.55); }
    50% { transform: scale(1.7); box-shadow: 0 0 16px rgba(250, 204, 21, 0.75); }
    100% { transform: scale(1); box-shadow: 0 0 0 rgba(250, 204, 21, 0.35); }
}

.voice-button[data-speaker="user"] .voice-indicator {
    background: #38bdf8;
    animation: voice-pulse-user 900ms ease-in-out infinite;
    transform: scale(calc(1 + (var(--voice-level-user, 0) * 0.9)));
}

.voice-button[data-speaker="assistant"] .voice-indicator {
    background: #facc15;
    animation: voice-pulse-assistant 900ms ease-in-out infinite;
    transform: scale(calc(1 + (var(--voice-level-assistant, 0) * 0.9)));
}

.voice-status {
    font-size: 12px;
    color: #94a3b8;
}

.voice-model-select {
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
    font-size: 11px;
    color: #94a3b8;
}

.voice-model-select select {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 6px;
    color: #e2e8f0;
    padding: 4px 8px;
    font-size: 12px;
}

.voice-model-select select:focus-visible {
    outline: 1px solid rgba(34, 211, 238, 0.6);
}

#voice-audio {
    display: none;
}

.timeline-item.flash {
    animation: flash-highlight 1.4s ease;
}

@keyframes flash-highlight {
    0% {
        box-shadow: 0 0 0 rgba(34, 211, 238, 0.7);
    }
    50% {
        box-shadow: 0 0 16px rgba(34, 211, 238, 0.5);
    }
    100% {
        box-shadow: 0 0 0 rgba(34, 211, 238, 0);
    }
}

@media (max-width: 1280px) {
    .sw-layout {
        grid-template-columns: 1fr;
    }
    .sw-sidebar {
        order: 1;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 16px;
    }
    .sw-sidebar .panel-section {
        flex: 1 1 260px;
    }
    .sw-main-area {
        order: 2;
    }
    .sw-detail {
        order: 3;
        width: 100%;
    }
    .results-list {
        max-height: 260px;
    }
}

@media (max-width: 900px) {
    .sw-layout {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }
    .sw-sidebar {
        display: contents;
    }
    #conversation-panel {
        order: 1;
        width: 100%;
    }
    #filters-panel {
        order: 5;
        width: 100%;
    }
    #stats-panel {
        order: 6;
        width: 100%;
    }
    .sw-main-area {
        order: 2;
        display: flex;
        flex-direction: column;
        gap: 16px;
    }
    #timeline-view {
        order: 1;
    }
    #search-view {
        order: 2;
    }
    #chat-panel {
        order: 3;
    }
    .sw-detail {
        order: 3;
        display: contents;
    }
    #context-panel {
        order: 4;
    }
    .timeline-frame {
        min-height: 150px;
    }
}

/* Context panel flash states */
#context-body.flash-context-select::after {
    background: radial-gradient(circle at center, rgba(34, 211, 238, 0.18), rgba(34, 211, 238, 0));
    animation: context-flash-select 0.25s ease forwards;
}

#context-body.flash-highlight::after {
    background: radial-gradient(circle at center, rgba(34, 211, 238, 0.35), rgba(34, 211, 238, 0));
    animation: context-flash-strong 0.65s ease forwards;
}

@keyframes context-flash-select {
    0% {
        opacity: 0.75;
    }
    100% {
        opacity: 0;
    }
}

@keyframes context-flash-strong {
    0% {
        opacity: 0.9;
    }
    100% {
        opacity: 0;
    }
}
