.ld-maschenrechner {
    --ld-primary: #7D3F4D;
    --ld-primary-dark: #65323E;
    --ld-accent: #D9A6A0;
    --ld-soft: #F3E4DF;
    --ld-background: #FFF9F7;
    --ld-text: #4F3E43;
    --ld-muted: #7D6D72;
    --ld-white: #FFFFFF;
    --ld-border: #E8D8D4;
    --ld-shadow: 0 16px 38px rgba(79, 62, 67, .08);
    max-width: 1180px;
    margin: 0 auto;
    padding: 24px 20px 40px;
    color: var(--ld-text);
    font-family: "Open Sans", Arial, Helvetica, sans-serif;
    line-height: 1.6;
}

.ld-maschenrechner *,
.ld-maschenrechner *::before,
.ld-maschenrechner *::after {
    box-sizing: border-box;
}

.ld-maschenrechner__version-footer {
    margin-top: 38px;
    padding: 19px 12px 0;
    border-top: 1px solid var(--ld-border);
    text-align: center;
    font-size: 12px;
    line-height: 1.6;
    font-weight: 400;
    color: #9B6876;
}

.ld-maschenrechner__version-footer span {
    display: inline-block;
    margin: 0 5px;
    color: #B77D8D;
}

.ld-maschenrechner__hero {
    position: relative;
    overflow: hidden;
    padding: clamp(30px, 4.5vw, 54px) clamp(24px, 6vw, 72px);
    border: 1px solid var(--ld-border);
    border-radius: 24px;
    background:
        linear-gradient(135deg, rgba(255, 249, 247, .98), rgba(243, 228, 223, .90)),
        var(--ld-background);
    box-shadow: var(--ld-shadow);
    text-align: center;
}

.ld-maschenrechner__hero::after {
    content: "";
    position: absolute;
    right: -80px;
    bottom: -125px;
    width: 245px;
    height: 245px;
    border-radius: 50%;
    background: rgba(217, 166, 160, .15);
    pointer-events: none;
}

.ld-maschenrechner__hero > * {
    position: relative;
    z-index: 1;
}

.ld-maschenrechner__eyebrow {
    margin: 0;
    color: var(--ld-primary);
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.ld-maschenrechner h1,
.ld-maschenrechner h2,
.ld-maschenrechner p {
    color: var(--ld-text);
}

.ld-maschenrechner__hero h1 {
    margin: 4px 0 5px;
    color: var(--ld-primary);
    font-size: clamp(2.2rem, 4.6vw, 4rem);
    font-weight: 700;
    line-height: 1.02;
}

.ld-maschenrechner h2 {
    margin: 0 0 10px;
    font-size: clamp(24px, 2.5vw, 28px);
    line-height: 1.25;
    font-weight: 600;
}

.ld-maschenrechner__tagline {
    max-width: 760px;
    margin: 0 auto;
    color: var(--ld-text) !important;
    font-size: clamp(1rem, 1.7vw, 1.28rem);
    font-weight: 600;
}

.ld-maschenrechner__intro {
    max-width: 760px;
    margin: 14px auto 0;
    color: var(--ld-muted) !important;
    font-size: .98rem;
}

.ld-maschenrechner__setup {
    margin-top: 18px;
    padding: 22px;
    border: 1px solid var(--ld-border);
    border-radius: 18px;
    background: var(--ld-white);
    box-shadow: 0 8px 24px rgba(79, 62, 67, .05);
}

.ld-maschenrechner__mode {
    display: flex;
    width: max-content;
    max-width: 100%;
    margin: 0 auto 20px;
    padding: 5px;
    gap: 5px;
    border: 1px solid var(--ld-border);
    border-radius: 999px;
    background: var(--ld-white);
    box-shadow: 0 6px 18px rgba(79, 62, 67, .04);
}

.ld-maschenrechner__mode button {
    min-height: 42px;
    min-width: 126px;
    padding: 9px 20px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--ld-primary);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: background-color .16s ease, color .16s ease, transform .16s ease;
}

.ld-maschenrechner__mode button:hover {
    background: var(--ld-soft);
}

