/* ============================================
   SAVING RATE TOOL - SPECIFIC STYLES
   ============================================ */

/* Hero Section Overrides */
.tool-hero .container {
    max-width: 1400px;
    width: 85%;
    margin: 0 auto;
    padding: 0 32px;
}

.tool-hero .hero-content {
    text-align: center;
    margin-bottom: 48px;
}

.tool-hero .hero-content h1 {
    font-size: clamp(42px, 6vw, 64px);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--text-primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tool-hero .hero-subtitle {
    font-size: clamp(16px, 2vw, 20px);
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

.tool-hero-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 48px;
}

.feature-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 32px 24px;
    text-align: center;
    transition: var(--transition-smooth);
}

.feature-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.feature-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    background: rgba(124, 58, 237, 0.15);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature-icon i {
    font-size: 28px;
    color: var(--accent);
}

.feature-card h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 12px 0;
}

.feature-card p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* Form Sections Overrides for Savings Tool */
.form-section {
    padding: 56px 64px;
    margin-bottom: 48px;
}

.section-header {
    margin-bottom: 48px;
    padding-bottom: 28px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.section-header h2 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.section-header h2 i {
    color: var(--accent);
    font-size: 34px;
}

/* Mode Switcher */
.mode-switcher {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    max-width: 100%;
}

.mode-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.mode-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

.mode-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.3);
}

.mode-btn i {
    font-size: 18px;
}

/* Mode Content */
.mode-content {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    padding: 0;
}

/* Form Container - Zentral mit guter Breite */
.form-container {
    max-width: 2500px !important;
    width: 80% !important;
    margin: 0 auto;
    padding: 60px 0 20px !important;
}

/* Form Element sollte volle Breite nutzen */
#savingrate-form {
    width: 100%;
    max-width: 100%;
}

.mode-content.hidden {
    display: none;
}

/* Input Slider Group - Wider and Thinner */
.input-slider-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.input-slider-group input[type="range"] {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    outline: none;
    cursor: pointer;
}

.input-slider-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 40px;
    height: 24px;
    background: var(--accent);
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.input-slider-group input[type="range"]::-moz-range-thumb {
    width: 40px;
    height: 24px;
    background: var(--accent);
    border-radius: 12px;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: var(--transition-smooth);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.8);
}

.input-slider-group input[type="range"]:hover::-webkit-slider-thumb {
    transform: scale(1.1);
    box-shadow: 0 6px 18px rgba(124, 58, 237, 0.9);
    background: var(--accent-hover);
}

.input-slider-group input[type="range"]:hover::-moz-range-thumb {
    transform: scale(1.1);
    box-shadow: 0 6px 18px rgba(124, 58, 237, 0.9);
    background: var(--accent-hover);
}

.input-slider-group input[type="number"] {
    padding: 0 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 600;
    text-align: center !important;
    transition: var(--transition-smooth);
    width: 100%;
    height: 58px;
    line-height: 58px;
    -moz-appearance: textfield;
    appearance: textfield;
}

.input-slider-group input[type="number"]::-webkit-outer-spin-button,
.input-slider-group input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.input-slider-group input[type="number"]:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.15);
}

.input-slider-group input[type="number"]:disabled,
.input-slider-group input[type="range"]:disabled {
    cursor: not-allowed;
    opacity: 0.6;
    pointer-events: none;
}

.input-slider-group input[type="number"]:disabled {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-secondary);
    padding: 0 24px;
    text-align: center !important;
    line-height: 58px;
    height: 58px;
}

/* Disabled form group styling - gray out label too */
.form-group.disabled label,
.form-group.disabled label.label-no-icon {
    opacity: 0.6;
    color: var(--text-secondary);
    margin-bottom: 0px !important;
}

/* Keep disabled groups with same spacing */
.form-group.disabled {
    gap: 32px !important;
}

.form-group.disabled .input-slider-group {
    gap: 6px !important;
}

/* Full Width Form Group */
.form-group.full-width {
    grid-column: 1 / -1;
}

