/* TP Risk Finanzierungsrechner - Theme-kompatibel & Responsive */

/* ═══════════════════════════════════════════
   BASE STYLES
   ═══════════════════════════════════════════ */

#tpfr-wrapper {
    font-family: inherit;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    color: inherit;
    line-height: inherit;
    font-size: inherit;
}
#tpfr-wrapper * { box-sizing: border-box; }
#tpfr-wrapper h1, #tpfr-wrapper h2, #tpfr-wrapper h3 {
    margin-top: 0;
    font-family: inherit;
    color: inherit;
}

/* ═══════════════════════════════════════════
   HERO - TP Risk Style
   ═══════════════════════════════════════════ */

.tpfr-hero {
    background: linear-gradient(135deg, #156266 0%, #1e2a5e 55%, #8b1c8d 100%);
    color: #fff;
    padding: 128px 40px 128px;
    text-align: center;
    border-radius: 0;
    margin-bottom: 36px;
	margin-top: 0px;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    padding-left: calc(50vw - 50% + 40px);
    padding-right: calc(50vw - 50% + 40px);
    position: relative;
    overflow: hidden;
}
.tpfr-hero::before {
    content: none;
}
.tpfr-hero h1 {
    font-size: 2.1em;
    font-weight: 700;
    margin-bottom: 12px;
    color: #fff;
    letter-spacing: -0.02em;
    line-height: 1.2;
    position: relative;
}
.tpfr-hero p {
    font-size: 1.05em;
    color: rgba(255,255,255,0.92);
    margin-bottom: 28px;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
    position: relative;
}
/* Marktdaten-Badges im Hero */
.tpfr-market-info {
    display: inline-flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    position: relative;
}
.tpfr-market-info span {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 10px;
    padding: 10px 18px;
    min-width: 130px;
    backdrop-filter: blur(4px);
}
.tpfr-market-label {
    font-size: 0.72em;
    color: rgba(255,255,255,0.78);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    display: block;
}
.tpfr-market-info strong {
    display: block;
    font-size: 1.25em;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}

/* ═══════════════════════════════════════════
   TABS
   ═══════════════════════════════════════════ */

.tpfr-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #eee;
    margin-bottom: 30px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.tpfr-tab {
    background: none;
    border: none;
    padding: 12px 24px;
    font-size: inherit;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}
.tpfr-tab:hover { color: #156266; background: rgba(21,98,102,0.06); }
.tpfr-tab.active {
    color: #8b1c8d;
    border-bottom-color: #8b1c8d;
    background: transparent;
    font-weight: 700;
}

/* ═══════════════════════════════════════════
   TAB CONTENT
   ═══════════════════════════════════════════ */

.tpfr-tab-content { display: none; }
.tpfr-tab-content.active { display: block; }

/* ═══════════════════════════════════════════
   TWO-COLUMN LAYOUT
   ═══════════════════════════════════════════ */

.tpfr-layout {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 60px;
    align-items: start;
}

/* Input Column */
.tpfr-input-column h2 {
    font-family: inherit;
    font-size: inherit;
    color: var(--tpfr-primary);
    margin-bottom: 25px;
}

/* Result Column */
.tpfr-result-column h2 {
    font-family: inherit;
    font-size: inherit;
    color: var(--tpfr-primary);
    margin-bottom: 20px;
}

/* ═══════════════════════════════════════════
   SLIDER GROUPS
   ═══════════════════════════════════════════ */

.tpfr-slider-group { margin-bottom: 22px; }
.tpfr-slider-group label {
    font-family: inherit;
    font-weight: 600;
    display: block;
    margin-bottom: 8px;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: inherit;
}
.tpfr-slider-row { display: flex; align-items: center; gap: 15px; }
.tpfr-slider-row input[type="range"] {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: #e0e0e0;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    min-width: 0;
}
.tpfr-slider-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--tpfr-primary);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.tpfr-slider-row input[type="range"]::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--tpfr-primary);
    cursor: pointer;
    border: none;
}
.tpfr-value-input {
    width: 130px;
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-family: inherit;
    font-size: inherit;
    font-weight: 600;
    text-align: right;
    color: inherit;
    background: #fff;
    flex-shrink: 0;
}
.tpfr-value-input:focus { border-color: var(--tpfr-primary); outline: none; }
.tpfr-range-labels { display: flex; justify-content: space-between; font-size: 0.8em; color: #999; margin-top: 5px; }

/* ═══════════════════════════════════════════
   MARKET RATES
   ═══════════════════════════════════════════ */

.tpfr-market-rates { margin: 25px 0; padding-top: 20px; border-top: 1px solid #eee; }
.tpfr-market-rates h3 {
    font-family: inherit;
    font-size: 0.9em;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: inherit;
}
.tpfr-rate-buttons { display: flex; gap: 8px; flex-wrap: wrap; }

/* Rate Buttons */
.tpfr-rate-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 80px;
    color: inherit;
    font-family: inherit;
    font-size: inherit;
}
.tpfr-rate-btn:hover {
    border-color: #156266;
    background: rgba(21,98,102,0.07);
    color: #156266;
}
.tpfr-rate-btn.active {
    background: #8b1c8d;
    border-color: #8b1c8d;
    color: #fff;
}
.tpfr-rate-btn.active .tpfr-rate-value,
.tpfr-rate-btn.active .tpfr-rate-label { color: #fff !important; opacity: 1; }
.tpfr-rate-value { font-weight: 700; font-size: 0.95em; color: inherit; }
.tpfr-rate-label { font-size: 0.75em; opacity: 0.7; margin-top: 2px; color: inherit; }

/* ═══════════════════════════════════════════
   DISCLAIMER
   ═══════════════════════════════════════════ */

.tpfr-disclaimer {
    background: #fff8e1;
    border-left: 4px solid var(--tpfr-secondary);
    padding: 12px 16px;
    font-size: 0.85em;
    margin: 20px 0;
    border-radius: 4px;
    color: #666;
}

/* ═══════════════════════════════════════════
   EZB-ZINSENTWICKLUNG
   ═══════════════════════════════════════════ */

.tpfr-ezb-section {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    margin: 20px 0;
}
.tpfr-ezb-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: #fff;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    font-weight: 700;
    color: var(--tpfr-primary);
    transition: background 0.2s;
}
.tpfr-ezb-toggle:hover { background: rgba(21,98,102,0.06); color: #0d4245; }
.tpfr-toggle-arrow { font-size: 1.1em; }
#tpfr-ezb-wrapper {
    padding: 0 18px 18px;
    border-top: 1px solid #eee;
}
.tpfr-ezb-info { font-size: 0.85em; color: #666; margin: 15px 0; }
.tpfr-ezb-chart-container { margin: 15px 0; }
.tpfr-ezb-table { margin-top: 15px; min-width: 0 !important; }
.tpfr-ezb-table th, .tpfr-ezb-table td { white-space: normal; }
.tpfr-ezb-table th:last-child, .tpfr-ezb-table td:last-child { text-align: right; font-weight: 600; color: var(--tpfr-primary); }
.tpfr-ezb-disclaimer { font-size: 0.75em; color: #999; margin-top: 10px; }

/* ═══════════════════════════════════════════
   RESULTS
   ═══════════════════════════════════════════ */

.tpfr-results { margin: 20px 0 25px; }
.tpfr-result-main {
    background: var(--tpfr-primary);
    color: #fff;
    padding: 22px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 12px;
}
.tpfr-result-main .tpfr-result-label { font-size: 0.75em; text-transform: uppercase; letter-spacing: 1px; display: block; font-family: inherit; }
.tpfr-result-main .tpfr-result-value { font-size: 2em; font-weight: 700; display: block; margin: 6px 0; font-family: inherit; }
.tpfr-result-main .tpfr-result-sub { font-size: 0.85em; opacity: 0.8; }
.tpfr-result-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tpfr-result-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    background: #fff;
}
.tpfr-result-card-label { font-size: 0.7em; text-transform: uppercase; letter-spacing: 0.5px; color: #666; display: block; font-family: inherit; }
.tpfr-result-card-value { font-size: 1.2em; font-weight: 700; display: block; margin: 5px 0; color: var(--tpfr-primary); font-family: inherit; }
.tpfr-result-card-sub { font-size: 0.75em; color: #999; }

/* ═══════════════════════════════════════════
   FINANZIERUNGSSTRUKTUR
   ═══════════════════════════════════════════ */

.tpfr-struktur-box {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    background: #fff;
}
.tpfr-struktur-box h3 { font-family: inherit; font-size: inherit; margin-bottom: 15px; color: var(--tpfr-primary); }
.tpfr-struktur-layout { display: flex; align-items: center; gap: 20px; }
.tpfr-chart-container-small { width: 150px; height: 150px; flex-shrink: 0; }
.tpfr-struktur-details { flex: 1; min-width: 0; }
.tpfr-struktur-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 0.85em;
    flex-wrap: wrap;
}
.tpfr-struktur-row.tpfr-struktur-total {
    background: #eef4f9;
    border: 2px solid var(--tpfr-primary);
    font-weight: 700;
}
.tpfr-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.tpfr-struktur-label { flex: 1; min-width: 100px; }
.tpfr-struktur-value { font-weight: 700; color: var(--tpfr-primary); }
.tpfr-struktur-pct { font-size: 0.8em; color: #999; min-width: 35px; text-align: right; }

/* ═══════════════════════════════════════════
   CHARTS
   ═══════════════════════════════════════════ */

.tpfr-chart-box {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    background: #fff;
}
.tpfr-chart-box h3 { font-family: inherit; font-size: inherit; margin-bottom: 15px; color: var(--tpfr-primary); }
.tpfr-chart-container-large { position: relative; height: 280px; }

/* ═══════════════════════════════════════════
   TILGUNGSPLAN
   ═══════════════════════════════════════════ */

.tpfr-tilgungsplan { margin: 20px 0; }
.tpfr-tilgungsplan-header {
    background: var(--tpfr-primary);
    color: #fff;
    padding: 14px 18px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.tpfr-tilgungsplan-header h3 { color: #fff; margin: 0; font-family: inherit; font-size: inherit; }
.tpfr-tp-toggle {
    display: flex;
    gap: 4px;
    background: rgba(255,255,255,0.15);
    border-radius: 6px;
    padding: 3px;
}
.tpfr-tp-toggle-btn {
    padding: 6px 14px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: rgba(255,255,255,0.7);
    font-family: inherit;
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.tpfr-tp-toggle-btn:hover {
    color: #fff;
    background: rgba(255,255,255,0.18);
}
.tpfr-tp-toggle-btn.active {
    background: #8b1c8d;
    color: #fff;
    font-weight: 700;
}
#tpfr-tilgungsplan-wrapper {
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-height: 500px;
    overflow-y: auto;
}

/* ═══════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════ */

.tpfr-table { width: 100%; border-collapse: collapse; font-size: 0.85em; font-family: inherit; min-width: 500px; }
.tpfr-table th, .tpfr-table td { padding: 8px 10px; text-align: right; border-bottom: 1px solid #eee; white-space: nowrap; }
.tpfr-table th { background: var(--tpfr-primary); color: #fff; font-weight: 600; text-align: right; position: sticky; top: 0; z-index: 1; }
.tpfr-table td:first-child, .tpfr-table th:first-child { text-align: left; }
.tpfr-table-total td { border-top: 2px solid var(--tpfr-primary); font-weight: 700; }
.tpfr-table tbody tr:hover { background: rgba(21,98,102,0.06); color: inherit; }

/* ═══════════════════════════════════════════
   NEBENKOSTEN
   ═══════════════════════════════════════════ */

.tpfr-nk-intro { font-size: 0.9em; margin-bottom: 20px; }
.tpfr-nk-summary { margin-top: 20px; background: #f8f9fa; border-radius: 8px; padding: 15px; }
.tpfr-nk-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 0.9em; }
.tpfr-nk-row.tpfr-nk-total { border-top: 2px solid var(--tpfr-primary); padding-top: 10px; margin-top: 6px; font-weight: 700; color: var(--tpfr-primary); }
.tpfr-nk-section-title {
    font-size: 0.95em;
    font-weight: 700;
    color: var(--tpfr-primary);
    margin: 0 0 10px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--tpfr-primary);
    font-family: inherit;
}
.tpfr-nk-finanz-hint {
    font-size: 0.82em;
    color: #666;
    margin: -4px 0 10px;
    font-style: italic;
}
.tpfr-nk-hinweis {
    margin-top: 20px;
    padding: 12px 16px;
    background: #fff8f0;
    border-left: 4px solid var(--tpfr-secondary);
    border-radius: 4px;
    font-size: 0.85em;
    color: #555;
}

/* ═══════════════════════════════════════════
   MAKLER TOGGLE
   ═══════════════════════════════════════════ */

.tpfr-makler-toggle { margin-bottom: 20px; background: #fff; padding: 12px 16px; border-radius: 8px; border: 1px solid #e0e0e0; }
.tpfr-toggle-label { display: flex; align-items: center; gap: 12px; cursor: pointer; font-size: 0.9em; font-family: inherit; }
.tpfr-toggle-label input[type="checkbox"] { display: none; }
.tpfr-toggle-switch {
    position: relative;
    width: 36px;
    height: 20px;
    background: #ccc;
    border-radius: 10px;
    transition: background 0.3s;
    flex-shrink: 0;
}
.tpfr-toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.3s;
}
.tpfr-toggle-label input:checked + .tpfr-toggle-switch { background: var(--tpfr-primary); }
.tpfr-toggle-label input:checked + .tpfr-toggle-switch::after { transform: translateX(16px); }

/* ═══════════════════════════════════════════
   EIGENMITTEL TAB
   ═══════════════════════════════════════════ */

.tpfr-eigenmittel-info {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}
.tpfr-eigenmittel-info h2 { font-family: inherit; font-size: inherit; color: var(--tpfr-primary); margin-bottom: 10px; }
.tpfr-eigenmittel-info p { font-size: 0.9em; }
.tpfr-eigenmittel-detail {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
}
.tpfr-eigenmittel-detail h3 { font-family: inherit; font-size: inherit; color: var(--tpfr-primary); margin-bottom: 10px; }
.tpfr-ek-scale { font-size: 0.85em; margin-bottom: 12px; }
.tpfr-ek-hint { font-size: 0.85em; color: #666; background: #fff; padding: 10px; border-radius: 6px; border-left: 3px solid var(--tpfr-secondary); }

/* Eigenmittel Results */
.tpfr-eigenmittel-result { margin-top: 15px; }
.tpfr-ek-info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}
.tpfr-ek-info-row strong { color: var(--tpfr-primary); }
.tpfr-ek-quote-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    margin-top: 8px;
}
.tpfr-ek-quote-box strong { font-size: 1.2em; color: var(--tpfr-primary); }
.tpfr-ek-bar { height: 12px; background: #e0e0e0; border-radius: 6px; overflow: hidden; margin-top: 8px; }
.tpfr-ek-bar-fill { height: 100%; background: var(--tpfr-primary); border-radius: 6px; transition: width 0.3s; }

/* ═══════════════════════════════════════════
   CTA - TP Risk Style
   ═══════════════════════════════════════════ */

.tpfr-cta {
    background: linear-gradient(160deg, #0d4245 0%, #156266 60%, #1a7a7f 100%);
    color: #fff;
    padding: 56px 40px 40px;
    text-align: center;
    border-radius: 0;
    margin: 48px 0 0;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    padding-left: calc(50vw - 50% + 40px);
    padding-right: calc(50vw - 50% + 40px);
    position: relative;
    overflow: hidden;
}
.tpfr-cta::before {
    content: none;
}
.tpfr-cta h2 {
    color: #fff;
    margin-bottom: 12px;
    font-family: inherit;
    font-size: 1.7em;
    font-weight: 700;
    letter-spacing: -0.01em;
    position: relative;
}
.tpfr-cta p {
    color: rgba(255,255,255,0.90);
    margin-bottom: 28px;
    font-size: 1.05em;
    line-height: 1.6;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
}
.tpfr-cta-buttons {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    position: relative;
}
/* CTA-Buttons: exakt wie Kadence-Buttons auf TP Risk Website */
.tpfr-cta-btn-primary,
.tpfr-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: #8b1c8d;
    border: none;
    border-radius: 24px;
    color: #fff !important;
    text-decoration: none;
    font-family: inherit;
    font-size: 1em;
    font-weight: 600;
    letter-spacing: normal;
    transition: background 0.2s, transform 0.15s;
    cursor: pointer;
    position: relative;
    z-index: 1;
}
.tpfr-cta-btn-primary:hover,
.tpfr-cta-btn:hover {
    background: #a022a3;
    color: #fff !important;
    transform: translateY(-1px);
    text-decoration: none;
}
.tpfr-cta-btn-primary:active,
.tpfr-cta-btn:active {
    background: #6e1570;
    color: #fff !important;
    transform: translateY(0);
}
/* Sekundärer CTA-Button: Outline weiß */
.tpfr-cta-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: transparent;
    border: 2px solid rgba(255,255,255,0.85);
    border-radius: 24px;
    color: #fff !important;
    text-decoration: none;
    font-family: inherit;
    font-size: 1em;
    font-weight: 600;
    transition: background 0.2s, border-color 0.2s, transform 0.15s;
    cursor: pointer;
    position: relative;
    z-index: 1;
}
.tpfr-cta-btn-secondary:hover {
    background: rgba(255,255,255,0.15);
    border-color: #fff;
    color: #fff !important;
    transform: translateY(-1px);
    text-decoration: none;
}
.tpfr-cta-btn-secondary:active {
    background: rgba(255,255,255,0.25);
    color: #fff !important;
    transform: translateY(0);
}

.tpfr-cta-contact {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    margin-top: 20px;
    position: relative;
    z-index: 1;
}
.tpfr-cta-contact-link {
    color: rgba(255,255,255,0.85) !important;
    text-decoration: none;
    font-size: 0.95em;
    transition: color 0.2s;
}
.tpfr-cta-contact-link:hover {
    color: #fff !important;
    text-decoration: none;
}

/* ═══════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════ */

.tpfr-footer {
    text-align: center;
    font-size: 0.8em;
    color: rgba(255,255,255,0.65);
    padding: 24px 0;
    margin-top: 24px;

    border-top: 1px solid rgba(255,255,255,0.2);
}

/* ═══════════════════════════════════════════
   RESPONSIVE: TABLET (768px - 1024px)
   ═══════════════════════════════════════════ */

@media (max-width: 1024px) {
    .tpfr-layout {
        grid-template-columns: 1fr 1fr;
        gap: 30px;
    }

    .tpfr-hero { padding: 40px 20px 32px; }
    .tpfr-hero h1 { font-size: 1.7em; }
    .tpfr-cta { padding: 44px 20px 36px; }

    .tpfr-result-main .tpfr-result-value { font-size: 1.7em; }

    .tpfr-chart-container-small { width: 120px; height: 120px; }

    .tpfr-chart-container-large { height: 240px; }
}

/* ═══════════════════════════════════════════
   RESPONSIVE: SMALL TABLET / LARGE MOBILE (600px - 768px)
   ═══════════════════════════════════════════ */

@media (max-width: 768px) {
    #tpfr-wrapper { padding: 0 10px; }

    .tpfr-layout {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .tpfr-hero { padding: 32px 15px 28px; }
    .tpfr-hero h1 { font-size: 1.5em; }
    .tpfr-hero p { font-size: 0.92em; }
    .tpfr-market-info { gap: 8px; }
    .tpfr-market-info span { min-width: 110px; padding: 8px 12px; }
    .tpfr-market-label { font-size: 0.68em; }
    .tpfr-market-info strong { font-size: 1.1em; }

    /* Tabs scrollbar */
    .tpfr-tabs { margin-bottom: 20px; }
    .tpfr-tab { padding: 10px 16px; font-size: 0.85em; }

    /* Result cards: 1 column on small tablet */
    .tpfr-result-cards { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
    .tpfr-result-card { padding: 10px 8px; }
    .tpfr-result-card-value { font-size: 1em; }
    .tpfr-result-card-label { font-size: 0.6em; }

    /* Finanzierungsstruktur */
    .tpfr-struktur-layout { flex-direction: column; gap: 15px; }
    .tpfr-chart-container-small { width: 140px; height: 140px; }

    /* Chart */
    .tpfr-chart-container-large { height: 220px; }
    .tpfr-chart-box { padding: 15px; }

    /* Tilgungsplan header */
    .tpfr-tilgungsplan-header { padding: 12px 14px; }
    .tpfr-tilgungsplan-header h3 { font-size: 0.85em; }

    /* Rate buttons */
    .tpfr-rate-btn { min-width: 65px; padding: 8px 10px; }
    .tpfr-rate-value { font-size: 0.85em; }
    .tpfr-rate-label { font-size: 0.65em; }

    /* CTA */
    .tpfr-cta { padding: 30px 15px; }
    .tpfr-cta h2 { font-size: 1.3em; }
    .tpfr-cta-buttons { flex-direction: column; align-items: center; }
    .tpfr-cta-btn, .tpfr-cta-btn-primary, .tpfr-cta-btn-secondary { width: 100%; max-width: 320px; text-align: center; justify-content: center; }
}

/* ═══════════════════════════════════════════
   RESPONSIVE: MOBILE (< 480px)
   ═══════════════════════════════════════════ */

@media (max-width: 480px) {
    #tpfr-wrapper { padding: 0 8px; }

    .tpfr-hero { padding: 24px 12px 20px; margin-bottom: 20px; }
    .tpfr-hero h1 { font-size: 1.3em; }
    .tpfr-hero p { font-size: 0.85em; margin-bottom: 18px; }
    .tpfr-market-info { flex-direction: row; gap: 6px; align-items: stretch; justify-content: center; }
    .tpfr-market-info span { min-width: 90px; padding: 7px 10px; }
    .tpfr-market-label { font-size: 0.62em; }
    .tpfr-market-info strong { font-size: 1em; }

    /* Tabs: smaller */
    .tpfr-tab { padding: 8px 12px; font-size: 0.8em; }

    /* Slider row: stack on very small screens */
    .tpfr-slider-row { flex-direction: column; align-items: stretch; gap: 10px; }
    .tpfr-value-input { width: 100%; text-align: center; }

    /* Result main */
    .tpfr-result-main { padding: 16px; }
    .tpfr-result-main .tpfr-result-value { font-size: 1.5em; }
    .tpfr-result-main .tpfr-result-label { font-size: 0.65em; }

    /* Result cards: stack on mobile */
    .tpfr-result-cards { grid-template-columns: 1fr; gap: 8px; }
    .tpfr-result-card { padding: 12px; }
    .tpfr-result-card-value { font-size: 1.1em; }

    /* Finanzierungsstruktur */
    .tpfr-struktur-box { padding: 15px; }
    .tpfr-chart-container-small { width: 120px; height: 120px; }
    .tpfr-struktur-row { font-size: 0.8em; padding: 6px 8px; }

    /* Chart */
    .tpfr-chart-container-large { height: 180px; }
    .tpfr-chart-box { padding: 12px; }

    /* Tilgungsplan */
    .tpfr-tilgungsplan-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 10px 12px;
    }
    .tpfr-tilgungsplan-header h3 { font-size: 0.8em; }
    .tpfr-tp-toggle-btn { padding: 5px 10px; font-size: 0.75em; }
    #tpfr-tilgungsplan-wrapper { max-height: 400px; }
    .tpfr-table { font-size: 0.75em; min-width: 450px; }
    .tpfr-table th, .tpfr-table td { padding: 6px 6px; }

    /* Rate buttons: 2 per row */
    .tpfr-rate-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
    .tpfr-rate-btn { min-width: unset; }

    /* EZB */
    .tpfr-ezb-toggle { padding: 10px 12px; font-size: 0.9em; }
    #tpfr-ezb-wrapper { padding: 0 12px 12px; }

    /* Eigenmittel */
    .tpfr-eigenmittel-info { padding: 15px; }
    .tpfr-eigenmittel-detail { padding: 15px; }
    .tpfr-ek-info-row { font-size: 0.85em; }
    .tpfr-ek-scale { font-size: 0.75em; }

    /* CTA */
    .tpfr-cta { padding: 24px 12px; }
    .tpfr-cta h2 { font-size: 1.15em; }
    .tpfr-cta-btn, .tpfr-cta-btn-primary, .tpfr-cta-btn-secondary { padding: 12px 20px; font-size: 0.95em; }

    /* Disclaimer */
    .tpfr-disclaimer { padding: 10px 12px; font-size: 0.8em; }

    /* Nebenkosten */
    .tpfr-nk-row { font-size: 0.8em; }
    .tpfr-makler-toggle { padding: 10px 12px; }
    .tpfr-toggle-label { font-size: 0.8em; gap: 8px; }
}

/* ═══════════════════════════════════════════
   TOUCH OPTIMIZATIONS
   ═══════════════════════════════════════════ */

@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets for mobile */
    .tpfr-slider-row input[type="range"]::-webkit-slider-thumb {
        width: 28px;
        height: 28px;
    }
    .tpfr-slider-row input[type="range"]::-moz-range-thumb {
        width: 28px;
        height: 28px;
    }
    .tpfr-slider-row input[type="range"] {
        height: 8px;
    }
    .tpfr-tab { padding: 12px 16px; }
    .tpfr-rate-btn { padding: 12px 14px; min-height: 44px; }
    .tpfr-tp-toggle-btn { padding: 8px 14px; min-height: 36px; }
    .tpfr-ezb-toggle { min-height: 48px; }
    .tpfr-toggle-switch { width: 44px; height: 24px; }
    .tpfr-toggle-switch::after { width: 20px; height: 20px; }
    .tpfr-toggle-label input:checked + .tpfr-toggle-switch::after { transform: translateX(20px); }
}

/* ═══════════════════════════════════════════
   PRINT STYLES
   ═══════════════════════════════════════════ */

@media print {
    .tpfr-hero { background: #333 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .tpfr-layout { grid-template-columns: 1fr 1fr; gap: 20px; }
    .tpfr-tabs, .tpfr-ezb-section, .tpfr-cta, .tpfr-tp-toggle { display: none; }
    #tpfr-tilgungsplan-wrapper { max-height: none; overflow: visible; }
    .tpfr-chart-container-large { height: 200px; }
}
