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

body {
    font-family: 'Georgia', 'Times New Roman', Times, serif;
    background: #f5f1e8;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    color: #1a1a1a;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: #faf8f3;
    display: flex;
    flex-direction: column;
    height: 100vh;
    border: 3px solid #1a1a1a;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

header {
    text-align: center;
    border-bottom: 4px double #1a1a1a;
    padding: 30px 20px;
    background: #faf8f3;
    flex-shrink: 0;
}

header h1 {
    font-size: 3.5rem;
    margin-bottom: 5px;
    color: #1a1a1a;
    font-weight: 900;
    letter-spacing: -1px;
    text-transform: uppercase;
    font-family: 'Georgia', serif;
    border-bottom: 2px solid #1a1a1a;
    padding-bottom: 10px;
    display: inline-block;
}

.subtitle {
    font-size: 0.95rem;
    font-style: italic;
    color: #4a4a4a;
    margin-top: 10px;
    letter-spacing: 0.5px;
}

.main-content {
    display: grid;
    grid-template-columns: 380px 1fr;
    grid-template-rows: minmax(0, 1fr);
    gap: 0;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* Thermometer Section */
.thermometer-section {
    background: #faf8f3;
    border-right: 3px solid #1a1a1a;
    height: 100%;
    min-width: 380px;
    max-width: 380px;
    display: flex;
    flex-direction: column;
}

.thermometer-content {
    flex: 1;
    min-height: 0;
    padding: 24px 20px 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.fraud-label-container {
    text-align: center;
    margin-bottom: 15px;
    border-bottom: 2px solid #1a1a1a;
    padding-bottom: 8px;
}

.fraud-label-title {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.fraud-label-subtitle {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: #4a4a4a;
    transition: opacity 0.3s ease-in-out;
    opacity: 1;
}

.total-amount {
    text-align: center;
    margin-bottom: 20px;
    font-size: 2.8rem;
    font-weight: 900;
    color: #8b0000;
    font-family: 'Georgia', serif;
    transition: opacity 0.3s ease-in-out;
    opacity: 1;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.dollar-sign {
    font-size: 2rem;
    vertical-align: super;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.thermometer-container {
    /* Shared mercury shading: highlight at ~30% from the left on both shaft and bulb */
    --mercury-shaft: linear-gradient(to right, #6e0000 0%, #a30f0f 22%, #b51e1e 32%, #9a0606 55%, #7a0000 85%, #640000 100%);
    display: flex;
    justify-content: center;
    gap: 20px;
    align-items: stretch;
    /* Fill the sidebar's remaining height, up to the full 400px thermometer */
    flex: 1 1 auto;
    min-height: 170px;
    max-height: 480px;
}

/* Tube plus bulb. The bulb is an inline SVG whose outline continues the
   tube's side borders and whose mercury uses the shaft's gradient. */
.thermometer-body {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.thermometer-bulb {
    display: block;
    flex: none;
    width: 84px;
    height: 84px;
    overflow: visible;
    /* Overlap the tube's bottom edge to avoid a subpixel gap */
    margin-top: -3px;
}

.thermometer {
    width: 60px;
    flex: 1 1 auto;
    min-height: 0;
    background: #e8e4db;
    border: 3px solid #1a1a1a;
    border-bottom: none;
    border-radius: 30px 30px 0 0;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
}

.thermometer-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--mercury-shaft);
    transition: height 1s ease-in-out;
    height: 0%;
}

.thermometer-highlight {
    position: absolute;
    left: 0;
    right: 0;
    background: rgba(255, 100, 100, 0.4);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease-in-out, bottom 0.3s ease-in-out, height 0.3s ease-in-out;
}

.thermometer-highlight.active {
    opacity: 1;
}

.thermometer-scale {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    /* Bottom padding lines $0 up with the bottom of the tube, above the bulb */
    padding: 10px 0 calc(84px + 4px);
}

.scale-mark {
    position: relative;
    font-size: 0.85rem;
    color: #1a1a1a;
    font-weight: 700;
    font-family: 'Georgia', serif;
    min-width: 80px;
    text-align: left;
}

.scale-mark::before {
    content: '';
    position: absolute;
    left: -25px;
    top: 50%;
    width: 15px;
    height: 2px;
    background: #1a1a1a;
}

/* Timeline Section */
.timeline-section {
    background: #faf8f3;
    padding: 40px 50px;
    height: 100%;
    overflow-y: auto;
}

/* Calendar Selector */
.calendar-selector {
    border: 2px solid #1a1a1a;
    padding: 20px;
    margin-bottom: 30px;
    background: #faf8f3;
}

.calendar-label {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 15px;
    color: #1a1a1a;
    font-family: 'Courier New', monospace;
}

.calendar-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.calendar-btn {
    background: #faf8f3;
    border: 2px solid #1a1a1a;
    padding: 8px 20px;
    font-family: 'Georgia', serif;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calendar-btn:hover {
    background: #1a1a1a;
    color: #faf8f3;
}

.calendar-btn.active {
    background: #1a1a1a;
    color: #faf8f3;
}

.custom-date-range {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    margin-top: 0;
    padding-top: 0;
    border-top: 1px solid #1a1a1a;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease-in-out, margin-top 0.3s ease-in-out, padding-top 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

.custom-date-range.show {
    max-height: 100px;
    margin-top: 15px;
    padding-top: 15px;
    opacity: 1;
}

.date-input {
    border: 2px solid #1a1a1a;
    padding: 6px 12px;
    font-family: 'Georgia', serif;
    font-size: 0.9rem;
    background: #faf8f3;
}

.date-separator {
    font-family: 'Georgia', serif;
    font-weight: 700;
    font-size: 0.9rem;
}

.apply-btn {
    background: #1a1a1a;
    color: #faf8f3;
    border: 2px solid #1a1a1a;
    padding: 6px 20px;
    font-family: 'Georgia', serif;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.apply-btn:hover {
    background: #faf8f3;
    color: #1a1a1a;
}

.timeline-header {
    margin-bottom: 40px;
    text-align: center;
}

.timeline-header h2 {
    font-size: 2.2rem;
    color: #1a1a1a;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 3px double #1a1a1a;
    display: inline-block;
    padding-bottom: 10px;
}

.timeline {
    position: relative;
    padding-left: 0;
}

.timeline::before {
    display: none;
}

.timeline-item-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.timeline-item {
    position: relative;
    margin-bottom: 25px;
    animation: slideIn 0.5s ease-out backwards;
}

.timeline-item:nth-child(1) { animation-delay: 0.1s; }
.timeline-item:nth-child(2) { animation-delay: 0.2s; }
.timeline-item:nth-child(3) { animation-delay: 0.3s; }
.timeline-item:nth-child(4) { animation-delay: 0.4s; }
.timeline-item:nth-child(5) { animation-delay: 0.5s; }

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

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

.timeline-card {
    background: #faf8f3;
    border: none;
    padding: 0;
    transition: all 0.3s;
}

.timeline-card:hover {
    transform: none;
}

.timeline-item:hover {
    cursor: pointer;
}

.timeline-item {
    transition: border-color 0.3s ease-in-out;
    border: 3px solid #d4d0c8;
    border-radius: 0;
    padding: 15px 17px 25px 17px;
    margin-left: -20px;
    margin-right: -20px;
}

.timeline-item.highlighted {
    border-color: rgba(139, 0, 0, 0.4);
}

.timeline-header-row {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
    gap: 20px;
    border-bottom: 1px solid #1a1a1a;
    padding-bottom: 10px;
}

.timeline-date {
    font-size: 0.8rem;
    color: #1a1a1a;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    font-family: 'Courier New', monospace;
}

.timeline-title {
    font-size: 1.8rem;
    font-weight: 900;
    color: #1a1a1a;
    margin-bottom: 5px;
    line-height: 1.2;
    font-family: 'Georgia', serif;
}

.timeline-amount {
    font-size: 1.6rem;
    font-weight: 900;
    color: #8b0000;
    white-space: nowrap;
    font-family: 'Georgia', serif;
}

.timeline-description {
    color: #2a2a2a;
    line-height: 1.8;
    margin-bottom: 20px;
    font-size: 1.05rem;
    text-align: justify;
    column-count: 1;
}

.timeline-image-container {
    position: relative;
    margin-bottom: 20px;
}

.timeline-image {
    width: 100%;
    max-height: 450px;
    object-fit: cover;
    border: 3px solid #1a1a1a;
    box-shadow: 4px 4px 0 rgba(0,0,0,0.1);
    display: block;
}

.image-citation {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(250, 248, 243, 0.95);
    color: #1a1a1a;
    padding: 4px 8px;
    font-size: 0.7rem;
    font-family: 'Courier New', monospace;
    border: 1px solid #1a1a1a;
    font-weight: 700;
}

.timeline-link {
    color: #1a1a1a;
    text-decoration: none;
    font-weight: 700;
    transition: color 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 2px solid #1a1a1a;
    padding: 8px 16px;
    background: #faf8f3;
}

.timeline-link:hover {
    background: #1a1a1a;
    color: #faf8f3;
}

.timeline-link::after {
    content: '→';
    font-weight: bold;
}

.timeline-link-button {
    color: #1a1a1a;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 2px solid #1a1a1a;
    padding: 8px 16px;
    background: #faf8f3;
    font-family: 'Georgia', serif;
    transition: background 0.3s, color 0.3s;
}

.timeline-link-button::after {
    content: '→';
    font-weight: bold;
}

.timeline-item-link:hover .timeline-link-button {
    background: #1a1a1a;
    color: #faf8f3;
}

.timeline-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.link-citation {
    font-size: 0.75rem;
    font-family: 'Courier New', monospace;
    color: #4a4a4a;
    font-weight: 700;
    text-transform: lowercase;
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: #4a4a4a;
}

.empty-state h3 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    font-family: 'Georgia', serif;
    font-weight: 700;
}

/* Footer */
.site-footer {
    background: #faf8f3;
    border-top: 2px solid #d4d0c8;
    padding: 15px 20px;
    text-align: left;
    flex-shrink: 0;
    margin-top: auto;
}

.disclaimer-link {
    color: #4a4a4a;
    text-decoration: none;
    font-size: 0.8rem;
    font-family: 'Georgia', serif;
    font-style: italic;
    transition: color 0.3s;
}

.disclaimer-link:hover {
    color: #1a1a1a;
    text-decoration: underline;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
    background-color: rgba(0, 0, 0, 0.7);
}

.modal.show {
    display: block;
}

.modal-content {
    background-color: #faf8f3;
    margin: 5% auto;
    padding: 40px;
    border: 3px solid #1a1a1a;
    width: 90%;
    max-width: 700px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    position: relative;
}

.modal-content h2 {
    font-family: 'Georgia', serif;
    font-size: 2rem;
    font-weight: 900;
    color: #1a1a1a;
    margin-bottom: 20px;
    text-transform: uppercase;
    border-bottom: 2px solid #1a1a1a;
    padding-bottom: 10px;
}

.modal-text {
    font-family: 'Georgia', serif;
    font-size: 1rem;
    line-height: 1.8;
    color: #2a2a2a;
}

.modal-text p {
    margin-bottom: 15px;
}

.modal-close {
    color: #1a1a1a;
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.modal-close:hover {
    color: #8b0000;
}

.loading {
    text-align: center;
    padding: 60px 20px;
    color: #4a4a4a;
    font-family: 'Georgia', serif;
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 40px;
    right: 40px;
    padding: 15px 25px;
    background: #1a1a1a;
    color: #faf8f3;
    border: 3px solid #1a1a1a;
    font-family: 'Georgia', serif;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    box-shadow: 4px 4px 0 rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    z-index: 100;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: #8b0000;
    border-color: #8b0000;
    transform: translateY(-2px);
    box-shadow: 6px 6px 0 rgba(0,0,0,0.3);
}

.back-to-top:active {
    transform: translateY(0);
    box-shadow: 2px 2px 0 rgba(0,0,0,0.2);
}

/* Responsive */
/* Amount basis labels */
.amount-basis {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
}

.basis-badge {
    display: inline-block;
    padding: 2px 8px;
    border: 2px solid currentColor;
    font-family: 'Courier New', monospace;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: help;
}

.basis-confirmed { color: #1a1a1a; background: #e8e4d8; }
.basis-corroborated { color: #2f4a2f; }
.basis-estimate { color: #6b4a00; }
.basis-alleged { color: #8b0000; border-style: dashed; }
.basis-paper-value { color: #3a3a6b; border-style: dotted; }

.basis-note {
    color: #5a5a5a;
    font-style: italic;
}

.basis-note-sample {
    font-family: 'Courier New', monospace;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #5a5a5a;
}

.basis-legend {
    display: grid;
    gap: 6px;
    font-size: 0.85rem;
    line-height: 1.5;
}

.basis-legend dd {
    margin: 0 0 8px;
    color: #3a3a3a;
}

.modal-text h3 {
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 25px 0 10px;
    border-top: 2px solid #1a1a1a;
    padding-top: 15px;
}

.as-of {
    text-align: center;
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    color: #4a4a4a;
    letter-spacing: 0.5px;
}

.as-of {
    margin-top: 12px;
}


.support-link {
    display: inline-block;
    margin-top: 10px;
    color: #8b0000;
    font-weight: 700;
    font-size: 0.85rem;
    text-decoration: underline;
}

.support-note {
    display: block;
    color: #5a5a5a;
    font-size: 0.75rem;
    font-style: italic;
    margin-top: 2px;
}

.about-link {
    color: #8b0000;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.about-link:hover {
    text-decoration: underline;
}

.support-section {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #d4d0c8;
}

/* Side layout: tall or square images float right and the text wraps around them */
.timeline-card.layout-side .timeline-image-container {
    float: right;
    width: 34%;
    max-width: 280px;
    margin: 6px 0 16px 28px;
}

.timeline-card.layout-side .timeline-image {
    height: auto;
    max-height: none;
}

.timeline-card.layout-side .image-citation {
    font-size: 0.6rem;
    padding: 2px 5px;
}

.timeline-card.layout-side .timeline-footer {
    clear: both;
}

.timeline-card.layout-side::after {
    content: '';
    display: block;
    clear: both;
}

/* Shorter laptop screens: compact header so the thermometer fits without scrolling */
@media (max-height: 900px) and (min-width: 769px) {
    header {
        padding: 16px 20px;
    }

    header h1 {
        font-size: 2.6rem;
    }

    .subtitle {
        margin-top: 6px;
    }
}

/* Very short screens (e.g. 1280x720 windows) */
@media (max-height: 760px) and (min-width: 769px) {
    header {
        padding: 10px 20px;
    }

    header h1 {
        font-size: 2.2rem;
        padding-bottom: 6px;
    }

    .thermometer-content {
        padding: 14px 20px 10px;
    }

    .total-amount {
        font-size: 2.3rem;
        margin-bottom: 12px;
    }

    .site-footer {
        padding: 10px 20px;
    }

    .disclaimer-link {
        font-size: 0.72rem;
    }

    .support-section {
        margin-top: 8px;
        padding-top: 6px;
    }
}

@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 300px 1fr;
    }

    .thermometer-section {
        min-width: 300px;
        max-width: 300px;
    }
}

@media (max-width: 768px) {
    /* Stack: the total on top, the timeline fills the rest of the screen */
    .main-content {
        grid-template-columns: 1fr;
        grid-template-rows: auto minmax(0, 1fr);
    }

    .thermometer-section {
        min-width: 0;
        max-width: none;
        height: auto;
        border-right: none;
        border-bottom: 3px solid #1a1a1a;
    }

    .thermometer-content {
        padding: 15px 20px;
    }

    .thermometer-container {
        display: none;
    }

    .total-amount {
        margin-bottom: 0;
    }

    header h1 {
        font-size: 2.2rem;
    }

    .total-amount {
        font-size: 2rem;
    }

    header {
        padding: 15px;
    }

    .thermometer {
        height: 300px;
    }

    .thermometer-scale {
        height: 300px;
    }

    .timeline-section {
        padding: 30px 20px;
    }

    .timeline-header-row {
        flex-direction: column;
        gap: 10px;
    }

    .timeline-amount {
        font-size: 1.4rem;
    }

    .timeline-title {
        font-size: 1.5rem;
    }

    .timeline-description {
        text-align: left;
    }
}