/* First form group in each section needs more top spacing */
.form-grid .form-group:first-child {
    margin-top: 8px;
}

/* Form Grid Improvements */
.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 45px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* Ensure both groups have spacing between label and input-slider-group */
#contrib-group,
#pension-group {
    gap: 40px !important;
}

/* Add spacing between Sparrate and Wunschrente */
#pension-group {
    margin-top: 24px;
}

#contrib-group.disabled,
#pension-group.disabled {
    gap: 40px !important;
}

/* Ensure pension input is centered */
#pension-group input[type="number"],
#monthly_pension {
    text-align: center !important;
    line-height: 58px !important;
    height: 58px !important;
    padding: 0 24px !important;
    margin-top: 0px;
}

/* Match gap between slider and input for all groups (same as Anlagehorizont) */
#contrib-group .input-slider-group,
#pension-group .input-slider-group,
#contrib-group.disabled .input-slider-group,
#pension-group.disabled .input-slider-group {
    gap: 6px !important;
}

/* Extra spacing for Anlagehorizont block */
#years-group {
    margin-top: 24px;
}

.form-group label {
    font-size: 19px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 0;
}

.form-group label.label-no-icon {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0px;
}

.form-group label i {
    color: var(--accent);
    font-size: 22px;
}

/* Toggles Row - Vertical Stack */
.toggles-row {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
    margin-top: 32px;
}

.button-texts {
    font-size: 32px;
}

.toggle-group {
    display: flex;
    align-items: center;
    gap: 24px;
    width: 100%;
}

.toggle-group > label:first-child,
.toggle-group > label.button-texts {
    font-weight: 800;
    color: var(--text-primary);
    font-size: 22px !important;
    flex: 1;
    letter-spacing: 0.5px;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 32px;
}

.toggle-switch.small {
    width: 44px;
    height: 24px;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    transition: var(--transition-smooth);
    border-radius: 28px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-secondary);
    transition: var(--transition-smooth);
    border-radius: 50%;
}

.toggle-switch.small .toggle-slider:before {
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--accent);
    border-color: var(--accent);
}

.toggle-switch input:checked + .toggle-slider:before {
    background-color: white;
    transform: translateX(28px);
}

.toggle-switch.small input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.toggle-switch input:focus + .toggle-slider {
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

.toggle-label {
    font-size: 15px;
    color: var(--text-secondary);
    user-select: none;
    font-weight: 500;
}

.toggle-group label:not(.toggle-switch) {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Rendite Button Group */
.return-buttons-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 0;
    margin-top: 0;
}

.return-buttons-group.compact {
    flex-direction: column;
    gap: 10px;
}

.return-btn {
    padding: 12px 24px;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    font-weight: 500;
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition-smooth);
    width: 100%;
    text-align: left;
    height: 50px;
    display: flex;
    align-items: center;
}

.return-buttons-group.compact {
    gap: 8px;
}

.return-buttons-group.compact .return-btn {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
}

.return-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateX(2px);
}

.return-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
    transform: translateX(0);
}

.variabel-slider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 8px;
    margin-bottom: 24px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    position: relative;
}

.variabel-slider.hidden {
    display: none !important;
}

.variabel-slider input[type="range"] {
    flex: 3;
}

.variabel-slider input[type="number"] {
    flex: 1;
    min-width: 70px;
    padding: 8px 30px 8px 12px;
    text-align: center;
    -moz-appearance: textfield;
    appearance: textfield;
}

.variabel-slider input[type="number"]::-webkit-outer-spin-button,
.variabel-slider input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.variabel-slider span {
    color: var(--text-secondary);
    font-weight: 500;
    position: absolute;
    right: 20px;
    pointer-events: none;
}

/* Solve-For Buttons */
.solve-for-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 0;
    margin-bottom: 32px;
}

.solve-btn {
    flex: 1;
    min-width: 180px;
    padding: 18px 24px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition-smooth);
    opacity: 0.6;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.solve-btn:hover {
    opacity: 0.8;
    background: rgba(255, 255, 255, 0.06);
}

.solve-btn.active {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border-color: #10b981;
    opacity: 1;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
}