.ld-maschenrechner__mode button.is-active {
    background: var(--ld-primary);
    color: var(--ld-white);
}

.ld-maschenrechner__needle-setting {
    max-width: 360px;
    margin: 22px auto 0;
    text-align: left;
}

.ld-maschenrechner__needle-note {
    margin-top: 14px !important;
    padding-top: 12px;
    border-top: 1px solid rgba(125, 63, 77, .16);
    color: #6B5960;
    font-size: 14px;
}

.ld-maschenrechner__cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
    margin: 30px 0 34px;
}

.ld-maschenrechner__card {
    min-height: 184px;
    padding: 24px;
    border: 1px solid var(--ld-border);
    border-radius: 18px;
    background: var(--ld-white);
    color: var(--ld-text);
    text-align: left;
    font: inherit;
    cursor: pointer;
    box-shadow: 0 12px 26px rgba(79, 62, 67, .055);
    transition: transform .18s ease, border-color .18s ease, background-color .18s ease, box-shadow .18s ease;
}

.ld-maschenrechner__card:hover,
.ld-maschenrechner__card:focus-visible,
.ld-maschenrechner__card.is-active {
    transform: translateY(-2px);
    border-color: var(--ld-accent);
    background: #FFFCFB;
    box-shadow: 0 9px 26px rgba(79, 62, 67, .09);
}

.ld-maschenrechner__icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    margin-bottom: 18px;
    border-radius: 14px;
    background: var(--ld-soft);
    color: var(--ld-primary);
}

.ld-maschenrechner__icon svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ld-maschenrechner__card-title,
.ld-maschenrechner__card-text {
    display: block;
}

.ld-maschenrechner__card-title {
    margin-bottom: 6px;
    color: var(--ld-text);
    font-size: 19px;
    font-weight: 600;
}

.ld-maschenrechner__card-text {
    color: #6B5960;
    font-size: 15px;
    line-height: 1.5;
}

.ld-maschenrechner__workspace:empty {
    display: none;
}

.ld-maschenrechner__panel {
    padding: 32px;
    border: 1px solid var(--ld-border);
    border-radius: 18px;
    background: var(--ld-white);
    box-shadow: 0 12px 30px rgba(79, 62, 67, .065);
    scroll-margin-top: 24px;
}

.ld-maschenrechner__panel > p {
    margin: 0 0 24px;
}

.ld-maschenrechner__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 24px;
    align-items: start;
}

.ld-maschenrechner__field {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.ld-maschenrechner__field label {
    min-height: 24px;
}

.ld-maschenrechner__field label {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 7px;
    color: var(--ld-text);
    font-size: 15px;
    font-weight: 600;
}

.ld-maschenrechner__input-wrap {
    display: flex;
    min-height: 48px;
    overflow: hidden;
    border: 1px solid var(--ld-accent);
    border-radius: 8px;
    background: var(--ld-white);
    transition: border-color .16s ease, box-shadow .16s ease;
}

.ld-maschenrechner__input-wrap:focus-within,
.ld-maschenrechner select:focus-visible {
    border-color: var(--ld-primary);
    box-shadow: 0 0 0 3px rgba(125, 63, 77, .12);
    outline: none;
}

.ld-maschenrechner input,
.ld-maschenrechner select {
    width: 100%;
    min-height: 48px;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid var(--ld-accent);
    border-radius: 8px;
    background: var(--ld-white);
    color: var(--ld-text);
    font: inherit;
    font-size: 16px;
}

.ld-maschenrechner__input-wrap input {
    min-width: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    outline: none;
}

.ld-maschenrechner select {
    -webkit-appearance: none;
    appearance: none;
    padding-right: 44px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%237D3F4D' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 7.5 5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px 16px;
    cursor: pointer;
}

.ld-maschenrechner__unit {
    display: flex;
    align-items: center;
    padding: 0 12px;
    border-left: 1px solid var(--ld-border);
    background: var(--ld-background);
    color: #6B5960;
    font-size: 13px;
    white-space: nowrap;
}

.ld-maschenrechner__help {
    width: 22px;
    height: 22px;
    padding: 0;
    border: 1px solid var(--ld-accent);
    border-radius: 50%;
    background: var(--ld-white);
    color: var(--ld-primary);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    line-height: 20px;
    cursor: pointer;
}

.ld-maschenrechner__helptext {
    display: block;
    margin: -1px 0 8px;
    padding: 8px 10px;
    border: 1px solid var(--ld-border);
    border-radius: 8px;
    background: var(--ld-background);
    color: #6B5960;
    font-size: 13px;
}

.ld-maschenrechner__helptext[hidden] {
    display: none !important;
}

.ld-maschenrechner__help[aria-expanded="true"] {
    background: var(--ld-soft);
    border-color: var(--ld-primary);
}

.ld-maschenrechner__actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 26px;
}

