* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
    font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    color: #1b1f24;
    background: #eef1f5;
}

.layout {
    display: flex;
    height: 100vh;
}

/* Карта — слева, ~65% ширины. */
.map {
    flex: 0 0 65%;
    height: 100%;
}

/* Панель справа. */
.panel {
    flex: 1;
    height: 100%;
    overflow-y: auto;
    background: #fff;
    box-shadow: -4px 0 16px rgba(0, 0, 0, .08);
    padding: 32px;
}

.hidden { display: none; }

.panel__placeholder h1 { font-size: 32px; margin-bottom: 16px; }
.panel__placeholder p { font-size: 20px; color: #5a6573; line-height: 1.5; }

.panel__list h2,
.detail__name { font-size: 28px; margin-bottom: 12px; }

/* Контакты школы под названием. */
.school-meta { margin-bottom: 20px; color: #5a6573; font-size: 16px; line-height: 1.5; }
.school-meta__phone a { color: #2c6fd6; text-decoration: none; }
.school-meta:empty { display: none; }

/* Сетка карточек учеников. */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
}

.card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 16px 12px;
    border: none;
    border-radius: 16px;
    background: #f4f6fa;
    cursor: pointer;
    transition: transform .12s, background .12s;
    font: inherit;
}

.card:hover, .card:active { background: #e4ebf7; transform: translateY(-2px); }

.card__photo {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    background: #d7deea;
}

.card__name { font-size: 18px; font-weight: 600; text-align: center; }

.loading, .empty {
    grid-column: 1 / -1;
    font-size: 18px;
    color: #5a6573;
    padding: 20px 0;
}

/* Детальная карточка ученика. */
.back {
    border: none;
    background: #eef1f5;
    border-radius: 12px;
    padding: 12px 20px;
    font-size: 18px;
    cursor: pointer;
    margin-bottom: 20px;
}
.back:hover { background: #dde3ec; }

.detail__photo {
    width: 100%;
    max-height: 480px;
    object-fit: contain;
    border-radius: 20px;
    background: #d7deea;
    margin-bottom: 20px;
}

.detail__school {
    font-size: 18px;
    color: #2c6fd6;
    margin-bottom: 16px;
}

.detail__achievement {
    font-size: 22px;
    line-height: 1.6;
}

/* Отрендеренный Markdown внутри описания достижения. */
.detail__achievement > :first-child { margin-top: 0; }
.detail__achievement > :last-child { margin-bottom: 0; }
.detail__achievement p { margin: 0 0 14px; }
.detail__achievement h1,
.detail__achievement h2,
.detail__achievement h3 { margin: 18px 0 10px; line-height: 1.3; }
.detail__achievement ul,
.detail__achievement ol { margin: 0 0 14px; padding-left: 1.4em; }
.detail__achievement li { margin-bottom: 6px; }
.detail__achievement a { color: #2c6fd6; }
.detail__achievement code {
    background: #eef1f5;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: .9em;
}
.detail__achievement blockquote {
    margin: 0 0 14px;
    padding-left: 16px;
    border-left: 4px solid #ccd4e0;
    color: #5a6573;
}

/* Раздел «Диплом» в профиле ученика. */
.detail__diploma:not(:empty) {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #eef1f5;
}
.detail__dip-title {
    font-size: 20px;
    margin: 0 0 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
/* Ряд маленьких превью дипломов (любой формат влезает). */
.diploma-thumbs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}
.dip-thumb {
    flex: 0 0 auto;
    width: 88px;
    height: 88px;
    padding: 0;
    border: 1px solid #e3e8ef;
    border-radius: 12px;
    overflow: hidden;
    background: #f4f6fa;
    cursor: zoom-in;
    transition: transform .12s, box-shadow .12s;
}
.dip-thumb:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0, 0, 0, .15); }
.dip-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dip-thumb--pdf {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 26px;
    color: #a32820;
}
.dip-thumb--pdf span { font-size: 11px; font-weight: 600; }
.diploma-img {
    width: 100%;
    border-radius: 16px;
    border: 1px solid #e3e8ef;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .1);
    cursor: zoom-in;
    display: block;
}
.diploma-frame {
    width: 100%;
    height: 460px;
    border: 1px solid #e3e8ef;
    border-radius: 16px;
    background: #fff;
}
.diploma-open {
    display: inline-block;
    margin-top: 10px;
    color: #2c6fd6;
    font-size: 16px;
    text-decoration: none;
}

/* Маркер школы на карте. */
.school-marker__pin {
    font-size: 36px;
    line-height: 1;
    cursor: pointer;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .5));
    /* MapGL ставит HTML-маркер левым-верхним углом на точку —
       сдвигаем так, чтобы низ-центр эмодзи стоял на координате. */
    transform: translate(-50%, -100%);
    transform-origin: center bottom;
    -webkit-user-select: none;
    user-select: none;
}
