.th-form {
    --gap: 1rem;
    --c-bg: #fff;
    --c-text: #1a1a1a;
    --c-muted: #6b7280;
    --c-accent: #2563eb;
    --c-accent-weak: #bfdbfe;
    --c-line: #e5e7eb;
    --radius: 14px;
    max-width: 860px;
    margin: 2rem auto;
    padding: 1.25rem;
    background: var(--c-bg);
    border-radius: var(--radius);
    box-shadow: 0 6px 30px rgba(0,0,0,.07);
}

/* Panels und Felder */
.th-panel-title { font-size: 1.25rem; margin: .25rem 0 .25rem; }
.th-panel-sub { color: var(--c-muted); margin: 0 0 1rem; }
.th-fields { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.th-label { display: flex; flex-direction: column; gap: .4rem; }
.th-input, .th-textarea {
    border: 1px solid var(--c-line) !important;
    border-radius: .75rem !important;
    padding: .75rem .9rem;
    font: inherit;
    transition: border-color .15s, box-shadow .15s;
}
.th-input:focus, .th-textarea:focus {
    outline: none; border-color: var(--c-accent); box-shadow: 0 0 0 3px var(--c-accent-weak);
}
.th-required { color: #ef4444; }
.th-nav { display: flex; align-items: center; justify-content: space-between; margin-top: 1.25rem; gap: .75rem; }
.th-btn { background: var(--c-accent); color: #fff; border: none; border-radius: .75rem; padding: .7rem 1rem; font-weight: 600; cursor: pointer; }
.th-btn:disabled { opacity: .6; cursor: not-allowed; }
.th-secondary { background: #11182714; color: #111827; }

/* Steps */
.th-steps {
    list-style: none; display: flex; justify-content: space-between; align-items: center;
    margin: 0 0 1.25rem; padding: 0; counter-reset: th;
}
.th-step {
    position: relative; display: flex; flex-direction: column; align-items: center;
    gap: .5rem; flex: 1; min-width: 0; text-align: center;
}

/* Punkt + Label */
.th-step .th-step-dot {
    width: 36px; height: 36px; border-radius: 999px; border: 2px solid var(--c-line);
    background: #fff; z-index: 3;
    display: flex;
    justify-content: center;
    align-items: center;
}
.th-step .th-step-label { font-size: .9rem; color: var(--c-muted); padding: 0 .25rem; }
.th-step.is-active .th-step-dot { border-color: var(--c-accent); box-shadow: 0 0 0 4px var(--c-accent-weak); }
.th-step.is-active .th-step-label { color: var(--c-text); font-weight: 600; }
.th-step.is-completed .th-step-dot { background: var(--c-accent); border-color: var(--c-accent); color: var(--c-accent-weak) }
.th-step.is-completed .th-step-label { color: var(--c-text); }

/* Prozent unterhalb */
.th-step .th-step-pct { font-size: .8rem; color: var(--c-muted); line-height: 1; }
.th-step.is-active .th-step-pct { color: var(--c-text); font-weight: 600; }

/* ------------------- LINIEN ------------------- */

/* Grundzustand der Verbindungen */
.th-step::before,
.th-step::after {
    content: "";
    position: absolute;
    top: 18px;
    height: 2px;
    width: 50%;
    background: var(--c-line);
    z-index: 1;
}
.th-step::before { left: 0; transform: translateX(-50%); }   /* Verbindung nach links */
.th-step::after  { right: 0; transform: translateX(50%); }    /* Verbindung nach rechts */
.th-step:first-child::before { display: none; }
.th-step:last-child::after  { display: none; }

/* Erledigte Steps: beide Seiten voll blau */
.th-step.is-completed::before,
.th-step.is-completed::after {
    background: var(--c-accent);
    z-index: 2;  /* über Grundgrau */
}

/* WICHTIG: aktives ::before transparent, damit es das blaue ::after des vorherigen Steps NICHT übermalt */
.th-step.is-active::before {
    background: transparent;
}

/* Aktiver Step: rechte Verbindung füllt sich prozentual */
/*.th-step.is-active::after {*/
/*    background:*/
/*            linear-gradient(var(--c-line), var(--c-line)),*/
/*            linear-gradient(var(--c-accent), var(--c-accent));*/
/*    background-repeat: no-repeat, no-repeat;*/
/*    background-position: left top, left top;*/
/*    background-size: 100% 2px, var(--progress, 0%) 2px;*/
/*    z-index: 2;*/
/*}*/
.th-step.is-active::after {
    background: var(--c-accent);
    width: calc(var(--progress) * 0.5);
    transition: width .25s ease;
    z-index: 3;
}
/* Nur FOLGENDE Steps links grau lassen (nicht das aktive ::after überschreiben) */
.th-step.is-active ~ .th-step::before {
    background: var(--c-line);
    z-index: 1;
}

/* Panels */
.th-panel { display: none; }
.th-panel.is-active { display: block; }

/* Debug */
.th-debug {
    background: #0b0b0b; color: #cbd5e1; padding: 1rem; border-radius: 12px;
    max-width: 860px; margin: 1rem auto; overflow: auto;
}
.th-headline-container{
    max-width: 860px;
    margin: 2rem auto;
}
.th-headline{
    font-size: 1.5rem;
}