.ld-maschenrechner__button,
.ld-maschenrechner__copy,
.ld-maschenrechner__cta-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 10px 20px;
    border-radius: 8px;
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: transform .15s ease, opacity .15s ease, background-color .15s ease;
}

.ld-maschenrechner .ld-maschenrechner__button--primary {
    border: 1px solid var(--ld-primary);
    background: var(--ld-primary);
    color: var(--ld-white);
}

.ld-maschenrechner .ld-maschenrechner__button--primary:hover {
    background: #6B3542;
    color: var(--ld-white);
}

.ld-maschenrechner .ld-maschenrechner__button--secondary,
.ld-maschenrechner .ld-maschenrechner__copy {
    border: 1px solid var(--ld-primary);
    background: var(--ld-white);
    color: var(--ld-primary);
}

.ld-maschenrechner .ld-maschenrechner__button--secondary:hover,
.ld-maschenrechner .ld-maschenrechner__copy:hover {
    background: var(--ld-soft);
    color: var(--ld-primary);
}

.ld-maschenrechner .ld-maschenrechner__cta-link--crochet {
    border: 1px solid var(--ld-primary);
    background: var(--ld-primary);
    color: var(--ld-white);
}

.ld-maschenrechner .ld-maschenrechner__cta-link--crochet:not(:disabled):hover,
.ld-maschenrechner .ld-maschenrechner__cta-link--crochet:not(:disabled):focus {
    border-color: var(--ld-accent);
    background: var(--ld-accent);
    color: var(--ld-text);
}

.ld-maschenrechner .ld-maschenrechner__cta-link--knit {
    border: 1px solid var(--ld-accent);
    background: var(--ld-background);
    color: var(--ld-primary);
}

.ld-maschenrechner .ld-maschenrechner__cta-link--knit:not(:disabled):hover,
.ld-maschenrechner .ld-maschenrechner__cta-link--knit:not(:disabled):focus {
    border-color: var(--ld-accent);
    background: var(--ld-soft);
    color: var(--ld-primary);
}

.ld-maschenrechner__button:hover,
.ld-maschenrechner__copy:hover,
.ld-maschenrechner__cta-link:not(:disabled):hover {
    transform: translateY(-1px);
}

.ld-maschenrechner .ld-maschenrechner__cta-link:disabled {
    opacity: .87;
    cursor: not-allowed;
    transform: none;
}

.ld-maschenrechner__result {
    margin-top: 26px;
    padding: 24px 26px;
    border-left: 5px solid var(--ld-primary);
    border-radius: 12px;
    background: var(--ld-soft);
}

.ld-maschenrechner__result-label {
    margin-bottom: 5px;
    color: var(--ld-primary);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .02em;
}

.ld-maschenrechner__result-main {
    margin-bottom: 8px;
    color: var(--ld-text);
    font-size: clamp(28px, 3vw, 34px);
    line-height: 1.2;
    font-weight: 600;
}

.ld-maschenrechner__result-text p,
.ld-maschenrechner__result-text ul {
    margin: 8px 0;
}

.ld-maschenrechner__result-text ul {
    padding-left: 20px;
}

.ld-maschenrechner__result.is-error {
    border-left-color: #8B3A4A;
    background: #F8E9EC;
}

.ld-maschenrechner__result.is-note {
    border-left-color: var(--ld-accent);
}