/* Vergleichsmodus: 3 Spalten - Maximale Breite */
.compare-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
    max-width: 100%;
}

.compare-scenario {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px 16px;
}

.compare-scenario h3 {
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 20px;
    padding-bottom: 12px;
    color: var(--accent);
    text-align: center;
    border-bottom: 1px solid rgba(124, 58, 237, 0.3);
}

/* Compare Header Styling */
.compare-header h2 {
    font-size: 28px;
    text-align: center;
    justify-content: center;
    border-bottom: none !important;
    padding-bottom: 0 !important;
}

/* Kompaktere Form Section für Compare Mode */
#compare-mode .form-section {
    padding: 24px 16px;
    margin-bottom: 24px;
}

.compare-scenario .form-group {
    margin-bottom: 16px;
}

.compare-scenario .form-group:last-child {
    margin-bottom: 0;
}

.compare-scenario label {
    font-size: 18px !important;
    font-weight: 500;
    color: #ffffff;
    margin-bottom: 14px;
    display: block;
    line-height: 1.3;
}

.compare-scenario .form-group > label {
    font-size: 18px !important;
    font-weight: 500;
    color: #ffffff !important;
}

.compare-scenario input[type="number"],
.compare-scenario select {
    padding: 10px 12px;
    font-size: 14px;
    width: 100%;
}

.compare-scenario .input-slider-group {
    width: 100%;
    gap: 12px;
    flex-direction: row;
    align-items: center;
}

.compare-scenario .input-slider-group input[type="range"] {
    height: 5px;
    flex: 3;
}

.compare-scenario .input-slider-group input[type="range"]::-webkit-slider-thumb {
    width: 36px;
    height: 22px;
    background: var(--accent);
    border-radius: 11px;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.compare-scenario .input-slider-group input[type="range"]::-moz-range-thumb {
    width: 36px;
    height: 22px;
    background: var(--accent);
    border-radius: 11px;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: var(--transition-smooth);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.8);
}

.compare-scenario .input-slider-group input[type="range"]:hover::-webkit-slider-thumb {
    transform: scale(1.1);
    box-shadow: 0 6px 18px rgba(124, 58, 237, 0.9);
    background: var(--accent-hover);
}

.compare-scenario .input-slider-group input[type="range"]:hover::-moz-range-thumb {
    transform: scale(1.1);
    box-shadow: 0 6px 18px rgba(124, 58, 237, 0.9);
    background: var(--accent-hover);
}

.compare-scenario .input-slider-group input[type="number"] {
    padding: 8px 12px;
    font-size: 16px;
    flex: 1;
    min-width: 70px;
    height: 42px;
    text-align: center;
}

.compare-scenario .input-slider-group input[type="number"]::-webkit-outer-spin-button,
.compare-scenario .input-slider-group input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.toggles-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.toggle-group-compact {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: space-between;
}

.toggle-group-compact label {
    margin: 0;
    font-size: 100px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: 0.3px;
}

/* Reset Button - Cleaner Style */
.form-actions-small {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.btn-reset-small {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 40px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-reset-small:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-reset-small i {
    font-size: 14px;
}

/* Currency Select */
.currency-select {
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    color: var(--text-primary);
    font-size: 17px;
    cursor: pointer;
    transition: var(--transition-smooth);
    width: 100%;
    height: 58px;
}

.currency-select:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.currency-select option {
    background: #0f1530;
    color: var(--text-primary);
}

/* Scenario Mode Layout - Full Width Top, Results Below */
#scenario-mode {
    display: flex;
    flex-direction: column;
    gap: 40px;
    width: 100%;
}

/* Unified container for both input sections - matches results section width */
.inputs-unified-container {
    width: 100%;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 56px 40px;
}

.scenario-inputs-wrapper {
    width: 100%;
}

.scenario-inputs {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    width: 100%;
}

/* Remove padding from form-sections inside unified container to avoid double padding */
.inputs-unified-container .form-section {
    padding: 0;
    margin-bottom: 48px;
    background: transparent;
    border: none;
}

.inputs-unified-container .form-section:last-child {
    margin-bottom: 0;
}

#scenario-mode .form-actions-small {
    width: 100%;
}

