.clients-section__layout {
    display: grid;
    gap: 1.5rem;
}

/* Мобилка: сначала текст, затем мозаика (десктоп не трогаем) */
@media (max-width: 1023px) {
    .clients-section__text {
        order: 1;
    }

    .clients-section__mosaic {
        order: 2;
    }
}

@media (min-width: 1024px) {
    .clients-section__layout {
        grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
        gap: 2rem;
        align-items: center;
    }

    .clients-section__mosaic,
    .clients-section__text {
        order: initial;
    }
}

.clients-section__mosaic {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(10, auto);
    gap: 0.5rem 0.625rem;
}

@media (min-width: 640px) {
    .clients-section__mosaic {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        grid-template-rows: repeat(5, auto);
        gap: 0.625rem 0.75rem;
    }
}

.clients-section__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 3rem;
    padding: 0.5rem 0.35rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgb(161 161 170);
    border: 1px dashed rgb(212 212 216);
    border-radius: 0.5rem;
    opacity: 0.7;
}

.dark .clients-section__placeholder {
    color: rgb(113 113 122);
    border-color: rgb(63 63 70);
}

.clients-section__text {
    max-width: 26rem;
}

/* Кейсы - лог на всю ширину секции */
.clients-cases {
    margin-top: 2.5rem;
    width: 100%;
}

@media (min-width: 1024px) {
    .clients-cases {
        margin-top: 3rem;
    }
}

.clients-cases__panel {
    position: relative;
    overflow: hidden;
    border-radius: 0.75rem;
    border: 1px solid rgb(24 24 27);
    background: rgb(24 24 27);
    color: rgb(228 228 231);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.08) inset,
        0 16px 48px rgba(0, 0, 0, 0.14);
}

.clients-cases__panel::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 24px 24px;
    mask-image: linear-gradient(to bottom, black 0%, transparent 85%);
}

.dark .clients-cases__panel {
    background: rgb(24 24 27);
    border-color: rgb(39 39 42);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.dark .clients-cases__panel::before {
    opacity: 0.35;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
}

.clients-cases__chrome {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    padding: 0.55rem 0.875rem;
    background: rgb(39 39 42);
    border-bottom: 1px solid rgb(63 63 70);
}

.dark .clients-cases__chrome {
    background: rgb(30 30 33);
    border-bottom-color: rgb(39 39 42);
}

.clients-cases__dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    flex-shrink: 0;
}

.clients-cases__dot--close {
    background: rgb(161 161 170);
}

.clients-cases__dot--min {
    background: rgb(113 113 122);
}

.clients-cases__dot--max {
    background: rgb(82 82 91);
}

.dark .clients-cases__dot--close,
.dark .clients-cases__dot--min,
.dark .clients-cases__dot--max {
    background: rgb(63 63 70);
    opacity: 1;
}

.clients-cases__chrome-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.6875rem;
    letter-spacing: 0.03em;
    color: rgb(212 212 216);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.clients-cases__chrome-label .ph {
    flex-shrink: 0;
    font-size: 0.875rem;
    opacity: 0.85;
}

.dark .clients-cases__chrome-label {
    color: rgb(212 212 216);
}

.clients-cases__chrome-status {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-left: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.625rem;
    color: rgb(161 161 170);
}

.clients-cases__chrome-status .ph {
    flex-shrink: 0;
    font-size: 0.8125rem;
    opacity: 0.8;
}

.dark .clients-cases__chrome-status {
    color: rgb(161 161 170);
}

.clients-cases__log {
    position: relative;
    z-index: 1;
    margin: 0;
    padding: 0.875rem 1rem;
    list-style: none;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.75rem;
    line-height: 1.5;
}

@media (min-width: 768px) {
    .clients-cases__log {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0;
        padding: 0;
    }
}

.clients-cases__line {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 0.5rem;
    padding: 0.875rem 1rem;
}

.clients-cases__line .clients-cases__outcome {
    flex: 1 1 100%;
}

.clients-cases__line + .clients-cases__line {
    border-top: 1px solid rgb(39 39 42);
}

.dark .clients-cases__line + .clients-cases__line {
    border-top-color: rgb(39 39 42);
}

