:root {
    --receipt-bg: #fdfdfd;
    --receipt-ink: #222;
    --loss-red: #dc3545;
    --gain-green: #198754;
    --pilot-purple: #6f42c1;
    --atc-blue: #0d6efd;
    --bg-dark: #212529;
    --growth-teal: #169a72;
    --gs-orange: #fd7e14;
    --pension-gold: #ffc107;
    --time-gray: #495057;
    
    /* Card Accents */
    --accent-1: #dc3545; /* Red */
    --accent-2: #fd7e14; /* Orange */
    --accent-3: #ffc107; /* Yellow */
    --accent-4: #198754; /* Green */
    --accent-5: #d63384; /* Pink */
    --accent-6: #6f42c1; /* Purple */
    --accent-7: #0d6efd; /* Blue */
    --accent-8: #708090; /* Slate */
}

body { font-family: 'Inter', sans-serif; background-color: #f8f9fa; overflow-anchor: none; }

/* Utilities */
.cursor-pointer { cursor: pointer; }
.toggle-icon { transition: transform 0.2s ease; display: inline-block; }

.text-housing { color: #fd7e14; }
.text-growth-teal { 
    color: var(--growth-teal);
    background-color: rgba(32, 201, 151, 0.12);
    font-weight: 700;
    padding: 0 4px;
    border-radius: 3px;
}
.text-loss-red { color: var(--loss-red) !important; }
.text-xs { font-size: 0.75rem; }
.text-xxs { font-size: 0.7rem; }
.text-pilot-gap { color: var(--pilot-purple); font-size: 2rem; line-height: 1; }
.font-mono { font-family: monospace; }
.ls-1 { letter-spacing: 1px; }
.text-085 { font-size: 0.85rem; }
.highlight-red { color: var(--loss-red); font-weight: 700; background: rgba(220,53,69,0.1); padding: 0 4px; border-radius: 3px; }

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #1a1e21 0%, #2c3034 100%);
    color: #fff;
    padding: 3.5rem 1rem;
    text-align: center;
    border-bottom: 6px solid var(--loss-red);
    margin-top: 0;
    margin-bottom: 2rem;
}
.hero-title { font-weight: 800; font-size: 3rem; text-transform: uppercase; letter-spacing: -2px; line-height: 1.1; margin-bottom: 0.5rem; }
.hero-subtitle { font-weight: 300; font-size: 1.15rem; opacity: 0.9; max-width: 800px; margin: 0 auto; }

/* Sticky Header Controls */
.header-control-bar { 
    z-index: 1020; 
    transition: all 0.2s ease;
    padding-top: 0.75rem !important; 
    padding-bottom: 0.75rem !important;
}

.header-input { 
    font-size: 0.875rem; 
    padding: 0.25rem 1.5rem 0.25rem 0.5rem; 
}
.header-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; }

/* Desktop Header Overrides */
@media (min-width: 992px) {
    .header-control-bar { padding-top: 1.0rem !important; padding-bottom: 1.0rem !important; }
    .header-input { 
        font-size: 1.1rem; 
        padding: 0.5rem 2rem 0.5rem 1rem; 
        height: auto; 
    }
    .header-label { font-size: 0.85rem !important; margin-bottom: 0.4rem !important; }
    .header-badge { font-size: 0.9rem !important; padding: 0.5em 0.8em !important; }
}

input[type=range] { accent-color: var(--growth-teal); width: 100%; padding-top: 5px; }

/* Story Cards */
.story-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.03);
    padding: 2rem;
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
    border-top: 5px solid transparent;
}

.story-card.accent-1 { border-top-color: var(--accent-1); }
.story-card.accent-1 .icon { background-color: var(--accent-1); }

.story-card.accent-2 { border-top-color: var(--accent-2); }
.story-card.accent-2 .icon { background-color: var(--accent-2); }