/* Scenario Summary Section (between charts in compare mode) */
.scenario-summary-section {
    margin: 40px 0;
    padding: 0;
}

.summary-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 24px;
    text-align: left;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px 32px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.summary-title i {
    color: var(--accent);
    font-size: 30px;
}

.scenario-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 0;
}

.scenario-summary-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    transition: var(--transition-smooth);
}

.scenario-summary-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.2);
    border-color: rgba(124, 58, 237, 0.4);
}

.summary-card-header {
    background: rgba(124, 58, 237, 0.1);
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.summary-card-header h4 {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent);
    margin: 0;
    text-align: center;
}

.summary-card-content {
    padding: 20px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-label {
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.summary-label i {
    color: var(--accent);
    font-size: 16px;
}

.summary-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
}

.summary-value.highlight {
    font-size: 18px;
    color: var(--accent);
    font-weight: 700;
}

/* Results Section - 80% Breite */
#results-section {
    max-width: 2500px;
    width: 80%;
    margin: 40px auto;
    padding: 0;
}

.results-container {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 32px;
    margin-bottom: 32px;
}

.results-header {
    margin-bottom: 24px;
}

.results-header h2 {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.results-header h2 i {
    color: var(--accent);
}

/* Results Grid */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

/* Result Card */
.result-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition-smooth);
}

.result-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.card-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(124, 58, 237, 0.15);
    border-radius: 14px;
    flex-shrink: 0;
}

.card-icon i {
    font-size: 24px;
    color: var(--accent);
}

.card-content {
    flex: 1;
}

.card-content h3 {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin: 0 0 8px 0;
}

.card-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.card-content small {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Chart Wrapper */
.chart-wrapper {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 32px;
    margin-top: 24px;
}

.chart-wrapper h3 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 24px 0;
}

.chart-container {
    position: relative;
    height: 420px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    padding: 16px;
}

.chart-legend {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-secondary);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

