/* ==========================================================================
   Кейсы «Реестр Гарант» (/keysy/).
   Слой над template-commercial-auto.css: каталог остаётся доступным без JS,
   а после инициализации получает фильтры, группы и карточки-досье.
   ========================================================================== */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Hero */
.keysy-page .auto-hero {
    padding: 78px 0 68px;
}

.keysy-eyebrow {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 25px;
    color: #b5c5dc;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.keysy-eyebrow > span {
    width: 7px;
    height: 7px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #a4a7ff;
    box-shadow: 0 0 0 4px rgba(164, 167, 255, .1);
}

.keysy-page .auto-hero h1 {
    max-width: 980px;
}

.keysy-page .auto-hero h1 em {
    color: #b8baff;
    font-style: normal;
}

.keysy-lead {
    max-width: 790px;
    margin: 24px 0 0;
    color: #d7dfeb;
    font-size: 17px;
    line-height: 1.72;
}

.keysy-hero-facts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    max-width: 920px;
    margin-top: 32px;
    padding-top: 27px;
    border-top: 1px solid #2b374c;
}

.keysy-hero-facts > div {
    min-width: 0;
}

.keysy-hero-facts b {
    display: block;
    color: #fff;
    font-size: 21px;
    letter-spacing: -.04em;
}

.keysy-hero-facts span {
    display: block;
    margin-top: 7px;
    color: #a9b8ce;
    font-size: 11px;
    line-height: 1.55;
}

.keysy-disclaimer {
    max-width: 900px;
    margin-top: 24px;
    padding: 14px 17px;
    border-left: 4px solid var(--auto-cyan);
    border-radius: 0 9px 9px 0;
    background: rgba(37, 199, 217, .08);
    color: #c7d4e8;
    font-size: 13px;
    line-height: 1.65;
}

.keysy-disclaimer a {
    color: #fff;
    font-weight: 700;
}

.keysy-hero-actions {
    margin-top: 27px;
}

/* Маршруты */
.keysy-directions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 31px;
}

.keysy-direction-card {
    --keysy-accent: #4054d7;
    position: relative;
    overflow: hidden;
    min-height: 268px;
    border: 1px solid #dbe1ea;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 25px rgba(22, 34, 59, .04);
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.keysy-direction-card::before {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 4px;
    background: var(--keysy-accent);
    content: "";
}

.keysy-direction-card:hover,
.keysy-direction-card:focus-within {
    border-color: color-mix(in srgb, var(--keysy-accent) 42%, #dbe1ea);
    box-shadow: 0 14px 35px rgba(22, 34, 59, .1);
    transform: translateY(-3px);
}

.keysy-direction-card--pp878 {
    --keysy-accent: #7a58cc;
}

.keysy-direction-card--other {
    --keysy-accent: #087f91;
}

.keysy-direction-select {
    display: flex;
    width: 100%;
    min-height: 208px;
    flex-direction: column;
    align-items: flex-start;
    padding: 27px 25px 20px;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.keysy-direction-select:focus-visible,
.keysy-filter-tabs button:focus-visible,
.keysy-show-more:focus-visible,
.keysy-card-link:focus-visible,
.keysy-direction-card > a:focus-visible {
    outline: 3px solid rgba(64, 84, 215, .3);
    outline-offset: 3px;
}

.keysy-direction-index {
    color: var(--keysy-accent);
    font: 700 11px/1 "Roboto Mono", monospace;
    letter-spacing: .1em;
}

.keysy-direction-label {
    display: block;
    margin-top: 19px;
    color: #64708a;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.keysy-direction-card strong {
    display: block;
    margin-top: 8px;
    color: #18233a;
    font: 800 24px/1.14 "Manrope", sans-serif;
    letter-spacing: -.04em;
}

.keysy-direction-card strong b {
    display: block;
    margin-top: 7px;
    color: #58647b;
    font: 600 12px/1.45 "Roboto Mono", monospace;
    letter-spacing: 0;
}

.keysy-direction-select > span:last-child {
    display: block;
    margin-top: auto;
    color: #516077;
    font-size: 13px;
    line-height: 1.55;
}

.keysy-direction-card > a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0 25px 23px;
    color: var(--keysy-accent);
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.keysy-direction-card > a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.keysy-direction-card > a .material-symbols-outlined {
    font-size: 17px;
    transition: transform .2s ease;
}

.keysy-direction-card > a:hover .material-symbols-outlined {
    transform: translateX(3px);
}

/* Каталог */
.keysy-explorer {
    margin-top: 25px;
    overflow: hidden;
    border: 1px solid #dbe1ea;
    border-radius: 18px;
    background: #f8fafc;
}

.keysy-explorer-toolbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    padding: 25px 27px 17px;
}

.keysy-filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.keysy-filter-tabs button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 37px;
    padding: 8px 12px;
    border: 1px solid #d5dce8;
    border-radius: 999px;
    background: #fff;
    color: #44516a;
    cursor: pointer;
    font: 700 12px/1.2 "Manrope", sans-serif;
    transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}

.keysy-filter-tabs button:hover {
    border-color: #9eabca;
    transform: translateY(-1px);
}

.keysy-filter-tabs button.is-active {
    border-color: #263d9a;
    background: #263d9a;
    color: #fff;
}

.keysy-filter-tabs button span {
    padding: 2px 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .16);
    font: 700 10px/1 "Roboto Mono", monospace;
}

