.noemat-math {
    max-width: 100%;
}

.noemat-math--display {
    display: block;
    overflow-x: auto;
    overflow-y: hidden;
    padding-block: 0.125rem;
    -webkit-overflow-scrolling: touch;
}

.noemat-math--error {
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.noemat-component {
    max-width: 100%;
}

.noemat-component__control,
.noemat-component input,
.noemat-component select {
    touch-action: manipulation;
}

.noemat-component__label,
.noemat-component__status {
    display: block;
}

.noemat-component__status {
    overflow-wrap: anywhere;
}

.noemat-component svg {
    display: block;
    width: 100%;
    height: auto;
    max-height: 22rem;
}

.noemat-component__axis {
    stroke: currentColor;
    stroke-width: 1;
}

.noemat-component__function {
    stroke: currentColor;
    stroke-width: 2;
}

.noemat-component__point {
    fill: currentColor;
}

/* NOEMAT KB interactive components */
.noemat-component[data-noemat-status="interactive"] {
    margin: 1.5rem 0;
    padding: 1.25rem;
    background: #FBF8F3;
    border: 1px solid #D8D0C5;
    border-radius: 10px;
    color: #171A1C;
    font-family: Manrope, sans-serif;
}

.noemat-component__title {
    margin: 0 0 0.75rem;
    color: #171A1C;
    font-family: "Cormorant Garamond", serif;
    font-size: 1.5rem;
    font-weight: 500;
    line-height: 1.2;
}

.noemat-component__intro {
    margin: 0 0 1rem;
    color: #6D6964;
}

.noemat-component__controls {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 0.75rem 1rem;
    margin: 0 0 1rem;
}

.noemat-component__controls--grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.noemat-component__label {
    min-width: 0;
    color: #6D6964;
    font-size: 0.875rem;
}

.noemat-component__range,
.noemat-component__select {
    width: 100%;
    margin-top: 0.35rem;
}

.noemat-component__select {
    min-height: 2.5rem;
    padding: 0.45rem 0.6rem;
    background: #FBF8F3;
    border: 1px solid #D8D0C5;
    border-radius: 8px;
    color: #171A1C;
    font: inherit;
}

.noemat-component__button {
    min-height: 2.5rem;
    padding: 0.55rem 0.85rem;
    background: #18324A;
    border: 1px solid #18324A;
    border-radius: 8px;
    color: #FBF8F3;
    font: 600 0.875rem/1.4 Manrope, sans-serif;
    cursor: pointer;
    transition: transform 180ms ease, background 180ms ease;
}

.noemat-component__button:hover {
    transform: translateY(-1px);
    background: #10283D;
}

.noemat-component__button:focus-visible,
.noemat-component__select:focus-visible,
.noemat-component input:focus-visible {
    outline: 2px solid #9C4F2E;
    outline-offset: 3px;
}

.noemat-component__steps {
    display: grid;
    gap: 0.6rem;
    margin: 0 0 1rem;
    padding: 0;
    list-style: none;
}

.noemat-component__step {
    display: grid;
    grid-template-columns: minmax(7rem, auto) 1fr;
    gap: 0.75rem;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #D8D0C5;
}

.noemat-component__step:last-child {
    border-bottom: 0;
}

.noemat-component__step-text,
.noemat-component__status {
    color: #6D6964;
    font-size: 0.875rem;
    line-height: 1.5;
}

.noemat-component__visual {
    margin: 0.5rem 0 0.25rem;
    overflow-x: auto;
}

.noemat-component__formula {
    margin: 0.75rem 0;
}

.noemat-component__highlight {
    stroke: #9C4F2E;
    stroke-width: 6;
    stroke-linecap: round;
}

.noemat-component__boundary {
    fill: #9C4F2E;
    stroke: #9C4F2E;
    stroke-width: 2;
}

.noemat-component__boundary--open {
    fill: #FBF8F3;
}

.noemat-component__tick-label,
.noemat-component__point-label {
    fill: #6D6964;
    font-family: Manrope, sans-serif;
    font-size: 12px;
}

.noemat-component__point-label {
    fill: #18324A;
    font-weight: 600;
}

.noemat-component--fallback {
    padding: 0.9rem 1rem;
    background: #FBF8F3;
    border-left: 3px solid #D8D0C5;
    color: #6D6964;
}

@media (max-width: 767px) {
    .noemat-component[data-noemat-status="interactive"] {
        padding: 1rem;
    }

    .noemat-component__controls--grid {
        grid-template-columns: 1fr;
    }

    .noemat-component__step {
        grid-template-columns: 1fr;
    }
}


/* equation_cover_game_v5 — approved layered cover UX */
.noemat-cover-game__history {
    display: grid;
    gap: 0.7rem;
    margin: 0 0 1rem;
}

.noemat-cover-game__line {
    display: grid;
    grid-template-columns: minmax(10rem, auto) 1fr;
    gap: 1rem;
    align-items: center;
    padding: 0.8rem 0;
    border-bottom: 1px solid #D8D0C5;
}

.noemat-cover-game__line--active {
    border-left: 3px solid #9C4F2E;
    padding-left: 0.85rem;
}

.noemat-cover-game__line--result {
    border-bottom: 0;
    color: #18324A;
    font-weight: 600;
}

.noemat-cover-game__explanation {
    color: #6D6964;
    font-size: 0.875rem;
    line-height: 1.5;
}

.noemat-cover-game__line .noemat-math--display {
    margin: 0;
    padding: 0;
}

@media (max-width: 767px) {
    .noemat-cover-game__line {
        grid-template-columns: 1fr;
        gap: 0.35rem;
    }
}
