:root {
    --ssy-bg: #fdf2f8;
    --ssy-accent: #db2777;
    --lic-bg: #eff6ff;
    --lic-accent: #1d4ed8;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --glass: rgba(255, 255, 255, 0.8);
}

/* Tool Specific Header */
.tool-header {
    text-align: center;
    padding: 2rem 0;
    color: var(--primary-color);
}

.tool-header h1 {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    margin-bottom: 0.5rem;
}

.vs {
    font-style: italic;
    font-weight: 300;
    opacity: 0.7;
    margin: 0 0.5rem;
}

/* Overriding global card for this tool's specific glass look */
.calculator-card {
    background: #ffffff;
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 20px 50px rgba(0,0,0,0.05);
    border: 2px solid #e2e8f0;
    margin-bottom: 3rem;
}

/* Input Section */
.input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
}

.input-col {
    padding: 1.5rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 1rem;
    font-weight: 800;
    color: var(--primary-color);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.quick-invest {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.quick-btn {
    flex: 1;
    padding: 0.6rem;
    font-size: 0.8rem;
    font-weight: 700;
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-btn:hover { background: #f1f5f9; border-color: var(--primary-color); }
.quick-btn.active { background: var(--primary-color); color: white; border-color: var(--primary-color); box-shadow: 0 4px 12px rgba(29, 78, 216, 0.3); }

.input-with-slider {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

input[type="range"] {
    flex: 1;
    accent-color: var(--primary-color);
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
}

.stepper-container {
    display: flex;
    align-items: center;
    background: white;
    border: 2px solid var(--primary-color);
    border-radius: 14px;
    padding: 3px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.step-btn {
    width: 34px;
    height: 34px;
    border: none;
    background: #f1f5f9;
    color: var(--primary-color);
    font-size: 1.3rem;
    font-weight: 800;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.step-btn:hover {
    background: var(--primary-color);
    color: white;
}

.step-btn:active {
    transform: scale(0.9);
}

.numeric-input {
    width: 100px;
    padding: 0.5rem;
    border: none;
    background: transparent;
    font-family: 'Poppins', sans-serif;
    font-weight: 800;
    color: var(--text-main);
    text-align: center;
    font-size: 1rem;
}

.numeric-input:focus {
    outline: none;
}

/* Visualization Section */
.visualizer-section {
    margin: 3rem 0;
    padding: 3rem 2rem;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 28px;
    width: 100%;
}

/* Atomic Answer Box */
.atomic-answer {
    background: #f0f9ff;
    border-left: 5px solid var(--primary-color);
    padding: 1.5rem;
    margin: 2rem auto;
    max-width: 900px;
    border-radius: 0 16px 16px 0;
    text-align: left;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}

.atomic-answer p {
    margin: 0;
    color: #334155;
    line-height: 1.6;
    font-size: 1.05rem;
}

/* Related Tools Silo */
.related-tools-silo {
    margin: 5rem 0 2rem;
    padding: 3rem;
    background: #f8fafc;
    border-radius: 32px;
    border: 1px solid #e2e8f0;
}

.related-tools-silo h3 {
    text-align: center;
    margin-bottom: 2.5rem;
    color: var(--primary-color);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.silo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.silo-item {
    background: white;
    padding: 1.5rem;
    border-radius: 20px;
    text-decoration: none;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s;
    border: 1px solid #e2e8f0;
    text-align: center;
}

.silo-item i {
    font-size: 2rem;
    color: var(--primary-color);
}

.silo-item span {
    font-weight: 700;
    font-size: 0.95rem;
}

.silo-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    border-color: var(--primary-color);
}

@media (max-width: 768px) {
    .atomic-answer { margin: 1.5rem 1rem; }
    .related-tools-silo { padding: 2rem 1rem; }
}

.chart-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 4rem;
    flex-wrap: wrap;
}

.chart-box {
    background: white;
    padding: 1.5rem;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    min-width: 250px;
    text-align: center;
}

.bar-container {
    height: 120px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 2rem;
}

.bar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    height: 100%;
}

.bar {
    width: 40px;
    min-height: 5px;
    border-radius: 8px 8px 0 0;
    transition: height 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.bar-name { font-size: 0.8rem; font-weight: 700; color: var(--text-main); margin-top: 5px; }

.ssy-bar { background: linear-gradient(to top, #db2777, #f472b6); }
.lic-bar { background: linear-gradient(to top, #1d4ed8, #60a5fa); }

.chart-label { 
    font-size: 0.8rem; 
    font-weight: 800; 
    text-transform: uppercase; 
    margin-bottom: 1.5rem; 
    color: var(--text-main); 
    letter-spacing: 0.05em;
}

/* Pie Chart */
.pie-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.pie-chart {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: conic-gradient(
        #db2777 0% 50%,
        #1d4ed8 50% 100%
    );
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: all 0.5s ease;
}

.pie-legend {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-align: left;
}

.legend-item { display: flex; align-items: center; gap: 0.4rem; }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.ssy-dot { background: #db2777; }
.lic-dot { background: #1d4ed8; }

/* Comparison Grid */
.comparison-grid.always-side-by-side {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.comp-card {
    position: relative;
    padding: 2.5rem 1.5rem 1.5rem;
    border-radius: 28px;
    background: #ffffff;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    border: 1px solid rgba(0,0,0,0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.comp-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.08);
}

.ssy-card { border-top: 6px solid var(--ssy-accent); background: linear-gradient(180deg, #fffcfd 0%, #fff 100%); }
.lic-card { border-top: 6px solid var(--lic-accent); background: linear-gradient(180deg, #fcfdff 0%, #fff 100%); }

.card-header {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.comp-card h2 { font-size: 1.4rem; color: var(--text-main); font-weight: 800; letter-spacing: -0.02em; }

.metrics-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.metric-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding: 1.25rem;
    background: #f8fafc;
    border-radius: 20px;
}

.metric {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.metric .label { font-size: 0.7rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.metric .value { font-size: 1.1rem; font-weight: 800; color: var(--text-main); }

.ssy-card .metric.highlight .value { color: var(--ssy-accent); }
.lic-card .metric.highlight .value { color: var(--lic-accent); }

.metric.highlight .value {
    font-size: 1.5rem;
}

.wealth-gain {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-radius: 16px;
    background: #fff;
    border: 1px dashed #e2e8f0;
}

.gain-label { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); }
.gain-value { font-size: 1rem; font-weight: 800; color: #10b981; }

.analysis-box {
    padding-top: 1.5rem;
    border-top: 1px solid #f1f5f9;
}

.analysis-box h4 { font-size: 0.8rem; text-transform: uppercase; color: var(--text-muted); margin-bottom: 1rem; letter-spacing: 0.05em; }

.small-list { list-style: none; display: flex; flex-direction: column; gap: 0.75rem; }
.small-list li { font-size: 0.85rem !important; font-weight: 500; color: #475569; display: flex; align-items: center; gap: 0.75rem; }
.small-list .icon { font-size: 1rem; width: 20px; text-align: center; }

/* Scenario Output */
.scenario-output {
    padding: 1.5rem;
    border-radius: 16px;
    margin-bottom: 1.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    min-height: 80px;
    display: flex;
    align-items: center;
}

.status-ok { background: #dcfce7; color: #166534; }
.status-shield { background: #dbeafe; color: #1e40af; border: 2px dashed #3b82f6; }
.status-danger { background: #fee2e2; color: #991b1b; animation: pulse 2s infinite; }

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* Simulation Switcher */
.simulation-toggle-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #ffffff;
    padding: 1.5rem;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.simulation-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    width: 100%;
}

.scenario-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    transition: all 0.3s ease;
    cursor: pointer;
}

#labelNormal { color: var(--primary-color); opacity: 1; }

.danger-btn {
    color: #ef4444;
    padding: 0.5rem 1rem;
    background: #fef2f2;
    border: 1px solid #fee2e2;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    opacity: 0.6;
}

.danger-btn:hover {
    background: #fee2e2;
    opacity: 1;
}

/* Active States */
input:checked ~ .slider + #labelLoss,
input:checked ~ #labelLoss {
    opacity: 1;
    background: #ef4444;
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 64px;
    height: 32px;
}

.toggle-switch input { opacity: 0; width: 0; height: 0; }

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #cbd5e1;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 24px; width: 24px;
    left: 4px; bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

input:checked + .slider { background-color: #ef4444; }
input:checked + .slider:before { transform: translateX(32px); }

/* Logic for highlighting active labels */
.simulation-container.loss-active #labelNormal { opacity: 0.5; color: var(--text-muted); }
.simulation-container:not(.loss-active) #labelNormal { color: var(--primary-color); opacity: 1; }
.simulation-container.loss-active .danger-btn { opacity: 1; background: #ef4444; color: white; box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2); }

/* Verdict */
.verdict-section {
    background: #1e293b;
    color: white;
}

.verdict-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.expert-badge {
    background: #fbbf24;
    color: #92400e;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
}

/* Guide Section */
.guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.guide-block {
    padding: 1.5rem;
    border-radius: 16px;
    background: #f8fafc;
}

.highlight-block {
    background: #f0f7ff;
    border: 2px solid var(--primary-color);
}

.block-num {
    font-size: 2rem;
    font-weight: 800;
    color: rgba(0,0,0,0.05);
    margin-bottom: -1rem;
}

/* Details Section */
.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.detail-card {
    background: #f8fafc;
    padding: 2rem;
    border-radius: 20px;
    display: flex;
    gap: 1.5rem;
}

/* FAQ Section */
.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 3rem;
}

.faq-item h3 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    color: var(--primary-color);
}

@media (max-width: 768px) {
    .comparison-grid.always-side-by-side { gap: 0.75rem; }
    .comp-card { padding: 1.5rem 0.75rem 1rem; border-radius: 20px; }
    .comp-card h2 { font-size: 0.9rem; }
    .metric-group { grid-template-columns: 1fr; gap: 0.75rem; }
    .visualizer-section { margin-top: 1rem; }
}
