.tp-dl-calculator {
    --tp-primary: #2563eb;
    --tp-primary-dark: #1d4ed8;
    --tp-text: #172033;
    --tp-muted: #64748b;
    --tp-border: #e2e8f0;
    --tp-bg: #f8fafc;
    --tp-card: #ffffff;
    width: 100%;
    max-width: 1100px;
    margin: 30px auto;
    color: var(--tp-text);
    font-family: inherit;
    box-sizing: border-box;
}

.tp-dl-calculator *,
.tp-dl-calculator *::before,
.tp-dl-calculator *::after {
    box-sizing: border-box;
}

.tp-dl-header {
    margin-bottom: 28px;
}

.tp-dl-eyebrow {
    display: inline-block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--tp-primary);
    text-transform: uppercase;
    letter-spacing: .06em;
}

.tp-dl-header h2 {
    margin: 0 0 10px;
    font-size: clamp(28px, 4vw, 40px);
    line-height: 1.15;
}

.tp-dl-header p {
    margin: 0;
    max-width: 760px;
    color: var(--tp-muted);
    line-height: 1.65;
}

.tp-dl-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    padding: 24px;
    background: var(--tp-bg);
    border: 1px solid #000;
    border-radius: 16px;
}

.tp-dl-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    font-size: 15px;
}


.tp-dl-example {
    color: var(--tp-muted);
    font-size: 12px;
    font-weight: 400;
}

.tp-dl-input-group {
    display: flex;
    width: 100%;
}

.tp-dl-input-group input,
.tp-dl-input-group select {
    height: 48px;
    border: 1px solid #000;
    background: #fff;
    font: inherit;
}

.tp-dl-input-group input {
    min-width: 0;
    width: 100%;
    padding: 0 13px;
    border-radius: 9px 0 0 9px;
}

.tp-dl-input-group select {
    flex: 0 0 auto;
    min-width: 86px;
    padding: 0 11px;
    border-left: 0;
    border-radius: 0 9px 9px 0;
}

.tp-dl-percent-unit {
    display: flex;
    flex: 0 0 58px;
    width: 58px;
    height: 48px;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    border: 1px solid #000;
    border-left: 0;
    border-radius: 0 9px 9px 0;
    background: #fff;
    color: var(--tp-text);
    font: inherit;
    font-size: 16px;
    font-weight: 400;
    line-height: 1;
}

.tp-dl-input-group input:focus,
.tp-dl-input-group select:focus {
    outline: 2px solid rgba(37, 99, 235, .22);
    outline-offset: 1px;
    border-color: #000;
}

.tp-dl-field small {
    display: block;
    margin-top: 8px;
    color: var(--tp-muted);
    font-size: 12px;
    line-height: 1.5;
}

.tp-dl-button {
    align-self: end;
    min-height: 48px;
    border: 0;
    border-radius: 9px;
    padding: 12px 20px;
    background: var(--tp-primary);
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s ease, transform .2s ease;
}

.tp-dl-button:hover {
    background: var(--tp-primary-dark);
    transform: translateY(-1px);
}

.tp-dl-error {
    margin-top: 16px;
    padding: 13px 16px;
    border: 1px solid #fecaca;
    border-radius: 10px;
    background: #fef2f2;
    color: #991b1b;
}

.tp-dl-results {
    margin-top: 28px;
}

.tp-dl-result-main {
    padding: 28px;
    text-align: center;
    border-radius: 16px;
    background: var(--tp-text);
    color: #fff;
}

.tp-dl-result-main span {
    display: block;
    margin-bottom: 8px;
    opacity: .8;
    font-size: 14px;
}

.tp-dl-result-main strong {
    display: block;
    font-size: clamp(32px, 6vw, 54px);
    line-height: 1.1;
}

.tp-dl-result-main small {
    display: block;
    margin-top: 10px;
    opacity: .7;
}

.tp-dl-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-top: 14px;
}

.tp-dl-card {
    padding: 18px;
    border: 1px solid #000;
    border-radius: 12px;
    background: var(--tp-card);
}

.tp-dl-card span {
    display: block;
    color: var(--tp-muted);
    font-size: 13px;
    margin-bottom: 7px;
}

.tp-dl-card strong {
    display: block;
    font-size: 20px;
}

.tp-dl-chart-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 18px;
}

.tp-dl-panel {
    min-width: 0;
    padding: 22px;
    border: 1px solid var(--tp-border);
    border-radius: 14px;
    background: var(--tp-card);
}

.tp-dl-panel-heading h3 {
    margin: 0 0 6px;
    font-size: 20px;
}

.tp-dl-panel-heading p {
    margin: 0 0 20px;
    color: var(--tp-muted);
    font-size: 13px;
    line-height: 1.5;
}

.tp-dl-bar-row {
    display: grid;
    grid-template-columns: 75px minmax(80px, 1fr) 105px;
    gap: 10px;
    align-items: center;
    margin: 12px 0;
    font-size: 13px;
}

.tp-dl-bar-label {
    font-weight: 600;
}

.tp-dl-bar-track {
    height: 14px;
    overflow: hidden;
    border-radius: 999px;
    background: #eef2f7;
}

.tp-dl-bar-fill {
    height: 100%;
    min-width: 3px;
    border-radius: inherit;
    background: var(--tp-primary);
}

.tp-dl-bar-value {
    text-align: right;
    color: var(--tp-muted);
}

.tp-dl-svg-wrap {
    width: 100%;
    overflow: visible;
}

.tp-dl-svg {
    display: block;
    width: 100%;
    height: auto;
}

.tp-dl-grid-line {
    stroke: #e2e8f0;
    stroke-width: 1;
}

.tp-dl-axis-text {
    fill: #64748b;
    font-size: 11px;
}

.tp-dl-chart-area {
    fill: rgba(37, 99, 235, .10);
}

.tp-dl-chart-line {
    fill: none;
    stroke: var(--tp-primary);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.tp-dl-chart-title {
    fill: var(--tp-text);
    font-size: 12px;
    font-weight: 700;
}

.tp-dl-table-panel {
    margin-top: 18px;
}

.tp-dl-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.tp-dl-table-wrap table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.tp-dl-table-wrap th,
.tp-dl-table-wrap td {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 1px solid var(--tp-border);
}

.tp-dl-table-wrap th {
    color: var(--tp-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.tp-dl-note {
    margin-top: 18px;
    padding: 16px 18px;
    border-left: 4px solid var(--tp-primary);
    background: var(--tp-bg);
    color: var(--tp-muted);
    font-size: 13px;
    line-height: 1.6;
}

.tp-dl-note strong {
    color: var(--tp-text);
}


@media (max-width: 850px) {
    .tp-dl-form,
    .tp-dl-chart-grid {
        grid-template-columns: 1fr;
    }

    .tp-dl-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .tp-dl-form {
        padding: 18px;
    }

    .tp-dl-cards {
        grid-template-columns: 1fr;
    }

    .tp-dl-bar-row {
        grid-template-columns: 68px minmax(60px, 1fr);
    }

    .tp-dl-bar-value {
        grid-column: 2;
        text-align: left;
        margin-top: -6px;
    }
}

.tp-dl-custom-speed {
    margin-top: 10px;
}

/* Kompakte Darstellung der Prozent-Einheit im Praxisfaktor-Feld */
.tp-dl-overhead .tp-dl-percent-unit {
    max-width: 58px;
}

.tp-dl-axis-caption {
    fill: #64748b;
    font-size: 10px;
}