@media (min-width: 768px) {
    .clients-cases__line {
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: flex-start;
        gap: 0.4rem;
        padding: 1rem 1.125rem 1.125rem;
        min-height: 5.5rem;
    }

    .clients-cases__line .clients-cases__outcome {
        flex: none;
        width: 100%;
    }

    .clients-cases__line + .clients-cases__line {
        border-top: none;
        border-left: 1px solid rgb(39 39 42);
    }

    .dark .clients-cases__line + .clients-cases__line {
        border-left-color: rgb(39 39 42);
    }

    .clients-cases__line:nth-child(n + 4) {
        border-top: 1px solid rgb(39 39 42);
    }

    .dark .clients-cases__line:nth-child(n + 4) {
        border-top-color: rgb(39 39 42);
    }

    .clients-cases__line:nth-child(3n + 1) {
        border-left: none;
    }
}

.clients-cases__prompt {
    flex-shrink: 0;
    color: rgb(113 113 122);
    user-select: none;
}

.dark .clients-cases__prompt {
    color: rgb(82 82 91);
}

.clients-cases__cmd {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    max-width: 100%;
    padding: 0.15rem 0;
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    color: rgb(212 212 216);
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    text-decoration: underline;
    text-decoration-color: rgb(82 82 91);
    text-underline-offset: 3px;
    transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.clients-cases__cmd-icon {
    flex-shrink: 0;
    font-size: 1rem;
    text-decoration: none;
    opacity: 0.75;
    transition: opacity 0.15s ease;
}

.clients-cases__cmd:hover {
    color: rgb(250 250 250);
    text-decoration-color: rgb(161 161 170);
}

.clients-cases__cmd:hover .clients-cases__cmd-icon {
    opacity: 1;
}

.dark .clients-cases__cmd {
    color: rgb(212 212 216);
    text-decoration-color: rgb(63 63 70);
}

.dark .clients-cases__cmd:hover {
    color: rgb(244 244 245);
    text-decoration-color: rgb(113 113 122);
}

.clients-cases__outcome {
    font-size: 0.6875rem;
    line-height: 1.55;
    color: rgb(161 161 170);
}

@media (min-width: 640px) {
    .clients-cases__outcome {
        font-size: 0.75rem;
    }
}

.dark .clients-cases__outcome {
    color: rgb(113 113 122);
}

.clients-cases__footer {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.75rem 1rem 0.875rem;
    border-top: 1px solid rgb(39 39 42);
    background: rgb(30 30 33);
}

.dark .clients-cases__footer {
    border-top-color: rgb(39 39 42);
    background: rgb(30 30 33);
}

@media (min-width: 640px) {
    .clients-cases__footer {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        padding: 0.75rem 1.125rem 0.875rem;
    }
}

.clients-cases__footer-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.75rem;
}

.clients-cases__request {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: rgb(228 228 231);
    text-decoration: none;
    transition: color 0.15s ease;
}

.clients-cases__request .ph {
    flex-shrink: 0;
    font-size: 0.875rem;
    opacity: 0.85;
}

.clients-cases__request:hover {
    color: rgb(250 250 250);
}

.clients-cases__request:hover .ph {
    opacity: 1;
}

.dark .clients-cases__request {
    color: rgb(212 212 216);
}

.dark .clients-cases__request:hover {
    color: rgb(244 244 245);
}

.clients-cases__footer-hint {
    display: inline-flex;
    align-items: flex-start;
    gap: 0.35rem;
    margin: 0;
    font-size: 0.6875rem;
    line-height: 1.45;
    color: rgb(161 161 170);
}

.clients-cases__footer-hint .ph {
    flex-shrink: 0;
    margin-top: 0.1rem;
    font-size: 0.8125rem;
    opacity: 0.75;
}

.dark .clients-cases__footer-hint {
    color: rgb(161 161 170);
}

.clients-cases__cursor {
    display: inline-block;
    width: 0.5rem;
    height: 0.875rem;
    margin-left: 0.1rem;
    background: rgb(161 161 170);
    animation: clients-cases-blink 1.1s step-end infinite;
}

.dark .clients-cases__cursor {
    background: rgb(113 113 122);
}

@keyframes clients-cases-blink {
    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .clients-cases__cursor {
        animation: none;
        opacity: 0.6;
    }
}
