/* ================= Базовые настройки ================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f4f6f8;
    color: #333;
    line-height: 1.6;
    padding: 20px;
}
.main-container { max-width: 1100px; min-width: 0; margin: 0 auto; }
.contentw {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    max-width: 100%;
    min-width: 0;
    overflow-x: clip;
    overflow-y: clip;
    overflow-clip-margin: 16px;
}
.entry-title {
    font-size: 24px; font-weight: 600; color: #2c3e50;
    margin-bottom: 25px; padding-bottom: 10px; border-bottom: 2px solid #3498db;
}

/* ================= Форма фильтра ================= */
.abiturient-filter {
    background: #f8f9fa; padding: 20px; border-radius: 6px;
    border: 1px solid #e9ecef; margin-bottom: 24px;
}
.abiturient-filter-form { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-end; }
.filter-row { display: flex; flex-direction: column; flex: 1; min-width: 200px; }
.filter-row label { font-size: 14px; font-weight: 600; color: #555; margin-bottom: 6px; }
.filter-row select,
.filter-row input {
    padding: 10px 12px; border: 1px solid #ced4da; border-radius: 4px;
    font-size: 14px; background-color: #fff; max-width: 100%;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.filter-row select { text-overflow: ellipsis; }
.filter-row select:focus,
.filter-row input:focus {
    outline: none; border-color: #3498db; box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}
.button-row { flex-direction: row; gap: 10px; flex: 0 0 auto; margin-top: 2px; }
.filter-submit {
    padding: 10px 24px; background-color: #3498db; color: white; border: none;
    border-radius: 4px; font-size: 14px; font-weight: 600; cursor: pointer;
    transition: background-color 0.2s, transform 0.15s, box-shadow 0.2s;
}
.filter-submit:hover {
    background-color: #2980b9; transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(52, 152, 219, 0.25);
}
.filter-reset {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 10px 20px; background-color: #e9ecef; color: #495057;
    text-decoration: none; border-radius: 4px; font-size: 14px; font-weight: 600;
    transition: background-color 0.2s;
}
.filter-reset:hover { background-color: #dee2e6; }

/* ================= Таблица рейтинга ================= */
.results-count { font-size: 14px; color: #666; margin-bottom: 15px; }
.abiturient-table { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 10px; }
.abiturient-table thead { background-color: #f1f3f5; }
.abiturient-table th {
    padding: 12px 15px; text-align: left; font-weight: 600; color: #495057;
    border-bottom: 2px solid #dee2e6;
}
.abiturient-table td { padding: 12px 15px; border-bottom: 1px solid #e9ecef; color: #333; }
.abiturient-table tbody tr { transition: background-color 0.18s ease; }
.abiturient-table tbody tr:hover { background-color: #f8f9fa; }
.abiturient-table tbody tr:nth-child(even) { background-color: #fafbfc; }
.score-cell { font-weight: 600; color: #2c3e50; font-variant-numeric: tabular-nums; }
.no-results {
    padding: 30px; text-align: center; background-color: #fff3cd; color: #856404;
    border: 1px solid #ffeaa7; border-radius: 4px; font-size: 15px;
}

/* =========================================================
   Доска специальностей: две колонки (бюджет / коммерция)
   ========================================================= */
.board-note {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    flex-wrap: wrap; background: #f8f9fa; border: 1px solid #e9ecef; border-radius: 6px;
    padding: 12px 16px; margin-bottom: 24px; font-size: 14px; color: #495057;
}
.board-note b { color: #2c3e50; }
.board-note .hint { color: #868e96; font-size: 12.5px; }
.level { position: relative; margin-top: 40px; }
.level:first-of-type { margin-top: 10px; }
.level-ghost {
    position: absolute; top: -34px; right: 4px; font-size: 110px; font-weight: 800;
    line-height: 1; color: rgba(52, 152, 219, 0.07); pointer-events: none; user-select: none;
}
.level-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.level-head h2 {
    font-size: 20px; font-weight: 700; color: #2c3e50;
    padding-bottom: 6px; border-bottom: 2px solid #3498db;
}
.level-head .tag {
    font-size: 12px; font-weight: 600; color: #495057; background: #f1f3f5;
    border: 1px solid #e9ecef; padding: 4px 11px; border-radius: 20px;
}
.level-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.col {
    background: #fff; border: 1px solid #e9ecef; border-radius: 8px; overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05); min-width: 0;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.col:hover { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.09); transform: translateY(-2px); }
.col-budget { border-top: 4px solid #3498db; }
.col-comm   { border-top: 4px solid #95a5a6; }
.col-head {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 14px 18px 12px; border-bottom: 1px solid #e9ecef; background: #f8f9fa;
}
.col-head h3 {
    font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
    display: flex; align-items: center; gap: 9px;
}
.col-head h3::before { content: ""; width: 9px; height: 9px; border-radius: 2px; background: currentColor; }
.col-budget .col-head h3 { color: #2980b9; }
.col-comm   .col-head h3 { color: #7f8c8d; }
.col-meta { font-size: 12.5px; color: #868e96; font-weight: 500; text-align: right; }
.col-meta b { color: #2c3e50; }
.table-wrap { overflow-x: auto; max-width: 100%; min-width: 0; }
.prog-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 430px; }
.prog-table thead { background-color: #f1f3f5; }
.prog-table th {
    padding: 12px 15px; text-align: left; font-weight: 600; color: #495057;
    border-bottom: 2px solid #dee2e6; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em;
}
.prog-table td { padding: 12px 15px; border-bottom: 1px solid #e9ecef; color: #333; vertical-align: middle; }
.prog-table tbody tr { transition: background-color 0.18s ease; }
.prog-table tbody tr:last-child td { border-bottom: none; }
.col-budget .prog-table tbody tr:hover { background-color: #eaf3fb; }
.col-comm   .prog-table tbody tr:hover { background-color: #f4f6f8; }
.prog-table .idx { color: #adb5bd; font-weight: 600; width: 34px; }
.spec-name { font-weight: 600; color: #2c3e50; }
.spec-qual { font-size: 12px; color: #868e96; margin-top: 2px; }
.form-cell { color: #495057; font-size: 13px; white-space: nowrap; }
.places { font-weight: 700; color: #2980b9; font-variant-numeric: tabular-nums; }
.act { text-align: right; }
.btn-show {
    display: inline-block; padding: 7px 16px; border-radius: 4px; border: 1px solid #3498db;
    color: #2980b9; background: #fff; font-size: 13px; font-weight: 600; text-decoration: none;
    white-space: nowrap; transition: background-color 0.2s, color 0.2s, box-shadow 0.2s, transform 0.15s;
}
.btn-show:hover { background: #3498db; color: #fff; transform: translateY(-1px); box-shadow: 0 4px 10px rgba(52, 152, 219, 0.25); }
.col-empty { padding: 28px 18px; color: #868e96; font-size: 13.5px; font-style: italic; text-align: center; }

/* =========================================================
   Панель рейтинга абитуриентов
   ========================================================= */
.applicant-panel {
    background: #f8f9fa; border: 1px solid #e9ecef; border-left: 4px solid #3498db;
    border-radius: 6px; padding: 20px 22px; margin-bottom: 20px;
}
.applicant-panel .kicker {
    display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.12em;
    text-transform: uppercase; color: #3498db; margin-bottom: 6px;
}
.applicant-panel h2 { font-size: 19px; font-weight: 700; color: #2c3e50; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip { font-size: 12.5px; font-weight: 600; padding: 5px 12px; border-radius: 20px; background: #e9ecef; color: #495057; }
.chip-budget { background: #eaf3fb; color: #2980b9; }
.chip-comm   { background: #f1f3f5; color: #7f8c8d; }
.pos { font-weight: 700; color: #adb5bd; width: 44px; }
tr.pass-line .pos { color: #2980b9; box-shadow: inset 3px 0 0 #3498db; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge-priv   { background: #fff3cd; color: #856404; border: 1px solid #ffeaa7; }
.badge-region { background: #eaf3fb; color: #2980b9; border: 1px solid #cfe8fa; }
.badge-none   { color: #adb5bd; }
.doc { font-weight: 600; font-size: 13px; }
.doc-orig { color: #2980b9; }
.doc-copy { color: #7f8c8d; }
.legend { margin: 12px 2px 0; font-size: 12.5px; color: #868e96; display: flex; align-items: center; gap: 8px; }
.legend-mark { width: 16px; height: 8px; border-radius: 2px; background: #eaf3fb; box-shadow: inset 3px 0 0 #3498db; }

/* =========================================================
   Панель поиска
   ========================================================= */
.search-panel {
    position: relative; overflow: hidden; background: #fff; border: 1px solid #e9ecef;
    border-radius: 10px; padding: 20px 22px; margin-bottom: 22px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}
.search-panel::after {
    content: ""; position: absolute; top: -60px; right: -60px; width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(52, 152, 219, 0.10), transparent 70%);
    pointer-events: none; transition: opacity 0.3s ease; opacity: 0.6;
}
.search-panel:focus-within { border-color: #3498db; box-shadow: 0 10px 28px rgba(52, 152, 219, 0.14); transform: translateY(-1px); }
.search-panel:focus-within::after { opacity: 1; }
.search-head { position: relative; display: flex; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.search-badge {
    flex: 0 0 auto; width: 46px; height: 46px; border-radius: 12px; display: flex;
    align-items: center; justify-content: center; background: linear-gradient(135deg, #3498db, #2980b9);
    color: #fff; box-shadow: 0 6px 16px rgba(52, 152, 219, 0.30); transition: transform 0.3s ease;
}
.search-panel:focus-within .search-badge { transform: scale(1.06) rotate(-3deg); }
.search-badge svg { width: 22px; height: 22px; }
.search-desc { flex: 1 1 auto; min-width: 0; }
.search-kicker { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: #3498db; margin-bottom: 3px; }
.search-desc h3 { font-size: 17px; font-weight: 700; color: #2c3e50; line-height: 1.25; margin-bottom: 4px; }
.search-desc p { font-size: 13.5px; color: #868e96; line-height: 1.5; margin: 0; }
.search-count {
    flex: 0 0 auto; align-self: center; font-size: 12.5px; font-weight: 700; color: #2980b9;
    background: #eaf3fb; border: 1px solid #cfe8fa; padding: 5px 13px; border-radius: 20px; white-space: nowrap;
    opacity: 0; transform: translateY(-4px) scale(0.96); pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease, background-color 0.22s ease, color 0.22s ease;
}
.search-panel.has-query .search-count { opacity: 1; transform: none; }
.search-count b { font-variant-numeric: tabular-nums; }
.search-count.is-empty { color: #c0392b; background: #fdecea; border-color: #f5c6c2; }
.search-count.is-loading { color: #7f8c8d; background: #f1f3f5; border-color: #e9ecef; }
.search-bar { position: relative; display: flex; align-items: center; }
.search-field { position: relative; flex: 1 1 auto; min-width: 0; }
.search-field .search-icon {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px;
    color: #adb5bd; pointer-events: none; transition: color 0.2s ease;
}
.search-panel:focus-within .search-field .search-icon { color: #3498db; }
.search-input {
    width: 100%; padding: 13px 42px 13px 44px; border: 1.5px solid #dee2e6; border-radius: 8px;
    font-size: 15px; font-family: inherit; color: #2c3e50; background: #fbfcfd;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.search-input::placeholder { color: #adb5bd; }
.search-input:focus { outline: none; border-color: #3498db; background: #fff; box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15); }
.search-clear {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%) scale(0.85);
    width: 24px; height: 24px; border: none; border-radius: 50%; background: #e9ecef; color: #495057;
    font-size: 16px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.18s ease, transform 0.18s ease, background-color 0.18s ease;
}
.search-clear:hover { background: #dee2e6; }
.search-panel.has-query .search-clear { opacity: 1; pointer-events: auto; transform: translateY(-50%) scale(1); }
.abiturient-table tbody tr.search-hidden { display: none; }
.abiturient-table.is-searching tbody tr:not(.search-hidden) { background-color: #f4f9fd; }
.abiturient-table.is-searching tbody tr:not(.search-hidden):hover { background-color: #eaf3fb; }
@keyframes row-flash {
    0%   { background-color: #d6ecfb; box-shadow: inset 4px 0 0 #3498db; }
    60%  { background-color: #eaf3fb; box-shadow: inset 4px 0 0 #3498db; }
    100% { background-color: #f4f9fd; box-shadow: inset 4px 0 0 #3498db; }
}
.abiturient-table tbody tr.row-highlight {
    animation: row-flash 1.6s ease-out 1; background-color: #f4f9fd;
    box-shadow: inset 4px 0 0 #3498db; scroll-margin-top: 16px;
}
.abiturient-table tbody tr.row-highlight td { color: #2c3e50; }
.search-empty {
    display: none; flex-direction: column; align-items: center; gap: 10px; padding: 34px 20px;
    margin-top: 4px; text-align: center; background: #f8f9fa; border: 1px dashed #ced4da;
    border-radius: 8px; color: #495057;
}
.search-empty.show { display: flex; }
.search-empty .se-icon { width: 38px; height: 38px; color: #adb5bd; }
.search-empty .se-text { font-size: 15px; }
.search-empty .se-text b { color: #2c3e50; }
.search-empty .se-btn {
    margin-top: 2px; padding: 8px 18px; border: 1px solid #3498db; border-radius: 4px;
    background: #fff; color: #2980b9; font-size: 13px; font-weight: 600; cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}
.search-empty .se-btn:hover { background: #3498db; color: #fff; }

/* =========================================================
   Результаты поиска заявления
   ========================================================= */
#boardWrap.board-hidden { display: none; }
.search-results { margin-top: 4px; }
.search-results-head {
    display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
    margin: 4px 2px 14px; font-size: 13px; color: #868e96;
}
.search-results-head b { color: #2c3e50; font-variant-numeric: tabular-nums; }
@keyframes card-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.found-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.found-card {
    position: relative; background: #fff; border: 1px solid #e9ecef; border-left: 4px solid #95a5a6;
    border-radius: 10px; padding: 16px 18px 18px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    opacity: 0; animation: card-in 0.45s ease forwards; min-width: 0;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.found-card:hover { box-shadow: 0 10px 26px rgba(0, 0, 0, 0.10); transform: translateY(-2px); }
.found-card.passes { border-left-color: #27ae60; }
.found-card.wait   { border-left-color: #e0a106; }
.found-card.comm   { border-left-color: #95a5a6; }
.fc-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.fc-match {
    font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
    color: #868e96; display: inline-flex; align-items: center; gap: 6px;
}
.fc-match::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #3498db; box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15); }
.fc-open {
    font-size: 12.5px; font-weight: 700; color: #2980b9; text-decoration: none; white-space: nowrap;
    padding: 4px 10px; border-radius: 6px; transition: background-color 0.2s ease, color 0.2s ease;
}
.fc-open:hover { background: #eaf3fb; }
.fc-spec { font-size: 16px; font-weight: 700; color: #2c3e50; line-height: 1.3; margin-bottom: 4px; }
.fc-qual { display: block; font-size: 12.5px; font-weight: 500; color: #868e96; margin-top: 2px; }
.fc-chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 10px 0 14px; }
.fc-chips .chip { font-size: 11.5px; padding: 4px 10px; }
.fc-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; padding-top: 14px; border-top: 1px solid #eef1f3; }
.fc-metric { display: flex; flex-direction: column; gap: 2px; }
.fc-m-label { font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #adb5bd; }
.fc-m-val { font-size: 15px; font-weight: 700; color: #2c3e50; font-variant-numeric: tabular-nums; }
.fc-m-val.is-pos { color: #2980b9; font-size: 18px; }
.fc-status .fc-m-val { font-size: 13.5px; font-weight: 700; }
.fc-status.pass .fc-m-val  { color: #27ae60; }
.fc-status.wait .fc-m-val  { color: #b9820a; }
.fc-status.comm .fc-m-val  { color: #7f8c8d; }
.fc-status.copy .fc-m-val  { color: #b9820a; }
.search-loading { display: none; align-items: center; justify-content: center; gap: 8px; padding: 30px 20px; color: #868e96; font-size: 14px; }
.search-loading.show { display: flex; }
.search-loading .dots { display: inline-flex; gap: 5px; }
.search-loading .dots i { width: 8px; height: 8px; border-radius: 50%; background: #3498db; opacity: 0.35; animation: dot-pulse 1s ease-in-out infinite; }
.search-loading .dots i:nth-child(2) { animation-delay: 0.18s; }
.search-loading .dots i:nth-child(3) { animation-delay: 0.36s; }
@keyframes dot-pulse { 0%, 100% { opacity: 0.25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }

/* ================= Появление при скролле ================= */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.in { opacity: 1; transform: none; }

/* =========================================================
   АДАПТИВНОСТЬ  (1024 → 960 → 768 → [601–768 скролл] → 600 → 480 → 360)
   ========================================================= */
@media (max-width: 1024px) {
    .main-container { max-width: 100%; }
    .level-ghost { font-size: 88px; }
}
@media (max-width: 960px) {
    .level-cols { grid-template-columns: minmax(0, 1fr); }
    .found-grid { grid-template-columns: minmax(0, 1fr); }
    .level-ghost { font-size: 78px; top: -22px; }
}
/* --- общие мобильные правки (без табличного скролла) --- */
@media (max-width: 768px) {
    body {
        padding: 12px;
        padding-left: max(12px, env(safe-area-inset-left));
        padding-right: max(12px, env(safe-area-inset-right));
    }
    .contentw { padding: 15px; overflow-clip-margin: 10px; }
    .entry-title { font-size: 22px; margin-bottom: 18px; }
    .abiturient-filter { padding: 15px; }
    .abiturient-filter-form { flex-direction: column; align-items: stretch; gap: 14px; }
    .filter-row { min-width: 0; }
    .button-row { flex-direction: column; width: 100%; }
    .filter-submit, .filter-reset { width: 100%; padding: 12px; }
    .filter-row select, .filter-row input { font-size: 16px; } /* без зума iOS */
    .search-head { flex-wrap: wrap; }
    .search-count { order: 3; flex: 1 1 100%; text-align: left; }
    .search-panel { padding: 16px; }
    .search-input { font-size: 16px; padding: 12px 40px 12px 42px; }
}
/* --- ТОЛЬКО планшет: горизонтальный скролл + липкая 1-я колонка обеих таблиц --- */
@media (min-width: 601px) and (max-width: 768px) {
    .abiturient-table {
        display: block; overflow-x: auto; white-space: nowrap;
        -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
    }
    .abiturient-table th, .abiturient-table td { padding: 10px 12px; }
    .abiturient-table th:first-child, .abiturient-table td:first-child {
        position: sticky; left: 0; z-index: 1; box-shadow: inset -1px 0 0 #e9ecef;
    }
    .abiturient-table thead th:first-child { background: #f1f3f5; z-index: 2; }
    .abiturient-table td:first-child { background: #fff; }
    .abiturient-table tbody tr:nth-child(even) td:first-child { background: #fafbfc; }
    .abiturient-table tbody tr:hover td:first-child { background: #f8f9fa; }
    .abiturient-table.is-searching tbody tr:not(.search-hidden) td:first-child { background: #f4f9fd; }
    .abiturient-table.is-searching tbody tr:not(.search-hidden):hover td:first-child { background: #eaf3fb; }
    .abiturient-table tbody tr.row-highlight td:first-child { background: #f4f9fd; }
    .table-wrap { -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
    .prog-table th, .prog-table td { padding: 10px 12px; }
    .prog-table th:first-child, .prog-table td:first-child {
        position: sticky; left: 0; z-index: 1; box-shadow: inset -1px 0 0 #e9ecef;
    }
    .prog-table thead th:first-child { background: #f1f3f5; z-index: 2; }
    .prog-table td:first-child { background: #fff; }
    .col-budget .prog-table tbody tr:hover td:first-child { background: #eaf3fb; }
    .col-comm   .prog-table tbody tr:hover td:first-child { background: #f4f6f8; }
}
/* --- телефон: доски И рейтинг → плитка --- */
@media (max-width: 600px) {
    .board-note { flex-direction: column; align-items: flex-start; gap: 6px; }
    .board-note .hint { width: 100%; }
    .level { margin-top: 30px; }
    .level-head { flex-wrap: wrap; gap: 10px; }
    .level-head h2 { font-size: 18px; }
    .col-head { flex-wrap: wrap; padding: 12px 14px 10px; }
    .col-meta { width: 100%; text-align: left; }
    .applicant-panel { padding: 16px; }
    .applicant-panel h2 { font-size: 17px; }
    .search-badge { width: 40px; height: 40px; border-radius: 10px; }
    .search-badge svg { width: 19px; height: 19px; }
    .search-desc h3 { font-size: 15.5px; }
    .search-desc p { font-size: 13px; }
    .search-results-head { flex-direction: column; gap: 4px; }
    .found-card { padding: 14px 15px 16px; }
    .fc-spec { font-size: 15px; }
    .legend { flex-wrap: wrap; }
    /* ---------------------------------------------------------
       ДОСКА СПЕЦИАЛЬНОСТЕЙ → ПЛИТКА
       --------------------------------------------------------- */
    .table-wrap { overflow: visible; }
    .prog-table { min-width: 0; }
    .prog-table, .prog-table tbody, .prog-table tr, .prog-table td { display: block; }
    .prog-table thead {
        position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
        overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
    }
    .prog-table tbody tr {
        position: relative; border: 1px solid #e6e9ec; border-radius: 12px;
        padding: 14px 14px 13px; margin: 0 0 12px; background: #fff;
        box-shadow: 0 1px 3px rgba(16, 24, 40, 0.05);
        transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
    }
    .prog-table tbody tr:last-child { margin-bottom: 0; }
    .col-budget .prog-table tbody tr { border-left: 3px solid #3498db; }
    .col-comm   .prog-table tbody tr { border-left: 3px solid #95a5a6; }
    .prog-table td { border: 0; padding: 0; background: transparent; }
    .col-budget .prog-table tbody tr {
        display: grid; grid-template-columns: 1fr auto;
        grid-template-areas: "spec idx" "form places" "act act";
        gap: 9px 12px; align-items: center;
    }
    .col-budget .prog-table td:nth-child(1) { grid-area: idx; }
    .col-budget .prog-table td:nth-child(2) { grid-area: spec; }
    .col-budget .prog-table td:nth-child(3) { grid-area: form; }
    .col-budget .prog-table td:nth-child(4) { grid-area: places; }
    .col-budget .prog-table td:nth-child(5) { grid-area: act; }
    .col-comm .prog-table tbody tr {
        display: grid; grid-template-columns: 1fr auto;
        grid-template-areas: "spec idx" "form form" "act act";
        gap: 9px 12px; align-items: center;
    }
    .col-comm .prog-table td:nth-child(1) { grid-area: idx; }
    .col-comm .prog-table td:nth-child(2) { grid-area: spec; }
    .col-comm .prog-table td:nth-child(3) { grid-area: form; }
    .col-comm .prog-table td:nth-child(4) { grid-area: act; }
    .prog-table td.idx,
    .prog-table td:nth-child(1) {
        justify-self: end; align-self: start; width: 26px; height: 26px; border-radius: 50%;
        background: #f1f3f5; color: #868e96; display: flex; align-items: center; justify-content: center;
        font-size: 12px; font-weight: 700;
    }
    .prog-table td:nth-child(2) { padding-right: 4px; }
    .prog-table .spec-name { font-size: 15px; line-height: 1.3; }
    .prog-table .spec-qual { font-size: 12px; }
    .prog-table td.form-cell,
    .prog-table td:nth-child(3) {
        justify-self: start; width: max-content; max-width: 100%; background: #eef1f3; color: #495057;
        padding: 3px 11px; border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap;
    }
    .col-budget .prog-table td:nth-child(4) { justify-self: end; display: flex; align-items: baseline; gap: 6px; }
    .col-budget .prog-table td:nth-child(4)::before {
        content: "Мест"; font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em;
        text-transform: uppercase; color: #adb5bd;
    }
    .col-budget .prog-table td:nth-child(4) .places { font-size: 17px; }
    .prog-table td.act, .prog-table td:last-child { margin-top: 2px; }
    .prog-table .btn-show { display: block; width: 100%; text-align: center; padding: 9px 12px; }
    /* ---------------------------------------------------------
       РЕЙТИНГ АБИТУРИЕНТОВ → ПЛИТКА
       --------------------------------------------------------- */
    .abiturient-table { overflow: visible; white-space: normal; display: block; }
    .abiturient-table tbody { display: block; }
    .abiturient-table thead {
        position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
        overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
    }
    .abiturient-table tbody tr {
        position: relative; display: block; border: 1px solid #e6e9ec; border-radius: 14px;
        padding: 14px 15px; margin: 0 0 12px; background: #fff;
        box-shadow: 0 1px 3px rgba(16, 24, 40, 0.05);
        transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
    }
    .abiturient-table tbody tr:last-child { margin-bottom: 0; }
    .abiturient-table tbody tr:nth-child(even) { background: #fff; } /* без зебры на карточках */
    .abiturient-table td {
        border: 0; padding: 0; background: transparent; color: #2c3e50; white-space: normal;
    }
    /* сетка карточки:
       [ №место ......... льгота ]
       [ рег.номер | заявление   ]
       [ балл ........... аттестат] */
    .abiturient-table tbody tr {
        display: grid; grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "pos   badge"
            "reg   epgu"
            "score doc";
        gap: 12px 14px; align-items: center;
    }
    .abiturient-table td:nth-child(1) { grid-area: pos; }
    .abiturient-table td:nth-child(2) { grid-area: reg; }
    .abiturient-table td:nth-child(3) { grid-area: epgu; }
    .abiturient-table td:nth-child(4) { grid-area: badge; }
    .abiturient-table td:nth-child(5) { grid-area: score; }
    .abiturient-table td:nth-child(6) { grid-area: doc; }
    /* № места — крупный бейдж */
    .abiturient-table .pos {
        justify-self: start; width: 46px; height: 46px; border-radius: 12px;
        background: #f1f3f5; color: #495057; display: flex; align-items: center; justify-content: center;
        font-size: 18px; font-weight: 800; line-height: 1;
    }
    /* льгота / приоритет — справа вверху */
    .abiturient-table td:nth-child(4) { justify-self: end; }
    .abiturient-table .badge { font-size: 11.5px; padding: 4px 11px; }
    /* идентификаторы — с верхней подписью-капсом */
    .abiturient-table td:nth-child(2),
    .abiturient-table td:nth-child(3) { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
    .abiturient-table td:nth-child(2)::before { content: "Рег. номер"; }
    .abiturient-table td:nth-child(3)::before { content: "Заявление (ЕПГУ)"; }
    .abiturient-table td:nth-child(2)::before,
    .abiturient-table td:nth-child(3)::before {
        font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #adb5bd;
    }
    .abiturient-table td:nth-child(2),
    .abiturient-table td:nth-child(3) { font-size: 14px; font-weight: 600; color: #2c3e50; font-variant-numeric: tabular-nums; word-break: break-word; }
    /* средний балл — главная метрика */
    .abiturient-table td:nth-child(5) { justify-self: start; display: flex; flex-direction: column; gap: 2px; }
    .abiturient-table td:nth-child(5)::before {
        content: "Средний балл"; font-size: 10px; font-weight: 700; letter-spacing: 0.06em;
        text-transform: uppercase; color: #adb5bd;
    }
    .abiturient-table .score-cell { font-size: 22px; font-weight: 800; color: #2980b9; line-height: 1; }
    /* аттестат — чип с цветной точкой */
    .abiturient-table td:nth-child(6) { justify-self: end; }
    .abiturient-table .doc {
        display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 20px;
        font-size: 12.5px; font-weight: 700;
    }
    .abiturient-table .doc::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
    .abiturient-table .doc-orig { background: #eaf3fb; color: #2980b9; }
    .abiturient-table .doc-copy { background: #f1f3f5; color: #7f8c8d; }
    /* проходной порог — вся карточка */
    .abiturient-table tbody tr.pass-line { border-left: 4px solid #3498db; background: #f4f9fd; }
    .abiturient-table tbody tr.pass-line .pos { background: #eaf3fb; color: #2980b9; box-shadow: none; }
    /* подсветка «своей» строки — сохраняем внешнюю тень карточки */
    @keyframes row-flash {
        0%   { background-color: #d6ecfb; box-shadow: 0 4px 14px rgba(52, 152, 219, 0.22), inset 4px 0 0 #3498db; }
        60%  { background-color: #eaf3fb; box-shadow: 0 4px 14px rgba(52, 152, 219, 0.18), inset 4px 0 0 #3498db; }
        100% { background-color: #f4f9fd; box-shadow: 0 1px 3px rgba(16, 24, 40, 0.05), inset 4px 0 0 #3498db; }
    }
    .abiturient-table tbody tr.row-highlight {
        border-left: 4px solid #3498db; background: #f4f9fd;
        box-shadow: 0 1px 3px rgba(16, 24, 40, 0.05), inset 4px 0 0 #3498db;
    }
}
@media (max-width: 480px) {
    body {
        padding: 10px;
        padding-left: max(10px, env(safe-area-inset-left));
        padding-right: max(10px, env(safe-area-inset-right));
    }
    .contentw { padding: 12px; border-radius: 6px; }
    .entry-title { font-size: 20px; }
    .abiturient-filter { padding: 12px; }
    .abiturient-table { font-size: 13px; }
    .pos { width: 36px; }
    .badge { font-size: 11px; padding: 2px 8px; }
    .chip { font-size: 12px; padding: 4px 10px; }
    .level-cols { gap: 14px; }
    .btn-show { font-size: 12.5px; }
    .level-ghost { font-size: 56px; top: -16px; }
    .search-panel { padding: 14px; }
    .search-panel::after { width: 140px; height: 140px; top: -40px; right: -40px; }
    .search-field .search-icon { left: 12px; }
    .search-input { padding: 11px 38px 11px 40px; }
    .found-grid { gap: 12px; }
    .fc-top { flex-wrap: wrap; }
    .fc-metrics { gap: 8px 10px; }
    .no-results { padding: 20px 14px; font-size: 14px; }
    .search-empty { padding: 24px 14px; }
}
@media (max-width: 360px) {
    body {
        padding: 8px;
        padding-left: max(8px, env(safe-area-inset-left));
        padding-right: max(8px, env(safe-area-inset-right));
    }
    .contentw { padding: 10px; }
    .entry-title { font-size: 18px; }
    .level-head h2 { font-size: 17px; }
    .applicant-panel h2 { font-size: 16px; }
    .search-desc h3 { font-size: 15px; }
    .fc-metrics { gap: 8px; }
    .fc-m-val { font-size: 14px; }
    .fc-m-val.is-pos { font-size: 16px; }
    .filter-submit, .filter-reset { font-size: 13.5px; }
    /* на самых узких — идентификаторы в столбик, чтобы длинные номера не теснились */
    .abiturient-table tbody tr {
        grid-template-columns: 1fr;
        grid-template-areas:
            "pos"
            "badge"
            "reg"
            "epgu"
            "score"
            "doc";
        gap: 10px;
    }
    .abiturient-table td:nth-child(4),
    .abiturient-table td:nth-child(6) { justify-self: start; }
    .abiturient-table .score-cell { font-size: 20px; }
}
/* --- Сенсорные экраны: без «залипшего» hover, тактильный отклик --- */
@media (hover: none) and (pointer: coarse) {
    .col:hover { transform: none; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05); }
    .found-card:hover { transform: none; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05); }
    .prog-table tbody tr:hover { transform: none; box-shadow: 0 1px 3px rgba(16, 24, 40, 0.05); }
    .abiturient-table tbody tr:hover { transform: none; box-shadow: 0 1px 3px rgba(16, 24, 40, 0.05); }
    .abiturient-table tbody tr:active { transform: scale(0.995); }
    .filter-submit:hover { background-color: #3498db; transform: none; box-shadow: none; }
    .filter-submit:active { background-color: #2980b9; transform: scale(0.98); }
    .btn-show:hover { background: #fff; color: #2980b9; transform: none; box-shadow: none; }
    .btn-show:active { background: #3498db; color: #fff; }
    .fc-open:hover { background: transparent; }
    .search-clear { width: 30px; height: 30px; }
    .abiturient-table tbody tr:hover { background-color: #fff; }
    .abiturient-table tbody tr:nth-child(even):hover { background-color: #fff; }
    .abiturient-table.is-searching tbody tr:not(.search-hidden):hover { background-color: #f4f9fd; }
    .abiturient-table tbody tr.pass-line:hover { background-color: #f4f9fd; }
}
/* ================= Уважение к reduce-motion ================= */
@media (prefers-reduced-motion: reduce) {
    .col, .btn-show, .filter-submit, .search-panel, .search-badge, .search-clear,
    .search-count, .found-card, .search-loading .dots i,
    .prog-table tbody tr, .abiturient-table tbody tr, .reveal {
        transition: none !important; animation: none !important;
    }
    .reveal { opacity: 1; transform: none; }
    .found-card { opacity: 1; }
}