/* Shared admissions UI refinements. */

.detail-results-search {
    margin: 4px 0 18px;
    padding: 14px 16px;
    border: 1px solid #dfe4ee;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(16, 24, 40, .045);
}

.detail-results-search-box {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
}

.detail-results-search-icon {
    color: #98a2b3;
    font-size: 22px;
    line-height: 1;
    text-align: center;
}

.detail-results-search-box input {
    width: 100%;
    min-width: 0;
    min-height: 46px;
    padding: 0 4px;
    border: 0;
    outline: 0;
    color: #101828;
    background: transparent;
    font-size: 14px;
}

.detail-results-search-box input::placeholder {
    color: #98a2b3;
}

.detail-results-search-box .button {
    min-width: 72px;
    min-height: 42px;
    box-shadow: none;
}

.mobile-admission-compact {
    display: none;
}

@media (max-width: 720px) {
    /*
     * Mobile admissions pagination should prioritize previous/next.
     * admissions-overview.css used to hide the first button in BOTH groups,
     * which unintentionally hid the "다음" button on the right side.
     */
    .results-pager .pagination-side:last-child .page-button:first-child {
        display: inline-flex;
    }

    .results-pager .pagination-side:first-child .page-button:first-child,
    .results-pager .pagination-side:last-child .page-button:last-child {
        display: none;
    }

    .detail-results-search {
        margin-top: 2px;
        padding: 11px 12px;
        border-radius: 16px;
    }

    .detail-results-search-box {
        grid-template-columns: 20px minmax(0, 1fr) auto;
        gap: 5px;
    }

    .detail-results-search-icon {
        font-size: 19px;
    }

    .detail-results-search-box input {
        min-height: 42px;
        font-size: 13px;
    }

    .detail-results-search-box .button {
        min-width: 64px;
        min-height: 40px;
        padding: 0 12px;
        font-size: 12px;
    }

    /* ---------------------------------------------------------
       Admissions mobile ultra-compact list
       Desktop keeps the full table. Mobile shows one summary row.
       --------------------------------------------------------- */
    .admissions-table-wrap,
    .overview-results-table {
        overflow: hidden !important;
        border: 1px solid #e4e7ec !important;
        border-radius: 15px !important;
        background: #fff !important;
        box-shadow: 0 2px 7px rgba(16, 24, 40, .03) !important;
    }

    .admissions-table-wrap table,
    .admissions-table-wrap tbody,
    .overview-results-table table,
    .overview-results-table tbody {
        width: 100% !important;
        min-width: 0 !important;
        display: block !important;
    }

    .admissions-table-wrap thead,
    .overview-results-table thead {
        display: none !important;
    }

    .admissions-table-wrap tbody,
    .overview-results-table tbody {
        gap: 0 !important;
    }

    .admissions-table-wrap tbody tr:not(.empty-table-row),
    .overview-results-table tbody tr:not(.empty-table-row) {
        display: block !important;
        margin: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: #fff !important;
        box-shadow: none !important;
    }

    .admissions-table-wrap tbody tr:not(.empty-table-row) + tr:not(.empty-table-row),
    .overview-results-table tbody tr:not(.empty-table-row) + tr:not(.empty-table-row) {
        border-top: 1px solid #edf0f4 !important;
    }

    .admissions-table-wrap tbody tr:not(.empty-table-row) > td:not(.mobile-admission-compact),
    .overview-results-table tbody tr:not(.empty-table-row) > td:not(.mobile-admission-compact) {
        display: none !important;
    }

    .admissions-table-wrap .mobile-admission-compact,
    .overview-results-table .mobile-admission-compact {
        width: 100% !important;
        min-width: 0 !important;
        padding: 10px 11px 9px !important;
        display: block !important;
        border: 0 !important;
        text-align: left !important;
        white-space: normal !important;
    }

    .mobile-admission-compact::before {
        display: none !important;
    }

    .mobile-result-top {
        min-height: 21px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
    }

    .mobile-result-meta {
        min-width: 0;
        display: flex;
        align-items: center;
        gap: 5px;
        overflow: hidden;
        color: #667085;
        font-size: 10px;
        font-weight: 750;
        white-space: nowrap;
    }

    .mobile-result-university {
        max-width: 132px;
        overflow: hidden;
        color: #3157e5;
        font-weight: 900;
        text-overflow: ellipsis;
    }

    .mobile-result-phase {
        padding: 2px 6px;
        border-radius: 999px;
        color: #175cd3;
        background: #eff8ff;
        font-size: 9px;
        font-weight: 900;
    }

    .mobile-result-phase.jeongsi {
        color: #6941c6;
        background: #f4f3ff;
    }

    .mobile-result-top .favorite-inline-form {
        flex: 0 0 auto;
    }

    .mobile-result-top .favorite-button.compact {
        min-width: 29px;
        width: 29px;
        min-height: 29px;
        height: 29px;
        padding: 0;
        border-radius: 9px;
        font-size: 13px;
    }

    .mobile-result-main {
        min-width: 0;
        margin-top: 4px;
    }

    .mobile-result-unit {
        display: block;
        overflow: hidden;
        color: #101828;
        font-size: 14px;
        font-weight: 900;
        line-height: 1.3;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-result-selection {
        margin-top: 2px;
        overflow: hidden;
        color: #667085;
        font-size: 10px;
        line-height: 1.35;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-result-campus {
        color: #98a2b3;
    }

    .mobile-result-cutline {
        min-height: 26px;
        margin-top: 6px;
        display: flex;
        align-items: center;
        gap: 6px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .mobile-result-cutline::-webkit-scrollbar {
        display: none;
    }

    .mobile-cut-item {
        flex: 0 0 auto;
        min-height: 25px;
        padding: 4px 7px;
        display: inline-flex;
        align-items: baseline;
        gap: 4px;
        border-radius: 8px;
        background: #f5f7fb;
        line-height: 1;
    }

    .mobile-cut-item b {
        color: #667085;
        font-size: 9px;
        font-weight: 850;
    }

    .mobile-cut-item strong {
        color: #101828;
        font-size: 12px;
        font-weight: 900;
    }

    .mobile-cut-item small {
        color: #667085;
        font-size: 8px;
        font-weight: 700;
    }

    .mobile-cut-empty {
        color: #98a2b3;
        font-size: 9px;
    }

    .mobile-result-bottom {
        min-height: 18px;
        margin-top: 4px;
        display: flex;
        align-items: center;
        gap: 7px;
        overflow: hidden;
        color: #667085;
        font-size: 9px;
        white-space: nowrap;
    }

    .mobile-result-bottom span + span::before {
        content: "·";
        margin-right: 7px;
        color: #c3c8d1;
    }

    .mobile-source-link {
        margin-left: auto;
        flex: 0 0 auto;
        color: #3157e5;
        font-size: 9px;
        font-weight: 850;
    }

    /* Each result stays around 105~125px, allowing 3~4 rows per phone viewport. */
    .mobile-admission-compact {
        min-height: 108px;
    }
}

@media (max-width: 390px) {
    .detail-results-search-box {
        grid-template-columns: 18px minmax(0, 1fr) 58px;
    }

    .detail-results-search-box .button {
        min-width: 58px;
        padding: 0 9px;
    }

    .admissions-table-wrap .mobile-admission-compact,
    .overview-results-table .mobile-admission-compact {
        padding-left: 9px !important;
        padding-right: 9px !important;
    }

    .mobile-result-university {
        max-width: 108px;
    }
}
