* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

html {
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.3) 0%, transparent 50%),
        linear-gradient(135deg, #0f0f23 0%, #1a1a2e 25%, #16213e 50%, #0f3460 75%, #533483 100%);
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

body {
    color: #333;
    line-height: 1.6;
}

#header {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    padding: 6px 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.42);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 8px 24px rgba(15, 15, 35, 0.12);
}

.main-navigation {
    background: transparent;
    border: none;
    margin-top: 0;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    -webkit-user-select: none;
    user-select: none;
}

.header-content * {
    -webkit-user-select: none;
    user-select: none;
}

.header-icon {
    width: 32px;
    height: 32px;
    border-radius: 0;
    object-fit: contain;
    display: block;
    pointer-events: none;
}

.header-text {
    text-align: left;
}

#header h1 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 0;
    letter-spacing: -0.5px;
}

#header h3 {
    display: none;
}

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

.nav-menu {
    display: flex;
    list-style: none;
    gap: 0;
    margin: 0;
    padding: 0;
}

.nav-item {
    flex: 1;
}

.nav-link {
    display: block;
    padding: 8px 20px;
    text-decoration: none;
    color: #4a5568;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #2d3748;
    border-bottom-color: #00d4ff;
}

.nav-link.active {
    background: rgba(0, 212, 255, 0.1);
    color: #00d4ff;
    border-bottom-color: #00d4ff;
}

#map-section {
    position: relative;
    max-width: 1200px;
    margin: 1rem auto 2rem;
    padding: 0 20px;
    scroll-margin-top: 96px;
}

#global-map {
    width: 100%;
    height: 62vh;
    min-height: 360px;
    max-height: 640px;
    border-radius: 8px;
}

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

.section-title {
    text-align: center;
    color: #00d4ff;
    font-size: 2rem;
    margin-bottom: 30px;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

.timeline-section {
    margin: 40px auto;
    max-width: 1200px;
    padding: 0 20px;
}

.timeline-display-options {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.timeline-display-options button {
    padding: 8px 14px;
    border: 1px solid rgba(0, 212, 255, 0.4);
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s, border-color 0.2s;
}

.timeline-display-options button:hover {
    background: rgba(0, 212, 255, 0.15);
    border-color: #00d4ff;
}

.timeline-display-options button.active {
    background: rgba(0, 212, 255, 0.25);
    border-color: #00d4ff;
    color: #fff;
}

.timeline-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    margin: 40px 0;
}

.timeline-container::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #00d4ff, #0066ff);
    z-index: 1;
}

.timeline-item {
    position: relative;
    z-index: 2;
    text-align: center;
    flex: 1;
    cursor: pointer;
    transition: all 0.3s ease;
}

.timeline-marker {
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.9);
    border: 3px solid #00d4ff;
    border-radius: 50%;
    margin: 0 auto 15px;
    transition: all 0.3s ease;
}

.timeline-item.active .timeline-marker {
    background: #00d4ff;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.6);
    transform: scale(1.2);
}

.timeline-content {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 15px;
    margin: 0 10px;
    border: 1px solid rgba(0, 212, 255, 0.2);
}