.keysy-filter-tabs button:not(.is-active) span {
    background: #eef1f7;
    color: #68758e;
}

.keysy-search {
    display: flex;
    align-items: center;
    gap: 9px;
    width: min(100%, 330px);
    min-height: 42px;
    padding: 0 13px;
    border: 1px solid #d5dce8;
    border-radius: 9px;
    background: #fff;
    color: #65728c;
}

.keysy-search:focus-within {
    border-color: #5269d4;
    box-shadow: 0 0 0 3px rgba(82, 105, 212, .12);
}

.keysy-search .material-symbols-outlined {
    font-size: 19px;
}

.keysy-search input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #1b2841;
    font: 500 13px/1.2 "Manrope", sans-serif;
}

.keysy-search input::placeholder {
    color: #8b96aa;
}

.keysy-results {
    margin: 0;
    padding: 0 27px 20px;
    color: #66738c;
    font: 600 11px/1.5 "Roboto Mono", monospace;
}

.keysy-groups {
    border-top: 1px solid #dbe1ea;
}

.keysy-group {
    --keysy-group-accent: #4054d7;
    padding: 33px 27px;
    background: #fff;
}

.keysy-group + .keysy-group {
    border-top: 1px solid #e0e5ee;
}

.keysy-group[data-keysy-group="pp878"] {
    --keysy-group-accent: #7a58cc;
    background: #fdfcff;
}

.keysy-group[data-keysy-group="other"] {
    --keysy-group-accent: #087f91;
    background: #fbfeff;
}

.keysy-group-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    align-items: end;
}

.keysy-group-kicker {
    display: block;
    color: var(--keysy-group-accent);
    font: 700 10px/1 "Roboto Mono", monospace;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.keysy-group-head h2 {
    max-width: 720px;
    margin: 8px 0 0;
    color: #18233a;
    font: 800 27px/1.18 "Manrope", sans-serif;
    letter-spacing: -.045em;
}

.keysy-group-head p {
    max-width: 720px;
    margin: 10px 0 0;
    color: #59677e;
    font-size: 14px;
    line-height: 1.6;
}

.keysy-group-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding-bottom: 4px;
    color: var(--keysy-group-accent);
    font-size: 12px;
    font-weight: 800;
    text-align: right;
    text-decoration: none;
}

.keysy-group-link:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.keysy-group-link .material-symbols-outlined {
    font-size: 17px;
}

.keysy-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 17px;
    margin-top: 24px;
}

