/* ── Investitionsplaner ────────────────────────────────────── */

.ip-wrapper h2 { margin-bottom: 1.5rem; }

/* ── Balkendiagramm ─────────────────────────────────────────── */
.ip-chart { margin: 0 0 1.75rem; }

.ip-chart-bar {
    display: flex;
    height: 28px;
    border-radius: 14px;
    overflow: hidden;
    background: #e4e4e4;
}

/* Segmente */
.ip-bar-seg {
    height: 100%;
    transition: width .5s ease;
    min-width: 0;
    position: relative;
}

.ip-bar-kaufpreis          { background: var(--color-content-primary-grad, #1a3620); }
.ip-bar-notar              { background: var(--ip-notar, #4a7c59); }
.ip-bar-grundbuch          { background: var(--ip-grundbuch, #c9a227); }
.ip-bar-grunderwerbssteuer { background: var(--ip-grunderwerbssteuer, #c97b2e); }
.ip-bar-makler             { background: var(--ip-makler, #a84444); }

/* Provisionsfrei — kein Badge im Balken, nur in Legende */

/* Legende */
.ip-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem 1.2rem;
    margin-top: .75rem;
    font-size: .8rem;
    color: #555;
}

.ip-legend-item {
    display: flex;
    align-items: center;
    gap: .35rem;
}

.ip-legend-item::before {
    content: '';
    width: 11px; height: 11px;
    border-radius: 2px;
    display: inline-block;
    flex-shrink: 0;
}

.ip-legend-kaufpreis::before          { background: var(--color-content-primary-grad, #1a3620); }
.ip-legend-notar::before              { background: var(--ip-notar, #4a7c59); }
.ip-legend-grundbuch::before          { background: var(--ip-grundbuch, #c9a227); }
.ip-legend-grunderwerbssteuer::before { background: var(--ip-grunderwerbssteuer, #c97b2e); }
.ip-legend-makler::before             { background: var(--ip-makler, #a84444); }

/* Provisionsfrei-Legendeneintrag */
.ip-legend-provisionsfrei {
    display: flex;
    align-items: center;
    gap: .35rem;
    color: var(--ip-provisionsfrei, #217a33);
    font-weight: 600;
}

.ip-legend-provisionsfrei::before {
    content: '✓';
    font-size: .85rem;
    font-weight: 700;
}

/* ── Zeilen ─────────────────────────────────────────────────── */
.ip-rows { margin: 0 0 1.5rem; }

.ip-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .7rem 0;
    border-bottom: 1px solid #ececec;
}

.ip-row-toggle { cursor: pointer; user-select: none; }
.ip-row-toggle:hover .ip-label { color: var(--color-content-primary-grad, #1a3620); }

.ip-label {
    display: flex;
    align-items: center;
    gap: .45rem;
    font-size: .95rem;
}

.ip-toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: var(--color-content-primary-grad, #1a3620);
    color: #fff;
    font-size: 1.1rem;
    line-height: 1;
    transition: transform .3s ease;
    flex-shrink: 0;
}

.ip-row-toggle.ip-open .ip-toggle-icon { transform: rotate(45deg); }

.ip-value { font-weight: 500; white-space: nowrap; }

.ip-row-gesamt {
    border-top: 2px solid var(--color-content-primary-grad, #1a3620);
    border-bottom: 2px solid var(--color-content-primary-grad, #1a3620);
    padding: .75rem 0;
}

.ip-value-highlight {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--color-content-primary-grad, #1a3620);
}

/* ── Akkordeon ──────────────────────────────────────────────── */
.ip-accordion {
    max-height: 0;
    overflow: hidden;
    transition: max-height .4s ease;
}

.ip-accordion.ip-open { max-height: 600px; }

.ip-acc-inner {
    background: #f7f7f5;
    border-radius: 0 0 4px 4px;
    padding: .5rem 1rem .75rem;
    margin-bottom: .25rem;
}

.ip-acc-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .45rem 0;
    font-size: .88rem;
    border-bottom: 1px solid #ebebeb;
    gap: 1rem;
}

.ip-acc-row:last-child { border-bottom: none; }

/* Farbpunkt vor jeder Nebenkostenzeile */
.ip-acc-dot {
    display: inline-block;
    width: 10px; height: 10px;
    border-radius: 2px;
    margin-right: .4rem;
    flex-shrink: 0;
    vertical-align: middle;
}

.ip-dot-notar              { background: var(--ip-notar, #4a7c59); }
.ip-dot-grundbuch          { background: var(--ip-grundbuch, #c9a227); }
.ip-dot-grunderwerbssteuer { background: var(--ip-grunderwerbssteuer, #c97b2e); }
.ip-dot-makler             { background: var(--ip-makler, #a84444); }

/* 0%-Makler-Badge in der Akkordeon-Zeile */
.ip-badge-null {
    display: inline-block;
    background: var(--ip-provisionsfrei, #217a33);
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    letter-spacing: .02em;
    margin-left: .25rem;
    white-space: nowrap;
}

.ip-row-makler-null > span:first-child { color: var(--ip-provisionsfrei, #217a33); }

/* ── Inputs ─────────────────────────────────────────────────── */
.ip-input-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.ip-input {
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: .88rem;
    text-align: right;
    width: 110px;
}

.ip-input-s { width: 70px; }

.ip-input:focus {
    outline: none;
    border-color: var(--color-content-primary-grad, #1a3620);
}

/* ── Zusammenfassung ────────────────────────────────────────── */
.ip-summary {
    background: var(--color-content-primary-grad, #1a3620);
    color: #fff;
    border-radius: 4px;
    padding: 1rem 1.25rem;
}

.ip-sum-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .4rem 0;
    font-size: .88rem;
    border-bottom: 1px solid rgba(255,255,255,.12);
}

.ip-sum-row:last-child { border-bottom: none; }

.ip-sum-gesamt {
    font-weight: 700;
    font-size: .98rem;
    border-top: 1px solid rgba(255,255,255,.3);
    border-bottom: 1px solid rgba(255,255,255,.3);
    padding: .55rem 0;
    margin: .2rem 0;
}

@media (max-width: 640px) {
    .ip-chart-legend { gap: .5rem .9rem; }
    .ip-input { width: 85px; }
    .ip-bar-provisionsfrei { font-size: .62rem; padding: 0 7px; }
}