.timeline-content h3 {
    color: #00d4ff;
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.timeline-content p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

/* Vertical layout */
.timeline-section.timeline-display-vertical .timeline-container {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 20px 0;
}

.timeline-section.timeline-display-vertical .timeline-container::before {
    top: 0;
    bottom: 0;
    left: 20px;
    right: auto;
    width: 2px;
    height: 100%;
    background: linear-gradient(180deg, #00d4ff, #0066ff);
}

.timeline-section.timeline-display-vertical .timeline-item {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    text-align: left;
    padding-left: 50px;
    flex: none;
}

.timeline-section.timeline-display-vertical .timeline-marker {
    position: absolute;
    left: 11px;
    margin: 0;
}

.timeline-section.timeline-display-vertical .timeline-content {
    margin: 0 0 24px 0;
    flex: 1;
}

/* Compact (pills) layout */
.timeline-section.timeline-display-compact .timeline-container {
    flex-wrap: wrap;
    gap: 12px;
    margin: 20px 0;
}

.timeline-section.timeline-display-compact .timeline-container::before {
    display: none;
}

.timeline-section.timeline-display-compact .timeline-item {
    flex: none;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 24px;
    padding: 8px 16px 8px 8px;
    margin: 0;
}

.timeline-section.timeline-display-compact .timeline-item.active {
    background: rgba(0, 212, 255, 0.2);
    border-color: #00d4ff;
}

.timeline-section.timeline-display-compact .timeline-marker {
    width: 12px;
    height: 12px;
    margin: 0;
    flex-shrink: 0;
}

.timeline-section.timeline-display-compact .timeline-item.active .timeline-marker {
    transform: scale(1);
}

.timeline-section.timeline-display-compact .timeline-content {
    padding: 0;
    margin: 0;
    background: none;
    border: none;
}

.timeline-section.timeline-display-compact .timeline-content h3 {
    font-size: 0.95rem;
    margin: 0;
}

.timeline-section.timeline-display-compact .timeline-content p {
    font-size: 0.8rem;
    margin: 2px 0 0 0;
}

/* Cards (grid) layout */
.timeline-section.timeline-display-cards .timeline-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.timeline-section.timeline-display-cards .timeline-container::before {
    display: none;
}

.timeline-section.timeline-display-cards .timeline-item {
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.timeline-section.timeline-display-cards .timeline-item .timeline-content {
    order: 1;
    margin: 0 0 12px 0;
    flex: 1;
}

.timeline-section.timeline-display-cards .timeline-marker {
    order: 2;
    margin: 0 auto;
}

.timeline-section.timeline-display-cards .timeline-item.active .timeline-content {
    border-color: #00d4ff;
    box-shadow: 0 0 16px rgba(0, 212, 255, 0.2);
}

.comparison-section {
    margin: 40px auto;
    max-width: 1400px;
    padding: 0 20px;
}

.comparison-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 30px;
}

.comparison-column {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(0, 212, 255, 0.2);
    overflow: hidden;
    transition: all 0.3s ease;
}

.comparison-column:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 212, 255, 0.2);
}

.column-header {
    background: rgba(0, 212, 255, 0.1);
    padding: 20px;
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.column-header h3 {
    color: #00d4ff;
    margin: 0;
    font-size: 1.3rem;
}

.focus-indicator {
    background: #00d4ff;
    color: #0f0f23;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.focus-indicator.inactive {
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.6);
}

.comparison-content {
    padding: 20px;
}

.fact-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 3px solid #00d4ff;
}

.fact-card h4 {
    color: #00d4ff;
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.fact-card p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 10px;
    line-height: 1.5;
}

.fact-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

.reasoning-block {
    background: rgba(0, 212, 255, 0.1);
    border-radius: 8px;
    padding: 15px;
    border: 1px solid rgba(0, 212, 255, 0.3);
}

.reasoning-block h4 {
    color: #00d4ff;
    margin-bottom: 8px;
}

.reasoning-block p {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.5;
}

.form-section {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 30px;
    margin: 30px auto;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.form-section p {
    margin-bottom: 20px;
    color: #4a5568;
    font-weight: 500;
}

.form-section input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 15px;
    transition: border-color 0.2s;
}

.form-section input[type="text"]:focus {
    outline: none;
    border-color: #00d4ff;
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.form-section input[type="button"] {
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 50%, #0066ff 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.form-section input[type="button"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.4);
}

.issue {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 30px;
    margin: 30px auto;
    max-width: 600px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    font-size: 1.1rem;
    color: #4a5568;
    font-weight: 500;
}

.content-section {
    display: flex;
    gap: 30px;
    margin: 40px auto;
    max-width: 1200px;
    padding: 0 20px;
}

.extra_l, .extra_r {
    flex: 1;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.extra_l {
    color: #4a5568;
    line-height: 1.8;
}

.extra_r img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.chat-container {
    margin-top: 20px;
}

.chat-messages {
    height: 300px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.9);
    margin-bottom: 15px;
}

.chat-message {
    margin-bottom: 10px;
    padding: 8px 12px;
    background: rgba(0, 212, 255, 0.1);
    border-radius: 6px;
    border-left: 3px solid #00d4ff;
}

.chat-message .timestamp {
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 4px;
}

.chat-message .message {
    color: #374151;
    font-weight: 500;
}

.chat-message .session-id {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 4px;
}

.chat-input {
    display: flex;
    gap: 10px;
}

.chat-input input {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.9);
}

