:root {
    --bg-paper: #FDFBF7;
    --text-ink: #1f2937;
    --color-red: #C62828;
    --color-gold: #C5A059;
    --font-body: 'Roboto', sans-serif;
    --font-display: 'Playfair Display', serif;
    --font-num: 'Courier Prime', monospace;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-paper);
    color: var(--text-ink);
    margin: 0;
    line-height: 1.6;
    font-size: 16px;
    background-image: radial-gradient(#e5e7eb 1px, transparent 1px);
    background-size: 20px 20px;
}

@media (min-width: 768px) {
    body { font-size: 18px; line-height: 1.8; }
}

h1, h2, h3, h4 { 
    font-family: var(--font-display); 
    color: var(--text-ink); 
    line-height: 1.3;
}

h1 { letter-spacing: -0.5px; }

.section-heading {
    font-family: var(--font-display);
    font-weight: 900;
    text-transform: uppercase;
    color: var(--color-red);
    font-size: 1.25rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-left: 1rem;
    border-left: 5px solid var(--color-red);
    line-height: 1.2;
}

@media (min-width: 768px) {
    .section-heading { font-size: 1.5rem; margin-top: 3.5rem; }
}

.calc-box {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-top: 4px solid var(--color-red);
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 1rem;
    box-shadow: 0 4px 20px -5px rgba(0,0,0,0.05);
    position: relative;
}

@media (min-width: 768px) {
    .calc-box { padding: 28px; }
}

.explain-box {
    font-family: var(--font-body);
    font-size: 1rem;
    color: #374151;
    padding: 0 5px;
    margin-bottom: 1.5rem;
    text-align: justify;
    line-height: 1.6;
    font-style: normal;
    border: none;
    background: transparent;
}

@media (min-width: 768px) {
    .explain-box { font-size: 1.1rem; line-height: 1.8; }
}

.explain-box p { margin-bottom: 1rem; }
.explain-box strong { color: var(--color-red); font-weight: 700; }

input[type="text"], input[type="number"], select {
    background-color: transparent;
    border: none;
    border-bottom: 2px solid var(--color-gold);
    color: var(--text-ink);
    font-family: var(--font-num);
    font-weight: 700;
    transition: all 0.3s;
    border-radius: 0;
    padding: 4px 0;
    width: 100%;
}

input:focus, select:focus {
    border-bottom-color: var(--color-red);
    outline: none;
    box-shadow: none;
}

input::placeholder { color: #9ca3af; font-weight: 400; font-family: var(--font-body); font-style: italic; font-size: 0.9rem; }

.btn-calculate {
    background-color: var(--color-red);
    color: white;
    width: 100%;
    padding: 12px;
    font-family: var(--font-display);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 1rem;
    border-radius: 6px;
    margin-top: 20px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(198, 40, 40, 0.2);
    transition: transform 0.1s, opacity 0.2s;
    border: 2px solid var(--color-red);
}

@media (min-width: 768px) {
    .btn-calculate { font-size: 1.1rem; padding: 14px; }
}

.btn-calculate:hover { opacity: 0.95; transform: translateY(-1px); }
.btn-calculate:active { transform: translateY(1px); }

.btn-calc-trigger {
    background: transparent; 
    border: 1px solid var(--color-gold);
    color: var(--color-gold); 
    padding: 4px 10px; 
    border-radius: 50px;
    font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
    cursor: pointer; transition: all 0.2s; white-space: nowrap;
}

.btn-calc-trigger:hover { background: var(--color-gold); color: #fff; }

.btn-add-row {
    border: 2px dashed #d6d3d1;
    color: #57534e;
    font-size: 0.9rem;
    font-family: var(--font-display);
    padding: 10px;
    width: 100%;
    border-radius: 6px;
    transition: all 0.2s;
    margin-top: 15px;
    font-weight: 600;
}

.btn-add-row:hover {
    border-color: var(--color-red);
    color: var(--color-red);
    background-color: #fff1f2;
}

.modal { transition: opacity 0.2s ease-in-out; }
body.modal-active { overflow: hidden; }

.chip-btn {
    font-size: 0.8rem; padding: 6px 12px; border-radius: 20px; 
    background: #fff; color: #57534e; 
    border: 1px solid #e7e5e4;
    cursor: pointer; transition: all 0.1s; font-weight: 500;
    margin-bottom: 6px; margin-right: 4px;
}

.chip-btn:hover { border-color: var(--color-red); color: var(--color-red); }

.marker-tooltip {
    background: var(--color-red); color: white;
    padding: 6px 10px; border-radius: 4px;
    font-family: var(--font-display); font-size: 12px;
    white-space: nowrap; opacity: 0; pointer-events: none;
    transition: opacity 0.2s; z-index: 50;
    position: absolute; bottom: 160%; left: 50%; transform: translateX(-50%);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.marker-tooltip::after {
    content: ''; position: absolute; top: 100%; left: 50%; margin-left: -6px;
    border-width: 6px; border-style: solid;
    border-color: var(--color-red) transparent transparent transparent;
}

.group:hover .marker-tooltip { opacity: 1; }
.tooltip-left { left: 0; transform: translateX(0); } .tooltip-left::after { left: 20px; }
.tooltip-right { right: 0; left: auto; transform: translateX(0); } .tooltip-right::after { left: auto; right: 20px; }

.timeline-marker {
    height: 2.5rem; width: 2.5rem;
    border-radius: 9999px; border-width: 3px; border-color: var(--bg-paper);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem; font-weight: bold; color: white;
    z-index: 20; font-family: var(--font-num);
}

.mobile-timeline-item {
    position: relative; padding-left: 2.5rem; padding-bottom: 2rem;
    border-left: 2px solid #d6d3d1;
}

.mobile-timeline-item:last-child { border-left: none; padding-bottom: 0; }
.mobile-marker-wrapper { position: absolute; left: -1.25rem; top: 0; }

.section-icon { color: var(--color-red); opacity: 0.9; font-size: 1.3rem; }
.star-pulse { animation: pulse-gold 2s infinite; }

@keyframes pulse-gold {
    0% { box-shadow: 0 0 0 0 rgba(197, 160, 89, 0.7); }
    70% { box-shadow: 0 0 0 12px rgba(197, 160, 89, 0); }
    100% { box-shadow: 0 0 0 0 rgba(197, 160, 89, 0); }
}