/* Certification is an overlay on the existing logo slot; it never participates in layout. */
.rankings-admissions-authorized-row,
.article-entity-card.rankings-admissions-authorized-card,
.school-detail-body .school-detail-page .school-detail-identity-card.rankings-admissions-authorized-card,
.kindergarten-detail-page .kg-detail-hero.rankings-admissions-authorized-card { position: relative; }
/* A table cell is a stable containing block across mobile browser engines. */
body table tbody > tr.rankings-admissions-authorized-row > th.ranking-school { position: relative; overflow: visible; }
.rankings-admissions-cert {
    position: absolute;
    width: 1px;
    height: 1px;
    clip-path: inset(50%);
    pointer-events: none;
    z-index: 2;
    box-sizing: border-box;
}
.rankings-admissions-cert[data-ready="true"] {
    clip-path: none;
    outline: 2px solid #a51e24;
    outline-offset: 2px;
    border-radius: 8px;
}
/* Detail certification follows the existing shell instead of adding an outer frame. */
.school-detail-body .school-detail-page .rankings-admissions-authorized-card .school-detail-logo-shell,
.kindergarten-detail-page .rankings-admissions-authorized-card .kg-detail-logo-shell,
.article-entity-card.rankings-admissions-authorized-card .article-entity-logo-shell {
    position: relative;
    outline: 0;
    box-shadow: none;
}
.school-detail-body .school-detail-page .rankings-admissions-authorized-card .school-detail-logo-shell::after,
.kindergarten-detail-page .rankings-admissions-authorized-card .kg-detail-logo-shell::after,
.article-entity-card.rankings-admissions-authorized-card .article-entity-logo-shell::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    box-sizing: border-box;
    border: 2px solid #a51e24;
    border-radius: inherit;
    pointer-events: none;
}
.rankings-admissions-authorized-row .ranking-logo-shell::after {
    border-width: 2px;
    border-color: #a51e24;
}
.rankings-admissions-authorized-card .rankings-admissions-cert[data-ready="true"],
.rankings-admissions-authorized-row .rankings-admissions-cert[data-ready="true"] {
    outline: none;
}
.rankings-admissions-cert .rankings-admissions-cert-check {
    position: absolute;
    right: -9px;
    bottom: -7px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    min-width: 0;
    width: 24px;
    height: 24px;
    box-sizing: border-box;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #a51e24;
    color: #fff;
    pointer-events: none;
    box-shadow: none;
}
.rankings-admissions-cert .rankings-admissions-cert-icon { width: 22px; height: 22px; display: block; color: inherit; }
.rankings-admissions-authorized-row :is(.schoolTitleLink, .school-title a, .kindergarten-detail-name-link) { color: #a51e24 !important; }
@media (min-width: 861px) {
    .school-detail-body.admissions-unauthorized .school-detail-page .school-detail-identity-card,
    .kindergarten-detail-page.admissions-unauthorized .kg-detail-hero {
        grid-template-columns: 128px minmax(0, 1fr);
    }
}
@media (max-width: 600px) {
    body.school-detail-body.admissions-unauthorized,
    body.kindergarten-detail-page.admissions-unauthorized {
        padding-bottom: 0;
    }
    .school-detail-body.admissions-unauthorized .school-detail-page {
        padding-bottom: 20px !important;
    }
    .kindergarten-detail-page.admissions-unauthorized .kg-detail-main {
        padding-bottom: 20px;
    }
    body.school-detail-body.admissions-unauthorized .school-detail-top-button,
    .kindergarten-detail-page.admissions-unauthorized .kg-detail-top-button {
        bottom: calc(20px + env(safe-area-inset-bottom));
    }
}
/* School names remain readable at every viewport width. */
.kindergarten-rank-page .kindergarten-table .ranking-school .school-title,
.annual-rank-page .ranking-school .schoolTitle,
.monthly-rank-page .ranking-school .schoolTitle {
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
    white-space: normal;
    word-break: normal;
    overflow-wrap: normal;
    text-wrap: wrap;
}
.kindergarten-detail-page .kg-detail-identity h1,
.kindergarten-detail-page.lang-en .kg-detail-identity h1 {
    text-wrap: wrap;
}

/* Authorized admissions actions retain the desktop accent at mobile widths. */
.school-detail-body .school-detail-page .school-detail-identity-actions .school-detail-action--match[data-rankings-admissions-language],
.kg-detail-mobile-actions .kg-detail-action-primary[data-rankings-admissions-language],
.article-conversion-cta .school-detail-action--match[data-rankings-admissions-language] {
    background: #991b1b;
    color: #fff;
}
.school-detail-body .school-detail-page .school-detail-identity-actions .school-detail-action--match[data-rankings-admissions-language]:hover,
.kg-detail-mobile-actions .kg-detail-action-primary[data-rankings-admissions-language]:hover,
.article-conversion-cta .school-detail-action--match[data-rankings-admissions-language]:hover {
    background: #7f1d1d;
}
.school-detail-body .school-detail-page .school-detail-identity-actions .school-detail-action--match[data-rankings-admissions-language]:focus-visible,
.kg-detail-mobile-actions .kg-detail-action-primary[data-rankings-admissions-language]:focus-visible,
.article-conversion-cta .school-detail-action--match[data-rankings-admissions-language]:focus-visible {
    outline-color: rgba(153, 27, 27, .28);
}

/* Compact, always-visible corner label with balanced content spacing. */
.rankings-admissions-corner {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 1;
    display: block;
    box-sizing: border-box;
    padding: 2px 7px;
    border-radius: 0 0 0 7px;
    background: #a51e24;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.4;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal;
    pointer-events: none;
}
.rankings-admissions-authorized-row .rankings-admissions-corner {
    right: var(--admissions-corner-right, 0px);
    max-width: var(--admissions-corner-width, 100%);
}
@media (min-width: 801px) {
    .rankings-admissions-authorized-row .rankings-admissions-corner {
        font-size: 12px;
        padding: 3px 10px;
        border-bottom-left-radius: 8px;
    }
}
/* Added only when the corner would overlap content. */
[data-admissions-spacing] {
    padding-top: var(--admissions-padding-top) !important;
    padding-bottom: var(--admissions-padding-bottom) !important;
}
.rankings-admissions-authorized-card > .rankings-admissions-corner {
    font-size: 14px;
    line-height: 1.5;
    padding: 6px 16px;
    border-bottom-left-radius: 8px;
    border-top-right-radius: inherit;
}
@media (max-width: 1024px) {
    .rankings-admissions-authorized-card > .rankings-admissions-corner {
        font-size: 13px;
        padding: 5px 12px;
    }
}
@media (max-width: 600px) {
    .rankings-admissions-authorized-card > .rankings-admissions-corner {
        font-size: 12px;
        padding: 4px 10px;
    }
}