.chat-input input:focus {
    outline: none;
    border-color: #00d4ff;
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.chat-input button {
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 50%, #0066ff 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.chat-input button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.3);
}

/* Overlay Styles */
.overlay-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #00d4ff 0%, #0066ff 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.4);
    z-index: 1002;
    transition: all 0.3s ease;
    border: none;
}

.overlay-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 212, 255, 0.6);
}

.overlay-button span {
    color: white;
    font-size: 2rem;
    font-weight: bold;
    line-height: 1;
}

.overlay-form {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 1003;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.overlay-form.active {
    display: flex;
}

.overlay-content {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.overlay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 0 24px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 24px;
}

.overlay-header h2 {
    color: #1f2937;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.close-button {
    background: none;
    border: none;
    font-size: 2rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-button:hover {
    background: #f3f4f6;
    color: #374151;
}

.overlay-form-content {
    padding: 0 24px 24px 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #374151;
    font-weight: 500;
    font-size: 0.875rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.2s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #00d4ff;
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 32px;
}

.btn-primary {
    background: linear-gradient(135deg, #00d4ff 0%, #0066ff 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.4);
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 2px solid #e5e7eb;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
}

/* Fullscreen Overlay */
.fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(2px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    color: white;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.fullscreen-overlay .overlay-content {
    text-align: center;
    max-width: 600px;
    padding: 40px;
}

.fullscreen-overlay h2 {
    font-size: 3rem;
    margin-bottom: 20px;
    color: #00d4ff;
    text-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
}

.fullscreen-overlay p {
    font-size: 1.5rem;
    margin-bottom: 40px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
}

/* Popup Styles */
.popup-button {
    position: absolute;
    bottom: 30px;
    left: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
    z-index: 1005;
    transition: all 0.3s ease;
    border: none;
}

.popup-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(16, 185, 129, 0.6);
}

.popup-button span {
    color: white;
    font-size: 1.5rem;
    line-height: 1;
}

.popup-window {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 400px;
    max-width: 90vw;
    z-index: 10000;
    display: none;
    animation: popupSlideIn 0.3s ease;
}

.popup-window.active {
    display: block;
}

@keyframes popupSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px 12px 0 0;
}

.popup-header h3 {
    color: #1f2937;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
}

.popup-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.popup-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.popup-content {
    padding: 24px;
}

.popup-content p {
    color: #4b5563;
    margin-bottom: 16px;
    line-height: 1.6;
}

.popup-action-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
}

.popup-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.popup-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1003;
    display: none;
}

.popup-backdrop.active {
    display: block;
}



.map-hover-label .maplibregl-popup-content {
    padding: 4px 10px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    pointer-events: none;
}

.map-hover-label .maplibregl-popup-tip {
    display: none;
}