/* Hidden Class */
.hidden {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 980px) {
    .tool-hero-features {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .feature-card {
        padding: 24px 20px;
    }

    .mode-switcher {
        flex-direction: column;
        gap: 8px;
    }

    .mode-btn {
        width: 100%;
    }

    .input-slider-group {
        grid-template-columns: 1fr;
    }

    .results-grid {
        grid-template-columns: 1fr;
    }

    .compare-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .scenario-summary-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .toggles-row {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }

    .return-buttons-group {
        flex-direction: column;
    }

    .return-btn {
        width: 100%;
    }

    .solve-for-buttons {
        flex-direction: column;
    }

    .solve-btn {
        width: 100%;
    }
}

/* ============================================
   TABLET OPTIMIZATIONS (768px - 1024px)
   ============================================ */
@media (min-width: 769px) and (max-width: 1024px) {
    /* Scenario Summary Grid - 2 columns on tablet, stacked better */
    .scenario-summary-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    /* Make third card full width */
    .scenario-summary-card:nth-child(3) {
        grid-column: 1 / -1;
        max-width: 50%;
        margin: 0 auto;
    }

    /* Better spacing for summary cards */
    .summary-card-header {
        padding: 20px;
    }

    .summary-card-header h4 {
        font-size: 22px;
    }

    .summary-card-content {
        padding: 24px;
    }

    .summary-item {
        padding: 14px 0;
    }

    .summary-label {
        font-size: 15px;
    }

    .summary-value {
        font-size: 17px;
    }

    /* Chart improvements for tablet */
    .chart-container {
        height: 450px;
        padding: 20px;
    }

    .chart-wrapper {
        padding: 28px 24px;
        margin-bottom: 32px;
    }

    .chart-wrapper h3 {
        font-size: 22px;
        margin-bottom: 20px;
    }

    /* Summary title better spacing */
    .summary-title {
        font-size: 26px;
        padding: 28px 36px;
    }

    /* Compare grid stays 3 columns but with better spacing */
    .compare-grid {
        gap: 20px;
    }

    /* Form sections better padding */
    .form-section {
        padding: 48px 40px;
    }
}

@media (max-width: 768px) {
    .tool-hero .container {
        padding: 0 20px;
    }

    .tool-hero .hero-content {
        margin-bottom: 32px;
    }

    .tool-hero-features {
        margin-top: 32px;
    }

    .feature-icon {
        width: 56px;
        height: 56px;
    }

    .feature-icon i {
        font-size: 24px;
    }

    .feature-card h3 {
        font-size: 18px;
    }

    .feature-card p {
        font-size: 14px;
    }

    /* Form Container - Full width and better mobile layout */
    .form-container {
        width: 100% !important;
        padding: 40px 16px 20px !important;
    }

    .form-section {
        padding: 32px 20px;
        margin-bottom: 24px;
        border-radius: 16px;
    }

    .section-header {
        margin-bottom: 32px;
        padding-bottom: 20px;
    }

    .section-header h2 {
        font-size: 22px;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    /* Input fields - Better mobile styling */
    .input-slider-group {
        gap: 16px;
    }

    .input-slider-group input[type="number"] {
        padding: 0 20px;
        font-size: 16px;
        height: 52px;
        border-radius: 12px;
    }

    .input-slider-group input[type="range"] {
        height: 8px;
    }

    .input-slider-group input[type="range"]::-webkit-slider-thumb {
        width: 36px;
        height: 22px;
    }

    .input-slider-group input[type="range"]::-moz-range-thumb {
        width: 36px;
        height: 22px;
    }

    /* Labels */
    .form-group label {
        font-size: 15px;
        margin-bottom: 12px;
    }

    /* Mode tabs - Full width buttons */
    .mode-tabs {
        flex-direction: column;
        gap: 12px;
    }

    .mode-tab {
        width: 100%;
        padding: 14px;
        font-size: 15px;
    }

    /* Submit button */
    .btn-primary {
        width: 100%;
        padding: 16px;
        font-size: 16px;
    }

    /* Results Section - Full width for mobile */
    #results-section {
        width: 100%;
        padding: 0 16px;
        margin: 20px auto;
    }

    .results-container {
        padding: 20px 16px;
        border-radius: 16px;
        margin-bottom: 24px;
    }

    .results-header h2 {
        font-size: 22px;
        margin-bottom: 16px;
    }

    /* Scenario Summary Cards - Stack vertically */
    .scenario-summary-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-bottom: 24px;
    }

    .scenario-summary-card {
        border-radius: 12px;
    }

    .summary-card-header {
        padding: 16px;
    }

    .summary-card-header h4 {
        font-size: 18px;
    }

    .summary-card-content {
        padding: 16px;
    }

    .summary-item {
        padding: 10px 0;
        flex-wrap: nowrap;
        gap: 12px;
    }

    .summary-label {
        font-size: 13px;
        flex: 1;
        min-width: 0;
    }

    .summary-value {
        font-size: 15px;
        flex-shrink: 0;
    }

    .summary-value.highlight {
        font-size: 16px;
    }

    /* Chart Containers - Taller and scrollable */
    .chart-container {
        height: 400px;
        padding: 16px 8px;
        margin-bottom: 24px;
        overflow-x: auto;
        overflow-y: hidden;
    }

    .chart-wrapper {
        padding: 16px 12px;
        border-radius: 12px;
        min-width: 100%;
    }

    .chart-wrapper h3 {
        font-size: 17px;
        margin-bottom: 16px;
        text-align: center;
    }

    .chart-legend {
        gap: 12px;
        font-size: 12px;
        flex-wrap: wrap;
        justify-content: center;
    }

    /* Result Cards - Better spacing */
    .result-card {
        padding: 20px 16px;
        margin-bottom: 16px;
        border-radius: 12px;
    }

    .card-icon {
        width: 52px;
        height: 52px;
    }

    .card-icon i {
        font-size: 22px;
    }

    .card-value {
        font-size: 22px;
        margin: 12px 0 8px 0;
    }

    .card-label {
        font-size: 13px;
    }

    /* Compare Mode - Better layout */
    .comparison-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .comparison-chart-container {
        height: 420px;
        padding: 16px;
        margin-bottom: 24px;
    }

    /* Tabs for mobile */
    .mode-tabs {
        flex-direction: column;
        gap: 12px;
        padding: 16px;
    }

    .mode-tab {
        width: 100%;
        padding: 14px;
        font-size: 15px;
    }

    /* Detail Cards */
    .detail-card {
        padding: 18px;
        margin-bottom: 16px;
        border-radius: 12px;
    }

    .detail-card h4 {
        font-size: 17px;
        margin-bottom: 12px;
    }

    .detail-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .detail-item {
        padding: 10px 12px;
    }

    .detail-label {
        font-size: 13px;
    }

    .detail-value {
        font-size: 15px;
    }

    /* Scenario Detail Section */
    .scenario-detail {
        padding: 20px 16px;
        margin-bottom: 20px;
        border-radius: 12px;
    }

    .scenario-detail h3 {
        font-size: 19px;
        margin-bottom: 16px;
    }

    /* Make charts touch-friendly */
    canvas {
        touch-action: pan-x pan-y;
    }

    /* Improve scrolling hints for charts */
    .chart-container::after {
        content: '';
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        width: 30px;
        background: linear-gradient(to left, rgba(17, 24, 39, 0.8), transparent);
        pointer-events: none;
        opacity: 0.5;
    }
}