.keysy-card {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 284px;
    flex-direction: column;
    padding: 23px;
    border: 1px solid #dce3ed;
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 5px 17px rgba(23, 35, 59, .035);
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.keysy-card::before {
    position: absolute;
    top: 22px;
    right: 0;
    bottom: 22px;
    width: 3px;
    border-radius: 3px 0 0 3px;
    background: var(--keysy-group-accent, #4054d7);
    content: "";
    opacity: .72;
}

.keysy-card:hover {
    border-color: color-mix(in srgb, var(--keysy-group-accent, #4054d7) 34%, #dce3ed);
    box-shadow: 0 13px 26px rgba(23, 35, 59, .1);
    transform: translateY(-2px);
}

.keysy-card-number {
    position: absolute;
    top: 16px;
    right: 17px;
    color: #c3cad6;
    font: 700 10px/1 "Roboto Mono", monospace;
    letter-spacing: .06em;
}

.keysy-card-tag {
    display: flex;
    align-items: center;
    align-self: flex-start;
    gap: 6px;
    max-width: calc(100% - 38px);
    margin-bottom: 15px;
    color: var(--keysy-group-accent, #4054d7);
    font: 700 10px/1.25 "Roboto Mono", monospace;
    letter-spacing: .055em;
    text-transform: uppercase;
}

.keysy-card-route {
    padding: 5px 7px;
    border: 1px solid color-mix(in srgb, var(--keysy-group-accent, #4054d7) 28%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--keysy-group-accent, #4054d7) 8%, #fff);
}

.keysy-card-sector {
    overflow: hidden;
    color: #748198;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.keysy-card h3 {
    margin: 0 0 11px;
    color: #1b2841;
    font: 800 18px/1.36 "Manrope", sans-serif;
    letter-spacing: -.025em;
}

.keysy-card h3 a {
    color: inherit;
    text-decoration: none;
}

.keysy-card h3 a:hover {
    color: var(--keysy-group-accent, #4054d7);
}

.keysy-card p {
    margin: 0;
    color: #536078;
    font-size: 14px;
    line-height: 1.62;
}

.keysy-card-meta {
    margin-top: 14px;
    color: #758299;
    font: 600 11px/1.5 "Roboto Mono", monospace;
    letter-spacing: .02em;
}

.keysy-card-proof {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px !important;
    color: #607088 !important;
    font-size: 11px !important;
    line-height: 1.45 !important;
}

.keysy-card-proof::before {
    width: 6px;
    height: 6px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--keysy-group-accent, #4054d7);
    content: "";
}

.keysy-card-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: auto;
    padding-top: 18px;
    color: var(--keysy-group-accent, #4054d7);
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.keysy-card-link:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.keysy-card-link .material-symbols-outlined {
    font-size: 17px;
    transition: transform .2s ease;
}

.keysy-card-link:hover .material-symbols-outlined {
    transform: translateX(3px);
}

.keysy-show-more {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 43px;
    margin: 22px auto 0;
    padding: 10px 18px;
    border: 1px solid color-mix(in srgb, var(--keysy-group-accent) 35%, #d4dbe6);
    border-radius: 8px;
    background: #fff;
    color: var(--keysy-group-accent);
    cursor: pointer;
    font: 800 12px/1.2 "Manrope", sans-serif;
    transition: background .18s ease, color .18s ease, transform .18s ease;
}

.keysy-show-more:hover {
    background: var(--keysy-group-accent);
    color: #fff;
    transform: translateY(-1px);
}

.keysy-empty {
    margin: 0;
    padding: 38px 27px;
    color: #5e6b82;
    font-size: 14px;
    line-height: 1.65;
    text-align: center;
}

.keysy-note {
    max-width: 850px;
    margin: 24px 0 0;
    color: var(--auto-muted);
    font-size: 14px;
    line-height: 1.7;
}

.keysy-note a {
    color: var(--auto-blue);
    font-weight: 700;
}

/* Блок доверия */
.keysy-trust {
    padding: 84px 0;
    background: #111c32;
    color: #fff;
}

.keysy-trust-head {
    max-width: 820px;
}

.keysy-trust .auto-kicker {
    color: #9eadff;
}

.keysy-trust h2 {
    max-width: 760px;
    margin: 11px 0 0;
    color: #fff;
    font: 800 clamp(29px, 4vw, 48px)/1.1 "Manrope", sans-serif;
    letter-spacing: -.055em;
}

.keysy-trust-head > p {
    max-width: 770px;
    margin: 20px 0 0;
    color: #c4cfdf;
    font-size: 16px;
    line-height: 1.72;
}

.keysy-proof-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 35px;
}

.keysy-proof-grid article {
    padding: 24px;
    border: 1px solid rgba(183, 199, 230, .18);
    border-radius: 13px;
    background: rgba(255, 255, 255, .045);
}

.keysy-proof-grid h3 {
    margin: 0;
    color: #fff;
    font: 800 17px/1.35 "Manrope", sans-serif;
}

.keysy-proof-grid p {
    margin: 10px 0 0;
    color: #bdc9dc;
    font-size: 13px;
    line-height: 1.65;
}

.keysy-trust-note {
    max-width: 830px;
    margin: 22px 0 0;
    color: #b7c4d7;
    font-size: 13px;
    line-height: 1.7;
}

.keysy-trust-note a {
    color: #fff;
    font-weight: 700;
}

/* Нарратив отдельных кейсов */
.keysy-prose {
    max-width: 820px;
}

.keysy-prose p {
    margin: 0 0 20px;
    color: #262f42;
    font-size: 17px;
    line-height: 1.75;
}

.keysy-prose p:last-child {
    margin-bottom: 0;
}

.keysy-prose strong {
    color: #131b2e;
}

.keysy-highlight {
    margin: 30px 0;
    padding: 24px 26px;
    border-left: 4px solid var(--auto-violet);
    border-radius: 0 12px 12px 0;
    background: rgba(128, 131, 255, .07);
}

.keysy-highlight h3 {
    margin: 0 0 12px;
    color: var(--auto-ink);
    font: 800 21px/1.3 "Manrope", sans-serif;
}

.keysy-highlight p {
    margin: 0;
    color: #262f42;
    font-size: 17px;
    line-height: 1.75;
}

.keysy-quote {
    margin: 26px 0;
    padding: 20px 24px;
    border-left: 4px solid var(--auto-cyan);
    border-radius: 0 12px 12px 0;
    background: rgba(37, 199, 217, .07);
    color: #262f42;
    font-size: 16px;
    line-height: 1.7;
}

.keysy-quote cite {
    display: block;
    margin-top: 12px;
    color: var(--auto-muted);
    font: 600 12px/1.4 "Roboto Mono", monospace;
    font-style: normal;
    letter-spacing: .03em;
}

@media (max-width: 1050px) {
    .keysy-directions,
    .keysy-proof-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .keysy-explorer-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .keysy-search {
        width: 100%;
    }
}

@media (max-width: 760px) {
    .keysy-page .auto-hero {
        padding: 55px 0 48px;
    }

    .keysy-lead {
        font-size: 15px;
    }

    .keysy-hero-facts,
    .keysy-directions,
    .keysy-proof-grid,
    .keysy-grid {
        grid-template-columns: 1fr;
    }

    .keysy-hero-facts {
        gap: 16px;
    }

    .keysy-direction-card {
        min-height: 0;
    }

    .keysy-direction-select {
        min-height: 0;
    }

    .keysy-explorer-toolbar,
    .keysy-group {
        padding-right: 18px;
        padding-left: 18px;
    }

    .keysy-results {
        padding-right: 18px;
        padding-left: 18px;
    }

    .keysy-group-head {
        grid-template-columns: 1fr;
        gap: 13px;
    }

    .keysy-group-link {
        justify-self: start;
        text-align: left;
    }

    .keysy-group-head h2 {
        font-size: 23px;
    }

    .keysy-card {
        min-height: 0;
    }

    .keysy-trust {
        padding: 61px 0;
    }
}

@media (max-width: 460px) {
    .keysy-eyebrow {
        font-size: 8px;
        letter-spacing: .1em;
    }

    .keysy-hero-facts b {
        font-size: 19px;
    }

    .keysy-filter-tabs {
        gap: 6px;
    }

    .keysy-filter-tabs button {
        padding: 8px 10px;
        font-size: 11px;
    }

    .keysy-card,
    .keysy-proof-grid article {
        padding: 20px;
    }

    .keysy-card h3 {
        font-size: 17px;
    }
}
