.cn-make24 {
    --make24-ink: var(--ink, #17233c);
    --make24-body: var(--body, #344054);
    --make24-muted: var(--muted, #667085);
    --make24-border: var(--border, #d9e0ea);
    --make24-primary: var(--violet, #6f4bb6);
    --make24-primary-soft: var(--violet-soft, #f1ebfb);
    --make24-accent: #f6b73c;
    --make24-success: #18794e;
    --make24-success-soft: #e9f8f0;
    --make24-danger: #b42318;
    --make24-danger-soft: #fff0ee;
    display: grid;
    gap: clamp(1.1rem, 3vw, 1.75rem);
    margin-top: 1.5rem;
    color: var(--make24-body);
}

.cn-make24 [hidden] {
    display: none !important;
}

.cn-make24__intro {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.25rem;
    padding: clamp(1rem, 3vw, 1.5rem);
    background: linear-gradient(135deg, #f7f3ff 0%, #fff8e8 100%);
    border: 1px solid #ded2f2;
    border-radius: 1rem;
}

.detail-demo-card .cn-make24__intro h2 {
    margin: 0;
    color: var(--make24-ink);
    font-size: clamp(1.45rem, 4vw, 2rem);
    line-height: 1.15;
}

.cn-make24__intro p:last-child {
    max-width: 52rem;
    margin: 0.65rem 0 0;
    line-height: 1.6;
}

.cn-make24__eyebrow {
    margin: 0 0 0.35rem;
    color: var(--make24-primary);
    font-size: 0.75rem;
    font-weight: 850;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.cn-make24__target {
    display: grid;
    min-width: 5.6rem;
    padding: 0.65rem 0.9rem;
    place-items: center;
    flex: 0 0 auto;
    color: #fff;
    background: var(--make24-ink);
    border-radius: 0.9rem;
    box-shadow: 0 0.65rem 1.5rem rgb(23 35 60 / 18%);
}

.cn-make24__target span {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.cn-make24__target strong {
    font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
    font-size: 2rem;
    line-height: 1.05;
}

.cn-make24__toolbar {
    display: grid;
    grid-template-columns: auto minmax(9rem, 13rem) 1fr;
    align-items: center;
    gap: 0.65rem 0.8rem;
}

.cn-make24__toolbar > label {
    color: var(--make24-ink);
    font-weight: 750;
}

.cn-make24__toolbar .form-select {
    min-height: 44px;
}

.cn-make24__stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.45rem;
}

.cn-make24__stats span {
    padding: 0.42rem 0.68rem;
    color: var(--make24-ink);
    background: #fff;
    border: 1px solid var(--make24-border);
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 750;
}

.cn-make24__workspace {
    display: grid;
    gap: 1rem;
}

.cn-make24__play,
.cn-make24__history,
.cn-make24__solution-card {
    background: #fff;
    border: 1px solid var(--make24-border);
    border-radius: 1rem;
}

.cn-make24__play {
    display: grid;
    gap: 1.15rem;
    padding: clamp(1rem, 3vw, 1.5rem);
    box-shadow: 0 0.8rem 2rem rgb(23 35 60 / 7%);
}

.cn-make24__loading {
    margin: 0;
    color: var(--make24-muted);
    text-align: center;
}

.cn-make24__tiles {
    display: flex;
    min-height: 7rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: clamp(0.65rem, 2vw, 1rem);
}

.cn-make24__tile,
.cn-make24__operator {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.cn-make24__tile {
    display: grid;
    min-width: clamp(4.7rem, 16vw, 6.25rem);
    min-height: clamp(5rem, 17vw, 6.5rem);
    padding: 0.65rem;
    place-items: center;
    color: var(--make24-ink);
    background: linear-gradient(160deg, #fff 0%, #f5f7fb 100%);
    border: 2px solid var(--make24-border);
    border-radius: 1rem;
    box-shadow: 0 0.55rem 1.1rem rgb(23 35 60 / 9%);
    font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
    font-size: clamp(1.35rem, 5vw, 2rem);
    font-weight: 850;
    line-height: 1;
    transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.cn-make24__tile:hover:not(:disabled) {
    border-color: var(--make24-primary);
    transform: translateY(-2px);
}

.cn-make24__tile.is-selected {
    border-color: #9a6500;
    background: #fff5d6;
    box-shadow: 0 0 0 4px rgb(246 183 60 / 38%);
    transform: translateY(-2px);
}

.cn-make24.is-solved .cn-make24__tile:only-child {
    color: var(--make24-success);
    background: var(--make24-success-soft);
    border-color: var(--make24-success);
    box-shadow: 0 0 0 4px rgb(24 121 78 / 16%);
}

.cn-make24__operation {
    display: grid;
    gap: 0.75rem;
    padding: 0.9rem;
    background: #f7f8fb;
    border: 1px solid var(--make24-border);
    border-radius: 0.85rem;
}

.cn-make24__selection {
    min-height: 1.5rem;
    color: var(--make24-ink);
    font-weight: 700;
    line-height: 1.45;
    overflow-wrap: anywhere;
    text-align: center;
}

.cn-make24__operators {
    display: grid;
    grid-template-columns: repeat(4, minmax(3rem, 1fr));
    gap: 0.55rem;
}

.cn-make24__operator {
    min-height: 50px;
    padding: 0.35rem;
    color: var(--make24-ink);
    background: #fff;
    border: 2px solid var(--make24-border);
    border-radius: 0.75rem;
    font-size: 1.45rem;
    font-weight: 850;
}

.cn-make24__operator:hover:not(:disabled) {
    border-color: var(--make24-primary);
}

.cn-make24__operator.is-selected {
    color: #fff;
    background: var(--make24-primary);
    border-color: var(--make24-primary);
}

.cn-make24__operator:disabled {
    cursor: not-allowed;
    opacity: 0.42;
}

.cn-make24__feedback {
    display: block;
    min-height: 2.9rem;
    padding: 0.72rem 0.85rem;
    color: var(--make24-ink);
    background: #eef4ff;
    border-left: 4px solid #3b6fc4;
    border-radius: 0.55rem;
    line-height: 1.45;
}

.cn-make24__feedback:empty {
    min-height: 0;
    padding: 0;
    border: 0;
}

.cn-make24__feedback[data-tone="success"] {
    color: #0f5c3a;
    background: var(--make24-success-soft);
    border-color: var(--make24-success);
}

.cn-make24__feedback[data-tone="error"] {
    color: #8c1d14;
    background: var(--make24-danger-soft);
    border-color: var(--make24-danger);
}

.cn-make24__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.cn-make24__actions .btn,
.cn-make24__solution-card .btn {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 0.42rem;
    touch-action: manipulation;
}

.cn-make24__side {
    display: grid;
    align-content: start;
    gap: 1rem;
}

.cn-make24__history,
.cn-make24__solution-card {
    padding: 1rem;
}

.detail-demo-card .cn-make24__history h3,
.detail-demo-card .cn-make24__solution-card h3 {
    margin: 0 0 0.75rem;
    color: var(--make24-ink);
    font-size: 1rem;
}

.cn-make24__history p {
    margin: 0;
    color: var(--make24-muted);
    font-size: 0.9rem;
}

.cn-make24__history ol {
    display: grid;
    gap: 0.42rem;
    margin: 0;
    padding-left: 1.45rem;
    font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
    font-size: 0.9rem;
}

.cn-make24__history li {
    padding-left: 0.2rem;
    overflow-wrap: anywhere;
}

.cn-make24__solution-card {
    background: #faf8ff;
    border-color: #ded2f2;
}

.cn-make24__solution {
    margin: 0.85rem 0 0;
    padding: 0.75rem;
    color: var(--make24-ink);
    background: #fff;
    border: 1px dashed var(--make24-primary);
    border-radius: 0.6rem;
    font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
    font-size: 1rem;
    font-weight: 750;
    overflow-wrap: anywhere;
}

@media (min-width: 720px) {
    .cn-make24__workspace {
        grid-template-columns: minmax(0, 1.55fr) minmax(13rem, 0.75fr);
        align-items: start;
    }
}

@media (max-width: 575.98px) {
    .cn-make24__intro {
        align-items: center;
    }

    .cn-make24__target {
        min-width: 4.7rem;
        padding-inline: 0.65rem;
    }

    .cn-make24__toolbar {
        grid-template-columns: 1fr;
    }

    .cn-make24__stats {
        justify-content: flex-start;
    }

    .cn-make24__tiles {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cn-make24.is-finished .cn-make24__tiles {
        grid-template-columns: minmax(0, 8rem);
        justify-content: center;
    }

    .cn-make24__tile {
        width: 100%;
    }

    .cn-make24__actions .btn {
        flex: 1 1 calc(50% - 0.6rem);
    }

    .cn-make24__actions .btn-primary {
        flex-basis: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cn-make24__tile {
        transition: none;
    }
}

@media (forced-colors: active) {
    .cn-make24__tile.is-selected,
    .cn-make24__operator.is-selected {
        outline: 3px solid Highlight;
        outline-offset: 2px;
    }
}