.map-filter-btn {
    padding: 6px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #f8fafc;
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.map-filter-btn:hover {
    border-color: #00d4ff;
    color: #0099cc;
}

.map-filter-btn.active {
    background: linear-gradient(135deg, #00d4ff 0%, #0066ff 100%);
    color: white;
    border-color: transparent;
}

#archive-explore {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px 60px;
}
#archive-explore .muted { color: #64748b; font-size: 0.9rem; }
#archive-explore code { font-size: 0.85em; word-break: break-all; }
.archive-layout {
    display: grid;
    grid-template-columns: 220px 1fr 1.2fr;
    gap: 16px;
    margin-top: 16px;
}
@media (max-width: 900px) {
    .archive-layout { grid-template-columns: 1fr; }
}
.archive-stack-btn, .archive-node-btn {
    display: block;
    width: 100%;
    text-align: left;
    margin-bottom: 6px;
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
}
.archive-stack-btn.active, .archive-node-btn.active {
    border-color: #3b82f6;
    background: #eff6ff;
}
.archive-node-btn strong { display: block; font-size: 0.95rem; }
.archive-node-btn span { color: #64748b; font-size: 0.8rem; }
        .archive-panel {
            background: #fff;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            padding: 12px;
        }
        .archive-panel h3 {
            margin-bottom: 8px;
            font-size: 1rem;
        }
.archive-edge-list { padding-left: 1.1rem; margin: 8px 0 0; }
.archive-excerpt {
    margin: 8px 0 12px;
    padding: 8px 12px;
    border-left: 3px solid #94a3b8;
    color: #334155;
    font-size: 0.92rem;
}
.archive-excerpt p { margin: 0; }
.archive-edge-link {
    border: none;
    background: none;
    color: #2563eb;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}
.term-tip {
    display: inline;
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    color: inherit;
    font: inherit;
    cursor: help;
    border-bottom: 1px dotted #94a3b8;
}
.term-tip:hover, .term-tip:focus {
    border-bottom-color: #3b82f6;
    color: #1d4ed8;
    outline: none;
}
#term-tip-bubble {
    position: fixed;
    z-index: 4000;
    max-width: 280px;
    padding: 10px 12px;
    background: #0f172a;
    color: #f8fafc;
    border-radius: 8px;
    font-size: 0.85rem;
    line-height: 1.35;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.35);
    pointer-events: none;
    display: none;
}
#term-tip-bubble strong {
    display: block;
    margin-bottom: 4px;
    font-size: 0.9rem;
}
#term-tip-bubble.visible { display: block; }

@media (max-width: 768px) {
    .content-section {
        flex-direction: column;
    }

    #header h1 {
        font-size: 2rem;
    }

    #header h3 {
        font-size: 1rem;
    }

    .chat-input {
        flex-direction: column;
    }

    .timeline-container {
        flex-direction: column;
        gap: 20px;
    }

    .timeline-container::before {
        display: none;
    }

    .timeline-section.timeline-display-vertical .timeline-item {
        padding-left: 44px;
    }

    .timeline-section.timeline-display-vertical .timeline-container::before {
        left: 14px;
    }

    .timeline-section.timeline-display-vertical .timeline-marker {
        left: 5px;
    }

    .timeline-section.timeline-display-cards .timeline-container {
        grid-template-columns: 1fr;
    }

    .comparison-container {
        grid-template-columns: 1fr;
    }
}

/* Map chrome (moved off inline styles) */
#minimap-container {
    position: absolute;
    bottom: 10px;
    left: 10px;
    width: 260px;
    height: 130px;
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    z-index: 2;
    cursor: crosshair;
    touch-action: none;
}

#minimap {
    width: 520px;
    height: 260px;
    transform: scale(0.5);
    transform-origin: top left;
    pointer-events: none;
}

.map-toolbar {
    position: absolute;
    top: 16px;
    left: 16px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    z-index: 2;
}

#map-info-panel {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 400px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    display: none;
    z-index: 3;
    white-space: nowrap;
}

#map-info-detail {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 0.9rem;
}

#state-outline-panel {
    max-width: 1200px;
    margin: -1rem auto 2rem;
    padding: 0 20px;
    text-align: center;
}

#state-outline-title {
    display: block;
    margin-bottom: 8px;
}

#state-outline {
    display: block;
    width: 100%;
    max-width: 420px;
    height: 220px;
    margin: 0 auto;
}

#archive-explore .archive-lead {
    text-align: center;
    margin-top: -8px;
}

#archive-pack-meta {
    text-align: center;
    color: #64748b;
    padding: 24px 16px 32px;
}

.app-version {
    position: fixed;
    bottom: 9px;
    left: 9px;
    color: #9999;
    z-index: 1001;
    font-size: 9px;
    user-select: none;
    font-family: georgia;
    pointer-events: none;
}