.story-card.accent-3 { border-top-color: var(--accent-3); }
.story-card.accent-3 .icon { background-color: var(--accent-3); color: #000; }

.story-card.accent-4 { border-top-color: var(--accent-4); }
.story-card.accent-4 .icon { background-color: var(--accent-4); }

.story-card.accent-5 { border-top-color: var(--accent-5); }
.story-card.accent-5 .icon { background-color: var(--accent-5); }

.story-card.accent-6 { border-top-color: var(--accent-6); }
.story-card.accent-6 .icon { background-color: var(--accent-6); }

.story-card.accent-7 { border-top-color: var(--accent-7); }
.story-card.accent-7 .icon { background-color: var(--accent-7); }

.story-card.accent-8 { border-top-color: var(--accent-8); }
.story-card.accent-8 .icon { background-color: var(--accent-8); }

.section-title { font-weight: 800; font-size: 1.6rem; margin-bottom: 1.2rem; display: flex; align-items: center; gap: 12px; color: #212529; }
.section-title .icon { color: #fff; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; border-radius: 8px; font-size: 1.1rem; font-weight: 700; }

.narrative-text { font-size: 1.05rem; color: #444; line-height: 1.6; margin-bottom: 1.5rem; }

/* Charts & Visuals */
.chart-box { height: 350px; position: relative; width: 100%; margin-top: 20px; }

.wealth-counter { 
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 1.5rem; 
    border-radius: 12px; 
    text-align: center; 
    margin-top: 2rem; 
}

.wealth-counter-primary {
    background: linear-gradient(135deg, var(--pilot-purple), #563d7c); 
    border: none;
}

.wealth-val { 
    font-size: 2rem; 
    font-weight: 800; 
    color: var(--pilot-purple); 
    line-height: 1.1; 
    margin: 0.25rem 0;
}
.wealth-counter-primary .wealth-val { color: white; }

.wealth-label { 
    text-transform: uppercase; 
    font-size: 0.75rem; 
    letter-spacing: 1px; 
    color: #6c757d;
    font-weight: 700;
}

.pilot-table {
    font-size: 0.9rem;
    table-layout: fixed;
}

.pilot-table th {
    width: 33.33%;
}

.pension-box {
    background-color: #fff9e6;
    border: 1px solid #ffeeba;
    border-left: 6px solid #ffc107;
    color: #533f03;
    padding: 1.5rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.12);
}

/* Shift Visualization */
.shift-grid-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    max-height: 250px;
    overflow-y: auto;
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.03);
}

.shift-token {
    width: 42px;
    height: 42px;
    background-color: #fff0f0;
    color: var(--loss-red);
    border: 1px solid rgba(220, 53, 69, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
    transition: all 0.1s ease-in-out;
}

.shift-token img { width: 24px; }

.shift-token:hover {
    color: white;
    transform: scale(1.3);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
    z-index: 10;
}

/* Receipt */
#captureArea {
    background-color: transparent;
    display: flex;
    justify-content: center;
}
.receipt {
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
    background: var(--receipt-bg);
    padding: 20px;
    font-family: 'Courier Prime', monospace;
    color: var(--receipt-ink);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
    position: relative;
    background-image: linear-gradient(135deg, #0000 5px, var(--receipt-bg) 0), linear-gradient(-135deg, #0000 5px, var(--receipt-bg) 0);
    background-size: 20px 20px;
    background-repeat: repeat-x;
    background-position: bottom;
    padding-bottom: 35px;
    border-top: 5px solid var(--loss-red);
}
.receipt-header { text-align: center; border-bottom: 2px dashed #bbb; margin-bottom: 12px; padding-bottom: 12px; }
.receipt-header h2 { font-size: 1.5rem; font-weight: 900; margin: 0; letter-spacing: -1px; }
.receipt-row { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 0.85rem; }
.receipt-divider { border-bottom: 1px dashed #bbb; margin: 12px 0; }
.receipt-total { 
    display: flex; justify-content: space-between; 
    font-weight: 700; font-size: 1.1rem; 
    border-top: 2px solid #222; 
    padding-top: 10px; margin-top: 10px; 
}
.big-loss { font-size: 2.2rem; font-weight: 900; color: var(--loss-red); text-align: center; margin: 10px 0; letter-spacing: -1.5px; }
.barcode { font-family: 'Libre Barcode 39', cursive; font-size: 2.5rem; text-align: center; opacity: 0.7; margin-top: 20px; transform: scaleY(0.8); }

.notes-section {
    background-color: #f1f3f5;
    border-radius: 12px;
    padding: 2rem;
    margin-top: 3rem;
    margin-bottom: 2rem;
}