/* Extra Small Mobile Devices */
@media (max-width: 480px) {
    /* Even more compact spacing for small phones */
    #results-section {
        padding: 0 12px;
        margin: 16px auto;
    }

    .results-container {
        padding: 16px 12px;
        border-radius: 12px;
    }

    .results-header h2 {
        font-size: 20px;
        margin-bottom: 12px;
    }

    /* Scenario cards - more compact */
    .scenario-summary-grid {
        gap: 16px;
    }

    .summary-card-header {
        padding: 14px;
    }

    .summary-card-header h4 {
        font-size: 16px;
    }

    .summary-card-content {
        padding: 14px;
    }

    .summary-item {
        padding: 8px 0;
        gap: 8px;
    }

    .summary-label {
        font-size: 12px;
    }

    .summary-value {
        font-size: 14px;
    }

    .summary-value.highlight {
        font-size: 15px;
    }

    /* Charts - optimized for small screens */
    .chart-container {
        height: 350px;
        padding: 12px 6px;
        margin-bottom: 20px;
    }

    .chart-wrapper {
        padding: 12px 8px;
    }

    .chart-wrapper h3 {
        font-size: 16px;
        margin-bottom: 12px;
    }

    .chart-legend {
        gap: 10px;
        font-size: 11px;
    }

    /* Result cards - more compact */
    .result-card {
        padding: 16px 12px;
        margin-bottom: 14px;
    }

    .card-icon {
        width: 48px;
        height: 48px;
    }

    .card-icon i {
        font-size: 20px;
    }

    .card-value {
        font-size: 20px;
        margin: 10px 0 6px 0;
    }

    .card-label {
        font-size: 12px;
    }

    /* Comparison charts */
    .comparison-chart-container {
        height: 380px;
        padding: 12px;
    }

    /* Mode tabs - compact */
    .mode-tabs {
        gap: 10px;
        padding: 12px;
    }

    .mode-tab {
        padding: 12px;
        font-size: 14px;
    }

    /* Detail cards - compact */
    .detail-card {
        padding: 16px 12px;
        margin-bottom: 14px;
    }

    .detail-card h4 {
        font-size: 16px;
        margin-bottom: 10px;
    }

    .detail-item {
        padding: 8px 10px;
    }

    .detail-label {
        font-size: 12px;
    }

    .detail-value {
        font-size: 14px;
    }

    /* Scenario details */
    .scenario-detail {
        padding: 16px 12px;
        margin-bottom: 16px;
    }

    .scenario-detail h3 {
        font-size: 18px;
        margin-bottom: 14px;
    }
}
