.jag-cm,
.jag-cm * {
    box-sizing: border-box;
}

.jag-cm {
    --jag-blue: #6674c9;
    --jag-blue-deep: #4252a0;
    --jag-blue-ink: #27316e;
    --jag-orange: #ff7f24;
    --jag-orange-deep: #e56216;
    --jag-orange-soft: #fff1e7;
    --jag-ink: #282931;
    --jag-muted: #62677a;
    --jag-line: rgba(40, 41, 49, 0.12);
    --jag-soft: #f6f7ff;
    color: var(--jag-ink);
    font-family: Poppins, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    margin: 0 auto;
}

.jag-cm__wrap {
    background: linear-gradient(180deg, rgba(102, 116, 201, 0.10), rgba(255, 255, 255, 0) 380px), #ffffff;
    margin: 0 auto;
    max-width: 1180px;
    padding: clamp(24px, 4vw, 52px) 18px;
}

.jag-cm__intro {
    background: var(--jag-blue);
    border-radius: 8px 8px 0 0;
    color: #ffffff;
    overflow: hidden;
    padding: clamp(24px, 5vw, 48px);
    position: relative;
}

.jag-cm__intro::after {
    background: var(--jag-orange);
    bottom: 0;
    content: "";
    height: 7px;
    left: clamp(24px, 5vw, 48px);
    position: absolute;
    width: min(340px, 42%);
}

.jag-cm__eyebrow {
    color: #ffe1cc;
    font-size: 1.4rem;
    font-weight: 900;
    letter-spacing: 0;
    margin: 0 0 10px;
    text-transform: uppercase;
}

.jag-cm__intro h2 {
    color: #ffffff;
    font-size: clamp(2rem, 4.7vw, 3.6rem);
    font-weight: 900;
    letter-spacing: 0;
    line-height: 0.98;
    margin: 0;
    max-width: 880px;
}

.jag-cm__intro p:not(.jag-cm__eyebrow) {
    color: rgba(255, 255, 255, 0.92);
    font-size: clamp(1.3rem, 1.8vw, 1.25rem);
    line-height: 1.65;
    margin: 18px 0 0;
    max-width: 770px;
}

.jag-cm__shell {
    background: #ffffff;
    border: 1px solid var(--jag-line);
    border-top: 0;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 26px 70px rgba(39, 49, 110, 0.12);
    overflow: hidden;
}

.jag-cm__decision {
    background: #ffffff;
    border-bottom: 1px solid var(--jag-line);
    padding: clamp(16px, 2.5vw, 26px);
}

.jag-cm__decision-head {
    align-items: end;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 14px;
}

.jag-cm__decision-head span {
    color: var(--jag-orange-deep);
    font-size: 0.8rem;
    font-weight: 900;
    text-transform: uppercase;
}

.jag-cm__decision-head strong {
    color: var(--jag-ink);
    font-size: clamp(1.15rem, 2.2vw, 1.55rem);
    font-weight: 900;
    text-align: right;
}

.jag-cm__chooser {
    background: #eef1ff;
    border: 1px solid rgba(102, 116, 201, 0.18);
    border-radius: 8px;
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(3, 1fr);
    padding: 10px;
}

.jag-cm__choice {
    background: #ffffff;
    border: 1px solid rgba(102, 116, 201, 0.14);
    border-radius: 8px;
    color: var(--jag-ink);
    cursor: pointer;
    display: grid;
    gap: 8px;
    min-height: 150px;
    padding: 18px;
    text-align: left;
    transition: background 180ms ease, border 180ms ease, box-shadow 180ms ease, color 180ms ease, transform 180ms ease;
}

.jag-cm__choice:hover {
    border-color: rgba(255, 127, 36, 0.5);
}

.jag-cm__choice span {
    align-items: center;
    background: var(--jag-orange-soft);
    border-radius: 999px;
    color: var(--jag-orange-deep);
    display: inline-flex;
    font-size: 1.1rem;
    font-weight: 900;
    height: 30px;
    justify-content: center;
    width: 44px;
}

.jag-cm__choice strong {
    font-size: 1.4rem;
    font-weight: 900;
    line-height: 1.15;
}

.jag-cm__choice small {
    color: var(--jag-muted);
    font-size: 1.2rem;
    line-height: 1.48;
}

.jag-cm__choice.is-active {
    background: var(--jag-blue-deep);
    border-color: rgba(255, 127, 36, 0.58);
    box-shadow: 0 16px 34px rgba(66, 82, 160, 0.22);
    color: #ffffff;
    transform: translateY(-1px);
}

.jag-cm__choice.is-active span {
    background: var(--jag-orange);
    color: #ffffff;
}

.jag-cm__choice.is-active small {
    color: rgba(255, 255, 255, 0.88);
}

.jag-cm__workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 0.82fr);
}

.jag-cm__form {
    background: #ffffff;
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: clamp(18px, 3vw, 32px);
}

.jag-cm__field {
    background: var(--jag-soft);
    border: 1px solid rgba(102, 116, 201, 0.17);
    border-radius: 8px;
    display: grid;
    gap: 10px;
    min-width: 0;
    padding: 16px;
}

.jag-cm__field--wide {
    grid-column: 1 / -1;
}

.jag-cm__field label,
.jag-cm__range-head label {
    color: var(--jag-ink);
    font-size: 1.4rem;
    font-weight: 900;
    line-height: 1.2;
}

