/* ===== Программный рейтинг ===== */
.rating-switch{display:flex;gap:28px;border-bottom:1px solid var(--border);margin-bottom:34px}
.rating-switch a{padding:0 4px 14px;color:var(--muted);font-weight:700;border-bottom:3px solid transparent}
.rating-switch a.active{color:var(--primary);border-color:#2877d4}
.program-toolbar{display:grid;grid-template-columns:150px 220px 1fr 280px;gap:14px;margin-bottom:24px}
.program-toolbar select,.program-toolbar input{width:100%;min-height:52px;padding:0 16px;border:1px solid var(--border);border-radius:14px;background:#fff;font:inherit;outline:none}
.program-search{position:relative}.program-search input{padding-right:45px}.program-search:after{content:'⌕';position:absolute;right:16px;top:8px;color:var(--muted);font-size:25px}
.program-groups{display:grid;gap:14px}.program-group{overflow:hidden;border:1px solid var(--border);border-radius:18px;background:#fff;box-shadow:0 8px 25px rgba(17,49,82,.05)}
.program-group-head{width:100%;display:flex;justify-content:space-between;align-items:center;gap:20px;padding:21px 24px;border:0;background:#fff;color:var(--primary);font:inherit;text-align:left;cursor:pointer}
.program-group-head span:first-child{display:flex;align-items:center;gap:16px}.program-group-head strong{font-size:17px}.program-group-head small{color:var(--muted);font-size:12px;font-weight:600}.program-chevron{font-size:24px;transition:.2s}.program-group.open .program-chevron{transform:rotate(180deg)}
.program-group-body{display:none;border-top:1px solid var(--border)}.program-group.open .program-group-body{display:block}
.program-table th:first-child{width:90px}.program-table th:nth-child(3){width:150px}.program-table th:last-child{width:120px}.program-university{min-width:520px}.program-university>strong{display:block;color:var(--primary-dark);margin-bottom:7px}
.program-list{display:grid;gap:3px;color:#354657;font-size:13px}.program-list div span{display:inline-block;min-width:92px;color:var(--primary);font-weight:700}.program-list .muted{color:var(--muted)}
.program-empty{padding:50px;text-align:center;color:var(--muted);border:1px solid var(--border);border-radius:18px;background:#fff}
.program-note{margin-top:18px;padding:16px 18px;border:1px solid #cfe0f5;border-radius:14px;background:#f3f8fe;color:#52677d;font-size:13px}
@media(max-width:900px){.program-toolbar{grid-template-columns:1fr 1fr}.program-search{grid-column:1/-1}.program-university{min-width:360px}.program-group-head span:first-child{align-items:flex-start;flex-direction:column;gap:4px}}
@media(max-width:560px){.program-toolbar{grid-template-columns:1fr}.program-search{grid-column:auto}.rating-switch{gap:15px;overflow:auto}.program-group-head{padding:17px}.program-group-head strong{font-size:14px}}

/* ===== Направления подготовки ===== */
.program-toolbar{grid-template-columns:110px 170px minmax(230px,1fr) minmax(260px,1.2fr) minmax(230px,1fr) 260px}
.program-direction{margin-bottom:34px}
.program-direction-head{display:flex;align-items:flex-end;justify-content:space-between;gap:24px;padding:4px 4px 15px;margin-bottom:12px;border-bottom:1px solid var(--border)}
.program-direction-label{display:block;margin-bottom:4px;color:var(--accent);font-size:10px;font-weight:800;letter-spacing:.11em;text-transform:uppercase}
.program-direction-head h3{margin:0;color:var(--primary-dark);font-size:22px;line-height:1.3}
.program-direction-meta{flex:0 0 auto;color:var(--muted);font-size:12px;font-weight:600}
.program-direction-groups{display:grid;gap:12px}
@media(max-width:1180px){.program-toolbar{grid-template-columns:1fr 1fr 1fr}.program-search{grid-column:1/-1}}
@media(max-width:760px){.program-toolbar{grid-template-columns:1fr 1fr}.program-search{grid-column:1/-1}.program-direction-head{align-items:flex-start;flex-direction:column;gap:5px}.program-direction-head h3{font-size:18px}}
@media(max-width:560px){.program-toolbar{grid-template-columns:1fr}.program-search{grid-column:auto}}

/* ===== Области знаний ===== */
.program-field{margin-bottom:46px}
.program-field-head{padding:20px 24px;margin-bottom:22px;border-left:4px solid var(--accent);border-radius:0 16px 16px 0;background:#f5f8fc}
.program-field-label{display:block;margin-bottom:5px;color:var(--accent);font-size:10px;font-weight:800;letter-spacing:.12em;text-transform:uppercase}
.program-field-head h2{margin:0;color:var(--primary-dark);font-size:25px;line-height:1.25}
.program-field-directions{display:grid;gap:8px}


/* ===== V8: компактная иерархия результатов ===== */
.program-field{margin-bottom:34px}
.program-field-head{padding:14px 18px;margin-bottom:14px;border-left:3px solid var(--accent);border-radius:0 12px 12px 0;background:#f7f9fc}
.program-field-label{margin-bottom:2px;font-size:9px;letter-spacing:.11em}
.program-field-head h2{font-size:20px;line-height:1.2}

.program-field-directions{gap:16px}
.program-direction{margin-bottom:22px}
.program-direction-head{align-items:center;padding:0 4px 10px;margin-bottom:8px}
.program-direction-label{margin-bottom:2px;font-size:9px}
.program-direction-head h3{font-size:18px;line-height:1.25}
.program-direction-meta{font-size:11px}

.program-group{border-radius:14px;box-shadow:0 5px 18px rgba(17,49,82,.045)}
.program-group-head{padding:16px 20px}
.program-group-head strong{font-size:15px}
.program-group-head small{font-size:11px}
.program-group-head span:first-child{gap:12px}

.program-table th,
.program-table td{padding:14px 18px}
.program-table th:first-child{width:78px}
.program-table th:last-child{width:110px}
.program-university{min-width:0}
.program-university>strong{margin-bottom:4px;font-size:14px;line-height:1.35}
.program-list{gap:1px;font-size:12px;line-height:1.35}
.program-list div{display:flex;align-items:baseline;gap:10px}
.program-list div span{min-width:82px;font-size:11px}
.program-table .rank-badge{width:34px;height:34px;border-radius:10px}
.program-table .score{font-size:16px}

@media(max-width:760px){
  .program-field-head h2{font-size:18px}
  .program-direction-head{align-items:flex-start}
  .program-direction-head h3{font-size:16px}
  .program-table th,.program-table td{padding:12px 14px}
  .program-list div{display:block}
  .program-list div span{display:block;min-width:0;margin-bottom:1px}
}


/* ===== V9: исправление панели фильтров ===== */
.program-toolbar{
    grid-template-columns:
        90px
        150px
        minmax(0, 1fr)
        minmax(0, 1.15fr)
        minmax(0, 1fr)
        minmax(180px, .95fr);
    gap: 12px;
    width: 100%;
}

.program-toolbar > *{
    min-width: 0;
}

.program-toolbar select,
.program-toolbar input{
    min-width: 0;
    max-width: 100%;
}

.program-toolbar select{
    text-overflow: ellipsis;
}

.program-search{
    min-width: 0;
}

@media (max-width: 1180px){
    .program-toolbar{
        grid-template-columns: 110px 170px minmax(0, 1fr);
    }

    .program-toolbar .program-search{
        grid-column: 1 / -1;
    }
}

@media (max-width: 820px){
    .program-toolbar{
        grid-template-columns: 1fr 1fr;
    }

    .program-toolbar .program-search{
        grid-column: 1 / -1;
    }
}

@media (max-width: 560px){
    .program-toolbar{
        grid-template-columns: 1fr;
    }

    .program-toolbar .program-search{
        grid-column: auto;
    }
}


/* ===== V10: панель фильтров + рабочая кнопка поиска ===== */
.program-toolbar{
    grid-template-columns: 110px 155px minmax(180px,1fr) minmax(200px,1.15fr) minmax(180px,.9fr) minmax(220px,1fr);
    gap:12px;
}

#programYear{
    min-width:110px;
    text-overflow:clip;
}

.program-search{
    position:relative;
    display:flex;
    min-width:220px;
}

.program-search input{
    padding-right:48px;
}

.program-search::after{
    content:none;
}

.program-search button{
    position:absolute;
    right:8px;
    top:50%;
    transform:translateY(-50%);
    width:36px;
    height:36px;
    display:grid;
    place-items:center;
    border:0;
    border-radius:10px;
    background:transparent;
    color:var(--primary);
    font-size:23px;
    cursor:pointer;
}

.program-search button:hover{
    background:#eef4f8;
}

@media (max-width:1180px){
    .program-toolbar{grid-template-columns:110px 155px minmax(0,1fr);}
    .program-search{grid-column:1/-1;}
}

@media (max-width:820px){
    .program-toolbar{grid-template-columns:1fr 1fr;}
    .program-search{grid-column:1/-1;}
}

@media (max-width:560px){
    .program-toolbar{grid-template-columns:1fr;}
    .program-search{grid-column:auto;}
}


/* ===== V13: плоский список групп ОП ===== */
.program-flat-summary{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:20px;
    margin:0 0 14px;
    padding:2px 4px;
    color:var(--muted);
    font-size:13px;
}

.program-flat-summary strong{
    color:var(--primary);
    font-size:14px;
    font-weight:800;
}

.program-flat-list{
    display:grid;
    gap:14px;
}

.program-flat-list .program-group{
    margin:0;
}

/* В плоском режиме карточки чуть выразительнее отделены друг от друга */
.program-flat-list .program-group-head{
    min-height:70px;
}

@media (max-width:640px){
    .program-flat-summary{
        align-items:flex-start;
        flex-direction:column;
        gap:2px;
    }
}
.hero-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.hero-card-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.hero-arrow {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    font-size: 32px;
    line-height: 1;
    font-family: Arial, sans-serif;
    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    transition: color .2s ease, transform .2s ease;
}

.hero-arrow:hover {
    color: #fff;
    transform: scale(1.08);
}

.hero-arrow:focus {
    outline: none;
}