.ld-maschenrechner__copy {
    min-height: 40px;
    margin-top: 14px;
    padding: 7px 14px;
    font-size: 14px;
}

.ld-maschenrechner__copy-status {
    margin-left: 10px;
    color: var(--ld-primary);
    font-size: 13px;
}

.ld-maschenrechner__cta {
    margin-top: 34px;
    padding: 28px;
    border: 1px solid var(--ld-border);
    border-radius: 18px;
    background: var(--ld-background);
    text-align: center;
}

.ld-maschenrechner__cta p {
    margin: 0 auto 18px;
    max-width: 680px;
}

.ld-maschenrechner__cta-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.ld-maschenrechner button:focus-visible,
.ld-maschenrechner a:focus-visible,
.ld-maschenrechner input:focus-visible,
.ld-maschenrechner select:focus-visible {
    outline: 3px solid rgba(125, 63, 77, .28);
    outline-offset: 2px;
}

@media (max-width: 900px) {
    .ld-maschenrechner {
        padding: 24px;
    }
    .ld-maschenrechner__cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .ld-maschenrechner {
        padding: 16px;
    }
    .ld-maschenrechner__cards,
    .ld-maschenrechner__grid {
        grid-template-columns: 1fr;
    }
    .ld-maschenrechner__cards {
        gap: 16px;
    }
    .ld-maschenrechner__card {
        min-height: 0;
    }
    .ld-maschenrechner__panel {
        padding: 20px;
    }
    .ld-maschenrechner__actions,
    .ld-maschenrechner__cta-actions {
        flex-direction: column;
    }
    .ld-maschenrechner__button,
    .ld-maschenrechner__cta-link {
        width: 100%;
    }
    .ld-maschenrechner__mode {
        width: 100%;
    }
    .ld-maschenrechner__mode button {
        flex: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ld-maschenrechner *,
    .ld-maschenrechner *::before,
    .ld-maschenrechner *::after {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}

/* Version 1.0.2 – projektweite Garn-/Nadelangaben und Technik-Kontext. */
.ld-maschenrechner__project-settings {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    max-width: 760px;
    margin: 0 auto;
    text-align: left;
}

.ld-maschenrechner__mode-info {
    display: grid;
    gap: 4px;
    max-width: 860px;
    margin: 18px auto 0;
    padding: 16px 18px;
    border: 1px solid var(--ld-border);
    border-radius: 12px;
    background: rgba(243, 228, 223, .42);
    text-align: left;
}

.ld-maschenrechner__mode-info-title {
    color: var(--ld-primary);
    font-weight: 700;
}

.ld-maschenrechner__mode-info-text,
.ld-maschenrechner__yarn-guidance {
    color: #6B5960;
    font-size: 14px;
    line-height: 1.55;
}

.ld-maschenrechner__yarn-guidance {
    margin-top: 6px;
    padding-top: 10px;
    border-top: 1px solid rgba(125, 63, 77, .14);
}

.ld-maschenrechner__project-context {
    margin-top: 16px;
    padding: 14px 16px;
    border: 1px solid rgba(125, 63, 77, .14);
    border-radius: 10px;
    background: rgba(255, 249, 247, .7);
    color: #6B5960;
    font-size: 14px;
}

.ld-maschenrechner__project-context p {
    margin: 0 0 7px;
}

.ld-maschenrechner__project-context p:last-child {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .ld-maschenrechner__project-settings {
        grid-template-columns: 1fr;
    }
}


/* Version 1.0.3 – Nadelgrößen-Auswahl und Feinschliff. */
.ld-maschenrechner__needle-other {
    margin-top: 12px;
}

.ld-maschenrechner__needle-other > label {
    min-height: 0;
    margin-bottom: 7px;
}

@media (min-width: 768px) {
    .ld-maschenrechner__grid > .ld-maschenrechner__field > label,
    .ld-maschenrechner__project-settings > .ld-maschenrechner__field > label {
        min-height: 46px;
        align-items: flex-end;
    }
}

@media (max-width: 767px) {
    .ld-maschenrechner__grid > .ld-maschenrechner__field > label,
    .ld-maschenrechner__project-settings > .ld-maschenrechner__field > label {
        min-height: 0;
    }
}

/* Version 1.0.6 – Raglan-Modul / getrennte Formungspläne. */
.ld-maschenrechner__advanced {
    margin-top: 24px;
    padding: 0;
    border: 1px solid var(--ld-border);
    border-radius: 12px;
    background: rgba(255, 249, 247, .55);
    overflow: hidden;
}

.ld-maschenrechner__advanced > summary {
    position: relative;
    padding: 16px 48px 16px 18px;
    color: var(--ld-primary);
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}

.ld-maschenrechner__advanced > summary::-webkit-details-marker {
    display: none;
}

.ld-maschenrechner__advanced > summary::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 18px;
    width: 9px;
    height: 9px;
    border-right: 2px solid var(--ld-primary);
    border-bottom: 2px solid var(--ld-primary);
    transform: translateY(-65%) rotate(45deg);
    transition: transform .16s ease;
}

.ld-maschenrechner__advanced[open] > summary::after {
    transform: translateY(-30%) rotate(225deg);
}

.ld-maschenrechner__advanced-grid {
    padding: 4px 18px 20px;
    border-top: 1px solid var(--ld-border);
}

@media (max-width: 767px) {
    .ld-maschenrechner__advanced > summary {
        padding: 15px 44px 15px 16px;
    }
    .ld-maschenrechner__advanced-grid {
        padding: 4px 16px 18px;
    }
}

/* Version 1.0.8 – PDF-Typografie harmonisiert und Fortsetzungsseiten korrigiert. */
.ld-maschenrechner__result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.ld-maschenrechner__pdf {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 7px 14px;
    border: 1px solid var(--ld-primary);
    border-radius: 8px;
    background: var(--ld-primary);
    color: var(--ld-white);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform .15s ease, opacity .15s ease, background-color .15s ease;
}

.ld-maschenrechner__pdf:hover,
.ld-maschenrechner__pdf:focus {
    background: #6B3542;
    color: var(--ld-white);
}

.ld-maschenrechner__pdf:hover {
    transform: translateY(-1px);
}

.ld-maschenrechner__pdf:disabled {
    cursor: wait;
    opacity: .68;
    transform: none;
}

.ld-maschenrechner__pdf-status {
    margin-left: 10px;
    color: var(--ld-primary);
    font-size: 13px;
}

.ld-maschenrechner__result.is-error .ld-maschenrechner__pdf {
    display: none;
}

@media (max-width: 767px) {
    .ld-maschenrechner__result-actions {
        flex-direction: column;
    }

    .ld-maschenrechner__result-actions .ld-maschenrechner__copy,
    .ld-maschenrechner__result-actions .ld-maschenrechner__pdf {
        width: 100%;
    }
}


/* Version 1.1.1 – Premium-Einstiegsbereich im Look des Luxury Design MusterKompass; Mobile-Titel optimiert. */
@media (max-width: 900px) {
    .ld-maschenrechner {
        padding: 20px 16px 34px;
    }
}

@media (max-width: 767px) {
    .ld-maschenrechner {
        padding: 16px 12px 30px;
    }

    .ld-maschenrechner__hero {
        padding: 30px 20px 32px;
        border-radius: 20px;
    }

    .ld-maschenrechner__hero h1 {
        font-size: clamp(1.5rem, 7.6vw, 2.15rem);
        line-height: 1.08;
        letter-spacing: -0.015em;
        white-space: nowrap;
        overflow: visible;
        overflow-wrap: normal;
        word-break: normal;
    }

    .ld-maschenrechner__tagline {
        font-size: 1rem;
        line-height: 1.45;
    }

    .ld-maschenrechner__intro {
        font-size: .93rem;
    }

    .ld-maschenrechner__setup {
        padding: 18px 16px;
        border-radius: 16px;
    }

    .ld-maschenrechner__mode {
        width: 100%;
    }

    .ld-maschenrechner__mode button {
        flex: 1 1 0;
        min-width: 0;
        padding-inline: 12px;
    }
}