.jag-cm__field p {
    color: var(--jag-muted);
    font-size: 1.5rem;
    line-height: 1.5;
    margin: 0;
}

.jag-cm__input {
    align-items: center;
    background: #ffffff;
    border: 2px solid transparent;
    border-radius: 8px;
    display: flex;
    min-height: 52px;
    padding: 0 12px;
    transition: border 160ms ease, box-shadow 160ms ease;
}

.jag-cm__input:focus-within {
    border-color: var(--jag-orange);
    box-shadow: 0 0 0 4px rgba(255, 127, 36, 0.14);
}

.jag-cm__input input,
.jag-cm__input select {
    background: transparent;
    border: 0;
    color: var(--jag-ink);
    flex: 1;
    font: inherit;
    font-size: 1.4rem;
    font-weight: 900;
    min-width: 0;
    outline: 0;
    padding: 0;
    width: 100%;
}

.jag-cm__input span {
    color: var(--jag-orange-deep);
    font-size: 1.4rem;
    font-weight: 900;
    padding-left: 8px;
}

.jag-cm__range-head {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.jag-cm__range-head output {
    background: var(--jag-blue-ink);
    border-radius: 999px;
    color: #ffffff;
    font-weight: 900;
    min-width: 64px;
    padding: 6px 10px;
    text-align: center;
}

.jag-cm input[type="range"] {
    accent-color: var(--jag-orange);
    width: 100%;
}

.jag-cm__result {
    background: linear-gradient(145deg, rgba(66, 82, 160, 0.98), rgba(102, 116, 201, 0.98)), var(--jag-blue);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: clamp(24px, 4vw, 38px);
}

.jag-cm__result-label {
    color: #ffe2cc;
    font-size: 1.4rem;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.jag-cm__result-number {
    color: #ffffff;
    font-size: clamp(4rem, 10vw, 7.6rem);
    font-weight: 900;
    letter-spacing: 0;
    line-height: 0.9;
    margin-top: 16px;
    word-break: break-word;
}

.jag-cm__result-unit {
    color: rgba(255, 255, 255, 0.86);
    font-size: 1.4rem;
    font-weight: 700;
    margin-top: 10px;
}

.jag-cm__bars {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    height: 12px;
    margin: 26px 0 22px;
    overflow: hidden;
}

.jag-cm__bars span {
    background: var(--jag-orange);
    border-radius: inherit;
    display: block;
    height: 100%;
    min-width: 8%;
    transition: width 180ms ease;
}

.jag-cm__interpretation {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.4rem;
    line-height: 1.58;
    margin: 0 0 20px;
}

.jag-cm__cards {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(3, 1fr);
    margin-top: auto;
}

.jag-cm__cards div {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    padding: 12px;
}

.jag-cm__cards small {
    color: rgba(255, 255, 255, 0.72);
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    min-height: 30px;
}

.jag-cm__cards b {
    color: #ffd8bd;
    display: block;
    font-size: 1.1rem;
    margin-top: 8px;
}

.jag-cm__cta {
    align-items: center;
    background: var(--jag-orange);
    border-radius: 8px;
    color: #ffffff;
    display: inline-flex;
    font-weight: 900;
    justify-content: center;
    margin-top: 22px;
    min-height: 52px;
    padding: 12px 18px;
    text-decoration: none;
    transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.jag-cm__cta:hover {
    background: var(--jag-orange-deep);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
    transform: translateY(-1px);
}

.jag-cm__guide {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(3, 1fr);
    margin-top: 26px;
}

.jag-cm__guide article {
    background: #ffffff;
    border-left: 7px solid var(--jag-orange);
    border-radius: 8px;
    box-shadow: 0 16px 40px rgba(39, 49, 110, 0.08);
    padding: 22px;
}

.jag-cm__guide span {
    color: var(--jag-blue-deep);
    display: block;
    font-size: 1.2rem;
    font-weight: 900;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.jag-cm__guide h3 {
    color: var(--jag-ink);
    font-size: 0.9rem;
    font-weight: 900;
    line-height: 1.18;
    margin: 0 0 12px;
}

.jag-cm__guide p {
    color: var(--jag-muted);
    font-size: 1.2rem;
    line-height: 1.66;
    margin: 0;
}

.jag-cm[data-mode="sample"] [data-field-wrap="sample"] {
    display: none;
}

.jag-cm[data-mode="error"] [data-field-wrap="margin"] {
    display: none;
}

.jag-cm[data-mode="finite"] [data-field-wrap="sample"] {
    display: none;
}

@media (max-width: 980px) {
    .jag-cm__chooser,
    .jag-cm__workspace,
    .jag-cm__guide {
        grid-template-columns: 1fr;
    }

    .jag-cm__choice {
        min-height: 0;
    }

    .jag-cm__decision-head {
        align-items: start;
        display: grid;
    }

    .jag-cm__decision-head strong {
        text-align: left;
    }
}

@media (max-width: 680px) {
    .jag-cm__wrap {
        padding-left: 12px;
        padding-right: 12px;
    }

    .jag-cm__intro {
        padding: 24px 18px 30px;
    }

    .jag-cm__intro h2 {
        font-size: 1.8rem;
    }

    .jag-cm__form,
    .jag-cm__cards {
        grid-template-columns: 1fr;
    }

    .jag-cm__result-number {
        font-size: 4.0rem;
    }
}
