.site-header .header-row { display: flex; flex-wrap: nowrap; min-height: 60px; padding-block: 5px; }
.site-header .nav { margin: 0; flex-wrap: nowrap; gap: 6px; }
.site-header .nav-link, .student-menu summary { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 12px; white-space: nowrap; }
.student-menu { position: relative; }
.student-menu summary { gap: 8px; border: 1px solid #c7d5e2; border-radius: 10px; cursor: pointer; list-style: none; }
.student-menu summary::-webkit-details-marker { display: none; }
.student-menu summary::after { content: ''; width: 7px; height: 7px; margin-top: -3px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.student-menu[open] summary::after { margin-top: 3px; transform: rotate(225deg); }
.student-menu div { position: absolute; right: 0; top: calc(100% + 4px); min-width: 165px; padding: 4px; background: white; border: 1px solid #cad7e1; border-radius: 10px; box-shadow: 0 10px 24px #13263f20; }
.student-menu div a { display: flex; align-items: center; min-height: 44px; padding: 8px 12px; border-radius: 6px; }
.student-menu div a:hover { background: #edf4fc; }

.booking-hero { display: grid; grid-template-columns: minmax(0,.95fr) minmax(0,1.05fr); align-items: start; gap: clamp(28px,5vw,80px); padding-block: clamp(30px,4.5vw,70px); }
.booking-intro { max-width: 520px; }
.tutor { margin-bottom: 24px; }
.tutor-photo-link { display: inline-flex; vertical-align: top; align-items: center; gap: 12px; cursor: zoom-in; }
.portrait-frame { flex: none; width: 64px; height: 64px; overflow: hidden; border-radius: 50%; background: #e7edf3; }
.tutor .portrait { display: block; width: 100%; height: 100%; border-radius: 0; object-fit: cover; object-position: center top; transform: scale(1.65); transform-origin: 50% 10%; }
.tutor-caption { display: grid; gap: 1px; color: #486077; font-size: 15px; line-height: 1.25; }
.tutor strong { color: var(--ink); font-size: 19px; font-weight: 800; }
.portrait-hint { color: #174eb6; font-size: 13px; font-weight: 650; text-decoration: underline; text-underline-offset: 2px; }
.tutor-photo-link:hover .portrait-hint { color: #103a87; }

html.portrait-open { overflow: hidden; }
html.portrait-open.portrait-gutter { scrollbar-gutter: stable; }
.portrait-dialog { position: fixed; inset: 0; width: max-content; max-width: calc(100vw - 24px); max-height: calc(100vh - 24px); margin: auto; padding: 0; overflow: auto; border: 0; border-radius: 16px; color: #172d44; background: #fff; box-shadow: 0 12px 50px #12263840; }
.portrait-dialog:not([open]) { display: none; }
.portrait-dialog::backdrop { background: rgba(15,31,49,.48); }
.portrait-sheet { padding: 6px 12px 12px; }
.portrait-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.portrait-toolbar h2 { margin: 0; font-size: 17px; font-weight: 750; }
.portrait-close { min-height: 44px; padding: 4px 8px; border: 0; border-radius: 8px; color: #174eb6; background: transparent; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.portrait-close:hover { background: #edf4fc; }
.portrait-close:focus-visible { outline: 2px solid #174eb6; outline-offset: -2px; }
.portrait-full { display: block; width: auto; height: auto; max-width: min(17rem, calc(100vw - 56px)); max-height: min(24rem, calc(100vh - 92px)); max-height: min(24rem, calc(100dvh - 92px)); margin-inline: auto; border-radius: 8px; }
.booking-intro h1 { margin: 0; font-size: clamp(35px,4.3vw,61px); line-height: 1.04; font-weight: 850; letter-spacing: -.045em; }
.booking-format { margin: 16px 0; font-size: clamp(17px,1.6vw,21px); line-height: 1.45; }
.booking-rates { display: flex; flex-wrap: wrap; gap: 6px 20px; padding: 0; margin: 0; list-style: none; }
.booking-rates li { display: inline-flex; align-items: baseline; gap: 6px; color: #40556b; white-space: nowrap; }
.booking-rates strong { color: var(--ink); font-weight: 800; }
.booking-intro .booking-diagnostic { display: inline-flex; align-items: center; min-height: 44px; margin: 8px 0 0; color: #174eb6; text-decoration: underline; text-underline-offset: 3px; font-size: 16px; font-weight: 650; line-height: 1.35; }

.booking-card { padding: clamp(18px,2.3vw,32px); min-width: 0; background: #fff; border: 1px solid #cbd9e5; border-radius: 20px; box-shadow: 0 10px 30px #143b5d0c; scroll-margin-top: 12px; }
.booking-title { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 2px 10px; }
.booking-title h2 { margin: 0; font-size: clamp(23px,2.4vw,32px); font-weight: 800; line-height: 1.15; letter-spacing: -.035em; }
.booking-title > span { color: #486077; font-size: 14px; white-space: nowrap; }
.booking-card .week-link, .booking-actions .booking-phone { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: #174eb6; text-decoration: underline; text-underline-offset: 3px; font-weight: 700; }
.booking-instruction { margin: 6px 0 10px; font-size: 16px; line-height: 1.4; }
.booking-days { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 6px; }
.booking-days > * { grid-column: span 2; display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 44px; padding: 5px 2px; color: #253d56; border: 1px solid #bdcddd; border-radius: 9px; background: #fff; cursor: pointer; font: inherit; font-size: 15px; font-weight: 650; }
.booking-days > :nth-child(-n+2), .booking-days > :nth-child(n+6) { grid-column: span 3; }
.booking-days > :hover { background: #ecf3fd; border-color: #789ac1; }
.booking-days > [aria-pressed="true"] { color: #fff; background: #174eb6; border-color: #174eb6; }
.booking-days > :focus-visible { outline: 3px solid #174eb6; outline-offset: 2px; }
.booking-times:not([hidden]) { display: grid; margin-top: 12px; padding: 12px 15px; color: #173d37; background: #eef7f4; border-radius: 10px; font-size: 15px; }
.booking-times > * { grid-area: 1 / 1; min-width: 0; }
/* Высоту общей ячейки задаёт самый высокий день при текущем размере шрифта. */
.booking-times > .booking-day-panel { visibility: hidden; }
.booking-day-panel > strong { display: block; font-size: 16px; }
.booking-day-panel ul { margin: 5px 0 0; padding: 0; list-style: none; }
.booking-day-panel li { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 12px; padding: 3px 0; }
.booking-day-panel b { font-size: 17px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.booking-day-panel p { margin: 4px 0 0; }
.booking-contact p { margin: 14px 0 9px; color: #40556b; font-size: 15px; line-height: 1.45; }
.booking-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; }
.booking-actions .button { min-height: 44px; padding: 10px 16px; box-shadow: none; }
.booking-actions .booking-phone { flex-wrap: wrap; gap: 0 5px; font-size: 14px; }
.booking-phone span { white-space: nowrap; }

@media (max-width: 820px) {
    .booking-hero { grid-template-columns: 1fr; max-width: 640px; gap: 18px; }
    .booking-intro { max-width: none; }
    .tutor { margin-bottom: 12px; }
}
@media (max-width: 680px) {
    .site-header .header-row { min-height: 52px; gap: 4px; padding-block: 3px; }
    .site-header .brand-note { display: none; }
    .site-header .nav { gap: 0; }
    .site-header .nav-link, .student-menu summary { padding: 6px 8px; font-size: 13px; }
    .booking-hero { padding-block: 16px 26px; gap: 16px; }
    .tutor { margin-bottom: 10px; }
    .tutor-photo-link { gap: 10px; }
    .portrait-frame { width: 56px; height: 56px; }
    .portrait-full { max-width: min(64vw, 15rem); }
    .tutor strong { font-size: 17px; }
    .tutor-caption { font-size: 14px; }
    .booking-intro h1 { font-size: clamp(28px,7.2vw,38px); line-height: 1.08; letter-spacing: -.035em; }
    .booking-format { margin: 9px 0 7px; font-size: 16px; }
    .booking-rates { gap: 4px 16px; font-size: 15px; }
    .booking-intro .booking-diagnostic { margin: 0; font-size: 15px; }
    .booking-hero { row-gap: 6px; }
    .booking-card { padding: 14px; border-radius: 14px; }
    .booking-card .week-link { font-size: 15px; }
    .booking-instruction { margin: 0 0 8px; font-size: 15px; }
    .booking-days > * { font-size: 14px; }
    .booking-actions { gap: 2px 10px; }
}
@media (max-width: 359px) {
    .site-header .brand-name { white-space: nowrap; font-size: 15px; }
    .site-header .nav-link, .student-menu summary { font-size: 12px; padding-inline: 6px; }
    .booking-hero { gap: 6px; padding-top: 8px; }
    .booking-intro h1 { font-size: 25px; }
    .booking-card { padding: 12px; }
    .booking-title { gap: 4px; }
    .booking-title h2 { font-size: 21px; }
    .booking-title > span { font-size: 13px; }
    .booking-card .week-link { font-size: 14px; }
    .booking-times:not([hidden]) { margin-top: 8px; }
}
