/*
 * Назначение:
 *   Общие стили личного кабинета SmartTutor.
 *
 * Как работает:
 *   Формирует адаптивную сетку, карточки, формы и статусы календаря
 *   без внешних CSS-фреймворков.
 */

/* 1. Цвета и базовая типографика */
:root {
    color-scheme: light;
    --bg: #f5f7fb;
    --card: #ffffff;
    --text: #172033;
    --muted: #6f7890;
    --line: #e5e9f2;
    --primary: #6755e7;
    --primary-dark: #5140c8;
    --success: #17844b;
    --danger: #c63c4d;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
a { color: inherit; text-decoration: none; }
h1, h2, p { margin-top: 0; }

/* 2. Каркас приложения */
.topbar {
    min-height: 68px;
    padding: 0 5vw;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, .94);
    border-bottom: 1px solid var(--line);
}
.brand { font-size: 1.2rem; font-weight: 800; color: var(--primary); }
.logo-link { display: inline-flex; flex: 0 0 auto; align-items: center; }
.logo-link img { display: block; width: 170px; height: auto; }
.topbar nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px 18px; padding: 12px 0; color: var(--muted); }
.topbar nav a.active { color: var(--primary); font-weight: 700; }
.nav-bell { display: inline-block; margin-left: 4px; font-size: .82rem; line-height: 1; vertical-align: .05em; }
.heading-bell { display: inline-block; font-size: .82em; vertical-align: .08em; }
.session-menu { display: grid; justify-items: center; gap: 2px; margin-top: -7px; }
.session-menu small { max-width: 150px; overflow: hidden; color: var(--muted); font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }
.nav-logout { padding: 7px 12px; color: #fff; background: var(--primary); }
.content { width: min(1180px, 92vw); margin: 38px auto 64px; }
.page-heading, .section-title { display: flex; justify-content: space-between; align-items: start; gap: 20px; }
.eyebrow { color: var(--primary); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; font-size: .76rem; }
.muted { color: var(--muted); }

/* 3. Карточки и формы */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 26px; box-shadow: 0 16px 45px rgba(33, 39, 72, .06); }
.auth-wrap { min-height: calc(100vh - 180px); display: grid; place-items: center; }
.auth-card { width: min(440px, 100%); }
label { display: block; margin: 18px 0 7px; font-size: .9rem; font-weight: 700; }
input, select, textarea { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #cfd5e3; border-radius: 10px; background: #fff; color: var(--text); font: inherit; }
textarea { resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(103, 85, 231, .14); border-color: var(--primary); }
h1[tabindex="-1"]:focus { outline: none; }
button { border: 0; border-radius: 10px; padding: 12px 18px; font: inherit; font-weight: 750; cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
.primary { width: 100%; margin-top: 22px; background: var(--primary); color: #fff; }
.primary:hover { background: var(--primary-dark); }
.ghost { background: #eceafd; color: var(--primary-dark); }
.validation-message { display: block; margin-top: 5px; color: var(--danger); font-size: .85rem; }
.alert { margin-top: 18px; padding: 12px 14px; border-radius: 10px; }
.alert.error { background: #fff0f2; color: var(--danger); }
.alert.success { background: #eaf9f1; color: var(--success); }
.alert.warning { background: #fff7df; color: #8a5a00; }
.field-hint { margin: 7px 0 0; color: var(--muted); font-size: .82rem; }
.compact { padding: 8px 11px; white-space: nowrap; }

/* 4. Календарь */
.dashboard-grid { display: grid; grid-template-columns: minmax(340px, 430px) 1fr; gap: 24px; align-items: start; }
.slot-builder-card { min-width: 0; }
.form-grid { display: grid; gap: 14px; }
.form-grid.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.slot-preview { margin-top: 20px; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: #fafbff; }
.slot-preview-heading { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: .88rem; }
.slot-preview-heading strong { color: var(--text); }
.slot-preview-list { display: grid; gap: 7px; max-height: 236px; margin-top: 12px; overflow-y: auto; }
.slot-preview-item { display: grid; grid-template-columns: 28px minmax(105px, auto) 1fr; gap: 9px; align-items: center; padding: 9px 10px; border-radius: 10px; background: #fff; font-size: .84rem; }
.slot-preview-item > span:last-child { color: var(--success); text-align: right; }
.slot-preview-item.conflict { background: #fff0f2; }
.slot-preview-item.conflict > span:last-child { color: var(--danger); }
.slot-number { display: grid; width: 24px; height: 24px; place-items: center; border-radius: 999px; background: #eceafd; color: var(--primary-dark); font-weight: 800; }
.warning-text { color: #8a5a00; }
.slot-actions { display: grid; grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr); gap: 10px; margin-top: 22px; }
.slot-actions button { width: 100%; margin-top: 0; }
.schedule-card { min-width: 0; }
.schedule-list { display: grid; gap: 10px; margin-top: 20px; }
.slot-row { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 14px; }
.slot-date, .slot-info { display: grid; gap: 3px; }
.slot-date span, .slot-info span { color: var(--muted); font-size: .88rem; }
.status { padding: 7px 10px; border-radius: 999px; font-size: .78rem; font-weight: 800; }
.status.free { background: #eaf9f1; color: var(--success); }
.status.booked { background: #eceafd; color: var(--primary-dark); }
.status.blocked { background: #fff0f2; color: var(--danger); }
.status.passed { background: #eef0f4; color: #687083; }
.empty-state { margin-top: 22px; padding: 32px; text-align: center; color: var(--muted); border: 1px dashed #cfd5e3; border-radius: 14px; }

/* 4.1. Рабочий календарь преподавателя */
.teacher-calendar-layout { display: grid; grid-template-columns: minmax(540px, 1.15fr) minmax(420px, .85fr); gap: 24px; align-items: start; }
.month-card, .day-card { min-width: 0; }
.calendar-toolbar { display: grid; grid-template-columns: 42px 1fr 42px; gap: 14px; align-items: center; margin-bottom: 18px; text-align: center; }
.calendar-toolbar h2, .calendar-toolbar p { margin-bottom: 4px; }
.calendar-nav, .icon-button { display: grid; place-items: center; padding: 0; background: #eceafd; color: var(--primary-dark); }
.calendar-nav { width: 42px; height: 42px; border-radius: 50%; font-size: 1.65rem; }
.icon-button { width: 36px; height: 36px; border-radius: 50%; font-size: 1.35rem; }
.month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 7px; }
.week-header { margin-bottom: 7px; color: var(--muted); font-size: .75rem; font-weight: 800; text-align: center; text-transform: uppercase; }
.calendar-day { position: relative; min-height: 92px; padding: 9px; border: 1px solid var(--line); border-radius: 13px; background: #fff; color: var(--text); text-align: left; font-weight: 500; }
.calendar-day:hover { border-color: #bdb5f5; background: #faf9ff; }
.calendar-day.outside-month { opacity: .28; cursor: default; }
.calendar-day.selected { border-color: var(--primary); box-shadow: inset 0 0 0 2px var(--primary); background: #f7f5ff; }
.calendar-day.today .day-number { display: grid; width: 26px; height: 26px; place-items: center; margin: -3px 0 0 -3px; border-radius: 50%; background: var(--primary); color: #fff; }
.day-number { font-weight: 850; }
.calendar-day-stats { display: grid; gap: 3px; margin-top: 8px; font-size: .68rem; line-height: 1.2; }
.free-count { color: var(--success); }
.booked-count { color: var(--primary-dark); }
.blocked-count { color: var(--muted); }
.day-title { align-items: center; }
.day-title h2 { margin-bottom: 5px; }
.day-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.slot-builder-panel { margin-top: 22px; padding: 20px; border: 1px solid #dcd7fb; border-radius: 16px; background: #faf9ff; }
.slot-builder-panel h3 { margin: 0 0 6px; }
.form-grid.three-columns { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.day-timeline { display: grid; gap: 10px; margin-top: 22px; }
.day-slot-entry { display: grid; gap: 8px; min-width: 0; }
.day-slot { position: relative; display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 15px; row-gap: 3px; width: 100%; padding: 15px; border: 1px solid var(--line); border-left-width: 5px; border-radius: 14px; background: #fff; color: var(--text); text-align: left; }
button.day-slot { font-weight: inherit; }
.day-slot.selected { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(103, 85, 231, .12); }
.day-slot.free { grid-template-columns: 112px minmax(0, 1fr) auto; border-left-color: #31a86b; cursor: pointer; }
.day-slot.free:hover { border-color: #31a86b; background: #f3fcf7; transform: translateY(-1px); }
.day-slot.free:focus-visible { outline: 3px solid rgba(103, 85, 231, .18); border-color: var(--primary); }
.day-slot.free .status { grid-column: 2; justify-self: start; }
.day-slot.free.past { grid-template-columns: 112px auto; justify-content: start; border-left-color: #9aa2b5; background: #f6f7f9; cursor: default; }
.day-slot.free.past:hover { border-color: var(--line); border-left-color: #9aa2b5; background: #f6f7f9; transform: none; }
.day-slot.booked { border-left-color: var(--primary); background: #fbfaff; }
.day-slot.blocked { border-left-color: #9aa2b5; background: #f6f7f9; }
.slot-time-range { grid-row: 1 / 3; align-self: center; font-size: 1rem; font-weight: 850; }
.slot-main-text { font-weight: 850; }
.slot-secondary-text { color: var(--muted); font-size: .86rem; }
.day-slot .status { grid-column: 3; grid-row: 1 / 3; align-self: center; }
.participant-chips { grid-column: 2 / 4; display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.participant-chip { padding: 4px 8px; border-radius: 999px; background: #eceafd; color: var(--primary-dark); font-size: .72rem; font-weight: 750; }
.notification-statuses { grid-column: 2 / 4; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; }
.notification-chip { padding: 4px 7px; border-radius: 999px; background: #eef0f5; color: var(--muted); font-size: .7rem; font-weight: 850; }
.notification-chip.sent { background: #eaf9f1; color: var(--success); }
.notification-chip.failed { background: #fff0f2; color: var(--danger); }
.notification-chip.processing { background: #fff7df; color: #8a5a00; }
.slot-card-actions { grid-column: 2 / 4; display: flex; justify-content: flex-end; margin-top: 7px; }
.inline-lesson-panel { padding: 20px; border: 1px solid #dcd7fb; border-radius: 16px; background: #fff; box-shadow: 0 14px 38px rgba(81, 64, 200, .1); }
.inline-lesson-panel h3 { margin: 0; }
.compact-title { align-items: center; }
.compact-title .eyebrow { margin-bottom: 4px; }
.compact-grid { margin-top: 4px; }
.mode-switch { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: center; padding: 12px; border: 1px solid #dcd7fb; border-radius: 12px; background: #faf9ff; }
.mode-switch input { grid-row: 1 / 3; width: 20px; min-height: 20px; margin: 0; }
.mode-switch small { color: var(--muted); font-weight: 500; }
.student-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-height: 230px; margin-top: 14px; overflow-y: auto; }
.student-check { display: grid; grid-template-columns: auto 1fr; gap: 2px 9px; align-items: center; margin: 0; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.student-check:has(input:checked) { border-color: var(--primary); background: #f7f5ff; }
.student-check input { grid-row: 1 / 3; width: 18px; min-height: 18px; margin: 0; }
.student-check small { color: var(--muted); font-weight: 500; }
.channel-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.compact-channels { margin-top: 14px; }
.check-row { display: grid; grid-template-columns: auto 1fr; gap: 2px 9px; align-items: center; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.check-row input { grid-row: 1 / 3; width: 18px; min-height: 18px; margin: 0; }
.check-row small { color: var(--success); font-weight: 500; }
.check-row.unavailable { background: #f6f7f9; color: var(--muted); }
.check-row.unavailable small { color: var(--muted); }
.inline-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.inline-actions button { width: auto; margin-top: 0; }
.danger-text { color: var(--danger); background: #fff0f2; }
.danger-button { background: var(--danger); color: #fff; }
.cancel-confirmation { margin-top: 16px; padding: 16px; border: 1px solid #f2c9cf; border-radius: 13px; background: #fff7f8; }
.cancel-confirmation strong { display: block; color: var(--danger); }
.free-slot-delete { grid-column: 3; grid-row: 1 / 3; align-self: center; padding: 6px 10px; font-size: .76rem; }

/* 5. Управление доступом преподавателей */
.admin-grid { display: grid; grid-template-columns: minmax(300px, 390px) 1fr; gap: 24px; align-items: start; }
.teachers-card { min-width: 0; }
.table-wrap { margin-top: 18px; overflow-x: auto; }
.users-table { width: 100%; border-collapse: collapse; }
.users-table th, .users-table td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.users-table th { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.users-table tbody tr:last-child td { border-bottom: 0; }

/* 5.1. Раздел учеников */
.invitation-card { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(320px, 1.2fr); gap: 24px; align-items: center; margin-bottom: 24px; }
.invitation-controls { display: grid; grid-template-columns: 1fr auto; gap: 9px; }
.students-layout { display: grid; grid-template-columns: minmax(300px, .75fr) minmax(440px, 1.25fr); gap: 24px; align-items: start; }
.student-list { display: grid; gap: 9px; margin-top: 18px; }
.student-list-item { display: grid; gap: 5px; width: 100%; padding: 14px; border: 1px solid var(--line); background: #fff; color: var(--text); text-align: left; }
.student-list-item:hover, .student-list-item.selected { border-color: var(--primary); background: #f7f5ff; }
.student-name { font-weight: 850; }
.student-stats, .student-channels { color: var(--muted); font-size: .82rem; }
.student-channels { color: var(--success); }
.contact-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 20px; }
.ghost-link, .contact-id { padding: 9px 12px; border-radius: 10px; background: #eceafd; color: var(--primary-dark); font-size: .86rem; font-weight: 750; }
.student-lessons { margin-top: 26px; }
.student-lesson-row { display: grid; grid-template-columns: 145px 1fr auto; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.student-danger-zone { margin-top: 26px; padding-top: 20px; border-top: 1px solid #f2c9cf; }
.student-danger-zone > strong { color: var(--danger); }

/* 5.2. Сервисные разделы этапа 11 */
.service-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: stretch; }
.service-grid.wide-left { grid-template-columns: minmax(360px, .85fr) minmax(500px, 1.15fr); align-items: start; }
.service-section { margin-top: 24px; }
.service-value { margin: 15px 0 7px; color: var(--primary-dark); font-size: 1.75rem; font-weight: 850; }
.success-text { color: var(--success); }
.compact-primary { width: auto; margin-top: 0; }
.inline-form-grid { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; margin-top: 18px; }
.campaign-list, .support-list, .upcoming-groups { display: grid; gap: 12px; margin-top: 18px; }
.campaign-row { display: grid; grid-template-columns: 1fr auto; gap: 14px; padding: 15px; border: 1px solid var(--line); border-radius: 13px; }
.campaign-row p { margin: 7px 0; white-space: pre-wrap; }
.campaign-row small { color: var(--muted); }
.campaign-stats { display: flex; flex-wrap: wrap; justify-content: flex-end; align-content: start; gap: 6px; }
.support-create-card { margin-bottom: 24px; }
.support-ticket { padding: 18px; border: 1px solid var(--line); border-left: 5px solid var(--primary); border-radius: 14px; }
.support-ticket.answered { border-left-color: var(--success); }
.ticket-text { margin: 17px 0; white-space: pre-wrap; }
.support-answer { padding: 14px; border-radius: 12px; background: #eaf9f1; }
.support-answer p { margin: 7px 0 0; white-space: pre-wrap; }
.channel-card { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; }
.channel-icon { display: grid; width: 52px; height: 52px; place-items: center; border-radius: 15px; background: #e6f4ff; color: #198bd1; font-weight: 900; }
.channel-icon.max { background: #fff0dc; color: #ef6c00; font-size: .75rem; }
.channel-card h2, .channel-card p { margin-bottom: 3px; }
.channel-card .toggle-row, .channel-card > button { grid-column: 1 / -1; }
.toggle-row { display: flex; gap: 10px; align-items: center; margin: 10px 0 0; padding: 13px; border: 1px solid var(--line); border-radius: 12px; }
.toggle-row input { width: 20px; min-height: 20px; margin: 0; }
.toggle-row.unavailable { color: var(--muted); background: #f6f7f9; }
.settings-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.settings-actions .alert { flex-basis: 100%; margin-top: 0; }
.period-switch { display: flex; flex-wrap: wrap; gap: 8px; }
.active-period { box-shadow: inset 0 0 0 2px var(--primary); }
.upcoming-day { display: grid; gap: 9px; }
.upcoming-day + .upcoming-day { margin-top: 16px; padding-top: 20px; border-top: 1px solid var(--line); }
.upcoming-day h2 { margin-bottom: 3px; text-transform: capitalize; }
.upcoming-row { display: grid; grid-template-columns: 120px 1fr auto; gap: 15px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 13px; }
.upcoming-row p { margin: 4px 0; }
.upcoming-time { font-size: 1rem; font-weight: 850; }

/* 5.3. Кабинет ученика */
.student-teacher-picker { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(280px, .8fr); gap: 24px; align-items: center; margin-bottom: 24px; }
.student-teacher-picker h2, .student-teacher-picker p { margin-bottom: 4px; }
.student-calendar-layout { display: grid; grid-template-columns: minmax(520px, 1.1fr) minmax(380px, .9fr); gap: 24px; align-items: start; }
.student-calendar-day { display: grid; align-content: space-between; }
.student-calendar-day.has-free-slots { border-color: #9eddbb; background: #f3fcf7; }
.student-free-count { color: var(--success); font-size: .66rem; font-weight: 850; }
.student-slot-list { display: grid; gap: 10px; margin-top: 20px; }
.student-slot-card { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 15px; border: 1px solid var(--line); border-left: 5px solid #31a86b; border-radius: 14px; }
.student-slot-card.selected { border-color: var(--primary); background: #faf9ff; }
.student-slot-card p { margin: 4px 0 0; }
.student-slot-time { font-weight: 850; }
.student-booking-panel { grid-column: 1 / -1; padding-top: 14px; border-top: 1px solid var(--line); }
.student-lessons-list { display: grid; gap: 24px; }
.student-lesson-day h2 { margin-bottom: 12px; text-transform: capitalize; }
.student-lesson-day + .student-lesson-day { padding-top: 20px; border-top: 1px solid var(--line); }
.student-lesson-card { display: grid; grid-template-columns: 115px minmax(0, 1fr) auto; gap: 15px; align-items: center; padding: 15px; border: 1px solid var(--line); border-radius: 14px; }
.student-lesson-card + .student-lesson-card { margin-top: 9px; }
.student-lesson-main p { margin: 4px 0; }
.student-lesson-meta { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.student-lesson-actions { grid-column: 2 / -1; display: flex; justify-content: flex-end; }
.student-cancel-panel { width: 100%; padding: 16px; border: 1px solid #f2c9cf; border-radius: 13px; background: #fff7f8; }
.student-web-access { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.student-web-access h3 { margin: 0 0 5px; }
.credentials-form { margin-top: 15px; padding: 16px; border: 1px solid #dcd7fb; border-radius: 13px; background: #faf9ff; }

/* 5.4. Помощь, инструкции и административная публикация */
.help-heading-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.help-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0; padding: 7px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.help-tab { background: transparent; color: var(--muted); }
.help-tab:hover { background: #f3f1ff; color: var(--primary-dark); }
.help-tab.active { background: var(--primary); color: #fff; box-shadow: 0 8px 20px rgba(103, 85, 231, .2); }
.help-article-card { padding: 32px; }
.help-article-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.help-article-header h2, .help-article-header p { margin-bottom: 5px; }
.help-article-content { margin-top: 24px; color: #273149; font-size: .98rem; line-height: 1.72; white-space: pre-wrap; overflow-wrap: anywhere; }
.help-admin-layout { display: grid; grid-template-columns: minmax(260px, .65fr) minmax(560px, 1.35fr); gap: 24px; align-items: start; }
.help-admin-list { display: grid; gap: 10px; }
.help-admin-list h2 { margin-bottom: 8px; }
.help-admin-list-item { display: grid; gap: 7px; width: 100%; padding: 15px; border: 1px solid var(--line); background: #fff; color: var(--text); text-align: left; }
.help-admin-list-item > span:not(.status) { color: var(--muted); font-size: .82rem; }
.help-admin-list-item .status { width: max-content; }
.help-admin-list-item:hover, .help-admin-list-item.selected { border-color: var(--primary); background: #f7f5ff; }
.help-editor-card { min-width: 0; }
.help-version-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.help-editor-note { margin: 18px 0 5px; }
.help-editor-textarea { min-height: 560px; font-family: "Cascadia Code", "Consolas", monospace; font-size: .9rem; line-height: 1.55; }
.help-editor-counter { display: flex; justify-content: space-between; gap: 15px; margin-top: 7px; font-size: .82rem; }
.help-editor-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.publish-confirmation { margin-top: 18px; padding: 17px; border: 1px solid #dcd7fb; border-radius: 13px; background: #faf9ff; }
.publish-confirmation p { margin: 7px 0 0; color: var(--muted); }
.published-preview { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.published-preview summary { color: var(--primary-dark); font-weight: 800; cursor: pointer; }
.published-preview .help-article-content { max-height: 520px; padding: 18px; overflow-y: auto; border: 1px solid var(--line); border-radius: 13px; background: #fafbff; }

/* 5.5. Публичная витрина SmartTutor */
.public-layout { min-height: 100vh; background: #fff; color: #111b3d; }
.storefront-page { --store-violet: #7148ed; --store-violet-dark: #5831ca; --store-lavender: #f5f1ff; min-height: 100vh; overflow-x: hidden; background: #fff; }
.storefront-header { width: min(1440px, 94vw); min-height: 76px; margin: 0 auto; display: grid; grid-template-columns: auto 1fr auto; gap: 40px; align-items: center; }
.storefront-brand { display: flex; align-items: center; gap: 10px; color: #151d45; font-size: 1.38rem; font-weight: 900; }
.storefront-brand img { display: block; width: 176px; height: auto; }
.brand-cap { display: grid; width: 36px; height: 30px; place-items: center; color: #fff; background: linear-gradient(135deg, #835cff, #5d34d9); clip-path: polygon(50% 0, 100% 32%, 50% 64%, 0 32%); }
.storefront-nav { display: flex; justify-content: center; gap: clamp(20px, 3.5vw, 54px); color: #18203d; font-size: .9rem; font-weight: 650; }
.storefront-nav a:hover { color: var(--store-violet); }
.storefront-actions { display: flex; align-items: center; gap: 14px; }
.storefront-login, .storefront-teacher { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; padding: 9px 20px; border-radius: 8px; font-size: .87rem; font-weight: 800; }
.storefront-login { border: 1px solid #a78df4; color: var(--store-violet-dark); }
.storefront-teacher { color: #fff; background: linear-gradient(135deg, #7c4ff0, #6639df); box-shadow: 0 9px 22px rgba(101, 57, 223, .22); }
.storefront-hero { width: min(1440px, 94vw); min-height: 510px; margin: 0 auto; display: grid; grid-template-columns: minmax(480px, .94fr) minmax(520px, 1.06fr); align-items: center; }
.hero-copy { z-index: 1; padding: 55px 0 35px; }
.hero-copy h1 { margin-bottom: 24px; color: #111a3b; font-size: clamp(2.9rem, 4.6vw, 5rem); line-height: 1.02; letter-spacing: -.055em; }
.hero-copy > p { color: #697089; font-size: 1.18rem; line-height: 1.65; }
.storefront-primary { min-height: 46px; padding: 12px 26px; border-radius: 8px; color: #fff; background: linear-gradient(135deg, #7c4ff0, #6539df); box-shadow: 0 9px 22px rgba(101, 57, 223, .2); }
.storefront-primary:hover { transform: translateY(-1px); background: linear-gradient(135deg, #7146e7, #552bc6); }
.hero-button { min-width: 225px; margin-top: 8px; font-size: 1rem; }
.hero-benefits { display: flex; gap: 44px; margin-top: 34px; color: #555e78; font-size: .78rem; line-height: 1.35; }
.hero-benefits div { display: grid; grid-template-columns: 38px auto; align-items: center; }
.hero-benefits span { display: grid; grid-row: 1 / 3; width: 32px; height: 32px; place-items: center; border-radius: 50%; color: var(--store-violet); background: #f1ebff; font-weight: 900; }
.hero-visual { position: relative; align-self: stretch; min-height: 480px; }
.hero-visual::before { content: ""; position: absolute; inset: 35px -80px 20px 2%; border-radius: 42% 0 0 48%; background: linear-gradient(135deg, #f7f3ff 0%, #f0eaff 52%, #fff 100%); }
.hero-visual img { position: absolute; inset: 0 -3% 0 -2%; width: 105%; height: 100%; object-fit: cover; object-position: center; mix-blend-mode: multiply; }
.catalog-section { width: min(1440px, 94vw); margin: 0 auto; padding: 22px 0 70px; }
.catalog-heading, .teacher-title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.storefront-kicker, .wizard-eyebrow { margin-bottom: 6px; color: var(--store-violet); font-size: .72rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.catalog-heading h2, .teacher-title-row h2, .how-section > h2 { margin-bottom: 0; color: #17203e; font-size: 1.62rem; }
.quick-match-link { color: var(--store-violet-dark); background: #f2ecff; border: 1px solid #ded1ff; }
.quick-match-link span { margin-right: 5px; }
.subject-grid { display: grid; grid-template-columns: repeat(6, minmax(150px, 1fr)); gap: 14px; margin-top: 18px; }
.subject-tile { position: relative; display: flex; min-height: 58px; align-items: center; gap: 11px; padding: 12px 16px; color: #222947; background: #fff; border: 1px solid #e4e4ee; box-shadow: 0 6px 18px rgba(28, 34, 71, .04); text-align: left; font-size: .86rem; }
.subject-tile:hover, .subject-tile.selected { color: var(--store-violet-dark); border-color: #8e6df1; background: #fbf9ff; }
.subject-tile.selected { box-shadow: inset 0 0 0 1px #8e6df1; }
.subject-icon { display: grid; min-width: 32px; height: 32px; place-items: center; border-radius: 8px; color: var(--store-violet); background: #f3edff; font-size: .9rem; font-weight: 900; }
.subject-check { position: absolute; right: 9px; display: grid; width: 20px; height: 20px; place-items: center; border-radius: 50%; color: #fff; background: var(--store-violet); font-size: .68rem; }
.teacher-title-row { margin-top: 30px; }
.catalog-filters { display: flex; gap: 8px; color: #687087; font-size: .75rem; }
.catalog-filters span { padding: 7px 11px; border: 1px solid #e4e4ee; border-radius: 8px; background: #fff; }
.teacher-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 17px; }
.teacher-card { min-width: 0; min-height: 275px; display: grid; grid-template-columns: 38% 62%; overflow: hidden; border: 1px solid #e0e2ec; border-radius: 14px; background: #fff; box-shadow: 0 10px 28px rgba(31, 37, 76, .07); }
.teacher-card-photo { display: block; min-width: 0; min-height: 275px; overflow: hidden; }
.teacher-avatar { width: 100%; height: 100%; min-height: 275px; object-fit: cover; background: #eeeafc; }
.teacher-avatar.fallback { display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, #a994f4, #6240d7); font-size: 2.3rem; font-weight: 900; }
.teacher-avatar.compact { width: 76px; min-width: 76px; height: 76px; min-height: 76px; border-radius: 50%; }
.teacher-avatar.fallback.compact { font-size: 1.15rem; }
.teacher-card-body { min-width: 0; padding: 17px 15px 13px; }
.teacher-card h3, .match-card h3 { margin: 0 0 7px; color: #17203e; font-size: 1.03rem; }
.teacher-meta, .teacher-badges, .teacher-channels, .answer-chips { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.teacher-meta { color: #778097; font-size: .72rem; }
.teacher-meta .rating { color: #f3a51b; font-weight: 900; }
.new-teacher { color: var(--store-violet-dark); font-weight: 800; }
.teacher-badges { margin-top: 9px; }
.teacher-badges span, .answer-chips span { padding: 5px 8px; border-radius: 999px; color: #3e7e57; background: #e9f8ef; font-size: .65rem; font-weight: 750; }
.teacher-badges span:nth-child(even) { color: #6040c8; background: #f0eaff; }
.teacher-card p { display: -webkit-box; min-height: 50px; margin: 10px 0; overflow: hidden; color: #646c82; font-size: .72rem; line-height: 1.45; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.teacher-card-actions { display: grid; grid-template-columns: auto minmax(110px, 1fr); gap: 8px; align-items: center; }
.teacher-details-link { color: var(--store-violet-dark); font-size: .72rem; font-weight: 850; text-align: center; }
.teacher-contact { width: 100%; min-height: 38px; display: inline-flex; align-items: center; justify-content: center; padding: 8px 15px; }
.teacher-channels { justify-content: center; margin-top: 9px; color: #536079; font-size: .62rem; }
.teacher-channels span:first-child { color: #148cd5; }
.catalog-placeholder { margin-top: 18px; padding: 30px; color: #737b91; border: 1px dashed #d7d9e4; border-radius: 14px; background: #fafaff; text-align: center; }
.storefront-alert { margin-top: 16px; padding: 12px 15px; border-radius: 10px; }
.storefront-alert.error { color: #b72c43; background: #fff0f2; }
.catalog-page-link { color: var(--store-violet-dark); font-size: .84rem; font-weight: 850; }
.how-section { padding: 70px max(3vw, calc((100vw - 1440px) / 2)); background: #f8f6ff; text-align: center; }
.how-grid { width: min(1050px, 94vw); margin: 28px auto 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.how-grid article { padding: 28px; border: 1px solid #e7e0fa; border-radius: 18px; background: #fff; }
.how-grid strong { display: grid; width: 42px; height: 42px; margin: 0 auto 14px; place-items: center; border-radius: 50%; color: #fff; background: var(--store-violet); }
.how-grid h3 { margin-bottom: 8px; }
.how-grid p { margin: 0; color: #6e758b; line-height: 1.5; }
.storefront-footer { min-height: 100px; padding: 20px max(3vw, calc((100vw - 1440px) / 2)); display: flex; justify-content: space-between; align-items: center; gap: 20px; color: #737b91; border-top: 1px solid #ececf2; background: #fff; font-size: .82rem; }
.storefront-footer span:first-child { color: #17203e; font-size: 1.15rem; font-weight: 900; }
.storefront-footer a { color: var(--store-violet-dark); font-weight: 800; }

/* 5.6. Пошаговый помощник */
.wizard-backdrop { position: fixed; z-index: 1000; inset: 0; display: grid; place-items: center; padding: 24px; background: rgba(16, 21, 51, .58); backdrop-filter: blur(6px); overflow-y: auto; }
.wizard-card { width: min(880px, 96vw); max-height: calc(100vh - 48px); display: grid; grid-template-rows: auto auto auto minmax(0, 1fr) auto; overflow: hidden; border: 1px solid #ddd5f8; border-radius: 24px; background: #fff; box-shadow: 0 30px 100px rgba(18, 22, 60, .3); }
.wizard-header { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 22px 28px 15px; }
.wizard-header > div { display: flex; gap: 22px; align-items: center; }
.wizard-header h2 { margin: 0; font-size: 1rem; }
.wizard-brand { color: #17203e; font-weight: 900; }
.wizard-brand::first-letter { color: #7449ed; }
.wizard-close { width: 38px; height: 38px; padding: 0; color: #333b56; background: transparent; font-size: 1.8rem; font-weight: 400; }
.wizard-progress-label { padding: 0 28px 8px; color: #697089; font-size: .76rem; }
.wizard-progress { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; padding: 0 28px; }
.wizard-progress span { height: 6px; border-radius: 999px; background: #e8e1fb; }
.wizard-progress span.complete { background: linear-gradient(90deg, #845bfa, #6236dc); }
.wizard-content { min-height: 390px; padding: 30px 40px; overflow-y: auto; text-align: center; }
.wizard-content > h2, .wizard-results-title h2 { margin-bottom: 8px; color: #151d3d; font-size: 1.65rem; }
.wizard-muted { color: #767d92; }
.wizard-text, .lead-form textarea { border-color: #b7a4f3; border-radius: 12px; }
.wizard-content > .wizard-text { max-width: 540px; min-height: 58px; margin-top: 22px; padding: 14px 18px; font-size: 1.05rem; }
.wizard-privacy { margin: 22px 0 0; color: #747b90; font-size: .75rem; }
.wizard-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 24px; }
.wizard-options.levels { grid-template-columns: repeat(3, 1fr); }
.wizard-option { min-height: 76px; color: #28304d; background: #fff; border: 1px solid #dcdde7; font-size: .86rem; }
.wizard-option span { display: block; margin-bottom: 5px; color: var(--primary); font-size: 1.25rem; }
.wizard-option:hover, .wizard-option.selected { color: #5531c4; border-color: #7f58ee; background: #faf8ff; box-shadow: inset 0 0 0 1px #7f58ee; }
.age-control { width: min(420px, 100%); min-height: 110px; margin: 35px auto 20px; display: flex; justify-content: space-around; align-items: center; border: 1px solid #d9cff8; border-radius: 18px; background: #fcfbff; }
.age-control button { display: grid; width: 48px; height: 48px; padding: 0; place-items: center; border-radius: 50%; color: #5b37cd; background: #eee8ff; font-size: 1.5rem; }
.age-control strong { color: #121a3b; font-size: 3.7rem; }
.age-control small { font-size: 1rem; }
.wizard-footer { min-height: 75px; padding: 14px 28px; display: flex; justify-content: space-between; align-items: center; gap: 18px; border-top: 1px solid #ececf2; background: #fff; }
.wizard-footer .storefront-primary { min-width: 160px; }
.wizard-back { color: #5c3bc8; background: transparent; }
.wizard-results-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; text-align: left; }
.answer-chips { justify-content: flex-end; }
.answer-chips span { color: #6040c8; background: #f0eaff; }
.match-list { display: grid; gap: 11px; margin-top: 20px; text-align: left; }
.match-card { display: grid; grid-template-columns: 76px minmax(220px, 1fr) 90px 122px; gap: 15px; align-items: center; padding: 14px; border: 1px solid #e0e1ea; border-radius: 15px; background: #fff; }
.match-main ul { margin: 8px 0 0; padding-left: 18px; color: #687087; font-size: .72rem; line-height: 1.45; }
.match-score { display: grid; text-align: center; }
.match-score small { color: #557562; font-size: .65rem; }
.match-score strong { color: #11a354; font-size: 1.45rem; }
.match-actions { display: grid; gap: 5px; }
.match-actions button { padding: 7px 8px; color: #5e39cd; border: 1px solid #d6caf8; background: #f7f4ff; font-size: .68rem; }
.lead-form { margin-top: 20px; padding: 22px; border: 1px solid #d9cff8; border-radius: 16px; background: #faf8ff; text-align: left; }
.lead-form h3 { margin: 0 0 5px; }
.lead-form p { color: #747b90; }
.lead-form label { margin-top: 12px; }
.lead-form .storefront-primary { margin-top: 16px; }
.lead-success { display: flex; flex-direction: column; gap: 6px; padding: 18px; color: #167d48; border-radius: 12px; background: #eaf9f1; }

/* 5.7. Индексируемые страницы предметов и преподавателей */
.seo-public-page main { min-height: calc(100vh - 176px); }
.seo-page-hero { padding: 54px max(3vw, calc((100vw - 1180px) / 2)) 46px; background: linear-gradient(135deg, #faf8ff, #f0ebff); }
.seo-page-hero h1 { max-width: 900px; margin: 12px 0 18px; color: #141c3e; font-size: clamp(2.15rem, 4vw, 3.8rem); line-height: 1.08; letter-spacing: -.035em; }
.seo-page-hero > p:not(.storefront-kicker) { max-width: 820px; color: #616a82; font-size: 1.05rem; line-height: 1.65; }
.seo-breadcrumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 30px; color: #757d92; font-size: .8rem; }
.seo-breadcrumbs a { color: var(--store-violet-dark); font-weight: 800; }
.seo-result-count { display: inline-flex; margin-top: 12px; padding: 8px 13px; border-radius: 999px; color: #5633c2; background: #fff; font-size: .78rem; font-weight: 850; box-shadow: 0 6px 18px rgba(50, 36, 112, .08); }
.seo-catalog-section { width: min(1180px, 94vw); margin: 0 auto; padding: 42px 0 70px; }
.seo-page-state { width: min(760px, 92vw); margin: 80px auto; padding: 48px; border: 1px solid #e3def3; border-radius: 20px; background: #faf9ff; text-align: center; }
.seo-page-state.error p { margin-bottom: 24px; color: #737b91; }
.teacher-profile-hero { padding: 34px max(3vw, calc((100vw - 1120px) / 2)) 54px; background: linear-gradient(145deg, #fff, #f5f1ff); }
.teacher-profile-grid { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: clamp(32px, 6vw, 72px); align-items: center; }
.teacher-profile-photo { height: 390px; overflow: hidden; border: 7px solid #fff; border-radius: 28px; background: #eeeafc; box-shadow: 0 22px 54px rgba(54, 40, 122, .18); }
.teacher-profile-photo .teacher-avatar { min-height: 100%; }
.teacher-profile-main h1 { margin: 8px 0 15px; color: #141c3e; font-size: clamp(2.3rem, 4vw, 4rem); line-height: 1.05; letter-spacing: -.04em; }
.teacher-profile-facts { display: flex; flex-wrap: wrap; gap: 9px; color: #626b82; }
.teacher-profile-facts span { padding: 7px 10px; border-radius: 8px; background: #fff; font-size: .78rem; }
.teacher-profile-facts .rating { color: #d88c08; font-weight: 900; }
.profile-badges { margin: 18px 0 0; }
.teacher-profile-about { max-width: 720px; margin: 20px 0 24px; color: #555e75; font-size: 1rem; line-height: 1.7; }
.teacher-profile-cta { display: inline-flex; align-items: center; justify-content: center; }
.teacher-profile-details { width: min(1120px, 94vw); margin: 0 auto; padding: 46px 0 72px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.teacher-profile-details article { padding: 25px; border: 1px solid #e5e1f0; border-radius: 18px; background: #fff; box-shadow: 0 9px 28px rgba(35, 39, 80, .05); }
.teacher-profile-details h2 { margin-bottom: 16px; color: #192142; font-size: 1.15rem; }
.seo-link-chips, .seo-detail-list { display: flex; flex-wrap: wrap; gap: 9px; }
.seo-link-chips a, .seo-detail-list span { padding: 8px 11px; border-radius: 999px; color: #5e3acb; background: #f1ecff; font-size: .76rem; font-weight: 750; }
.seo-detail-list { flex-direction: column; align-items: flex-start; }
.seo-detail-list span { color: #32764c; background: #eaf8ef; }

/* 5.8. Профиль витрины и заявки преподавателя */
.profile-photo-editor { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 18px; align-items: center; margin: 18px 0 20px; padding: 16px; border: 1px solid var(--line); border-radius: 15px; background: #faf9ff; }
.profile-photo-preview { display: grid; width: 116px; height: 116px; place-items: center; overflow: hidden; border: 3px solid #fff; border-radius: 18px; background: linear-gradient(145deg, #7658ef, #b195ff); color: #fff; box-shadow: 0 10px 26px rgba(81, 64, 200, .18); font-size: 2.2rem; font-weight: 900; }
.profile-photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.profile-photo-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.profile-photo-controls strong, .profile-photo-controls .field-hint, .profile-photo-controls small { flex-basis: 100%; }
.profile-photo-controls .field-hint { margin-bottom: 5px; }
.photo-upload-button { display: inline-flex; align-items: center; width: auto; margin: 0; cursor: pointer; }
.profile-photo-controls button { margin: 0; }
.photo-success { color: var(--success); }
.photo-error { color: var(--danger); }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.profile-option-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 10px; }
.profile-option-grid label { display: flex; gap: 8px; align-items: center; margin: 0; padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
.profile-option-grid input { width: 18px; min-height: 18px; margin: 0; }
.subject-picker { display: flex; flex-wrap: wrap; gap: 8px; max-height: 210px; padding: 10px; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; background: #fafbff; }
.subject-choice { display: inline-flex; gap: 7px; align-items: center; width: auto; margin: 0; padding: 8px 10px; border: 1px solid #dfe2ec; border-radius: 999px; background: #fff; cursor: pointer; }
.subject-choice:has(input:checked) { color: var(--primary-dark); border-color: #bdb5f5; background: #f0edff; }
.subject-choice input { width: 16px; min-height: 16px; margin: 0; }
.subject-add-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 9px; }
.subject-add-row button { min-height: 46px; }
.moderation-state { display: grid; gap: 3px; margin-bottom: 18px; padding: 14px 18px; border-radius: 14px; }
.moderation-state.pending { color: #7a5500; background: #fff4cf; }
.moderation-state.rejected { color: var(--danger); background: #fff0f2; }
.moderation-state.approved { color: var(--success); background: #eaf9f1; }
.teacher-profile-grid .profile-main-card { grid-row: 1 / span 2; }
.teacher-profile-grid .profile-channels { grid-column: 2; margin-top: 0; }
.profile-channel-grid { gap: 12px; }
.compact-heading { margin-bottom: 18px; }
.compact-heading h2 { margin-bottom: 5px; }
.channel-card.embedded { padding: 18px; border: 1px solid var(--line); border-radius: 14px; }
.channel-card.embedded h3 { margin: 0 0 3px; }
.moderation-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.moderation-card-head { display: grid; grid-template-columns: 84px 1fr; gap: 14px; align-items: center; }
.moderation-card-head img { width: 84px; height: 84px; object-fit: cover; border-radius: 14px; }
.moderation-card-head h2, .moderation-card-head p { margin-bottom: 4px; }
.moderation-actions { display: flex; gap: 9px; align-items: center; margin-top: 14px; }
.moderation-actions button { width: auto; margin: 0; }
.registration-wrap { min-height: 100vh; padding: 40px 18px; background: linear-gradient(145deg, #f7f5ff, #eefaf7); }
.registration-card { width: min(560px, 100%); }
.registration-logo { display: inline-flex; margin-bottom: 16px; }
.registration-logo img { width: 176px; }
.registration-channel-select { width: min(260px, 100%); min-height: 40px; }
.registration-confirmation { display: grid; gap: 10px; margin-top: 18px; }
.registration-confirmation h2, .registration-confirmation p { margin-bottom: 0; }
.registration-action { display: inline-flex; justify-content: center; width: 100%; padding: 12px 18px; border-radius: 10px; }
.auth-secondary { margin: 22px 0 0; color: var(--muted); text-align: center; }
.auth-secondary a { color: var(--primary-dark); font-weight: 750; }
.request-list { display: grid; gap: 14px; margin-top: 22px; }
.request-card { padding: 20px; border: 1px solid var(--line); border-left: 5px solid var(--primary); border-radius: 14px; background: #fff; }
.request-card.closed { opacity: .72; border-left-color: #8991a4; }
.request-head { display: flex; justify-content: space-between; gap: 16px; }
.request-head h2 { margin-bottom: 5px; }
.request-match { color: var(--success); font-size: 1.25rem; font-weight: 900; }
.request-facts { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0; }
.request-facts span { padding: 6px 9px; border-radius: 999px; color: var(--primary-dark); background: #eceafd; font-size: .78rem; }
.request-reasons { color: var(--muted); font-size: .86rem; }
.request-contact { margin-top: 14px; padding: 13px; border-radius: 11px; background: #f6f7fb; }
.request-attribution { display: grid; gap: 4px; margin-top: 10px; padding: 10px 13px; border: 1px dashed #c9c4ed; border-radius: 11px; color: var(--muted); font-size: .82rem; }
.request-attribution strong { color: var(--text); }
.request-attribution small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.request-actions { display: flex; gap: 8px; margin-top: 14px; }

/* 6. Адаптивный режим */
@media (max-width: 820px) {
    .dashboard-grid, .admin-grid, .teacher-calendar-layout, .students-layout, .invitation-card, .service-grid, .service-grid.wide-left, .student-calendar-layout, .student-teacher-picker, .help-admin-layout, .moderation-grid { grid-template-columns: 1fr; }
    .teacher-profile-grid .profile-main-card { grid-row: auto; }
    .teacher-profile-grid .profile-channels { grid-column: auto; }
    .form-grid.two-columns, .form-grid.three-columns { grid-template-columns: 1fr; gap: 0; }
    .slot-row { grid-template-columns: 78px minmax(0, 1fr); }
    .status { grid-column: 1 / -1; width: max-content; }
    .topbar nav { gap: 12px; }
    .topbar { height: auto; min-height: 68px; align-items: flex-start; gap: 16px; padding-top: 15px; padding-bottom: 15px; }
    .topbar nav { flex-wrap: wrap; justify-content: flex-end; }
    .storefront-header { grid-template-columns: 1fr auto; gap: 18px; }
    .storefront-nav { grid-column: 1 / -1; grid-row: 2; padding-bottom: 14px; justify-content: flex-start; overflow-x: auto; }
    .storefront-hero { grid-template-columns: 1fr; }
    .hero-copy { padding-bottom: 10px; }
    .hero-visual { min-height: 390px; }
    .subject-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .teacher-grid { grid-template-columns: 1fr; }
    .teacher-card { grid-template-columns: 180px 1fr; }
    .teacher-profile-grid { grid-template-columns: 240px minmax(0, 1fr); gap: 28px; }
    .teacher-profile-photo { height: 320px; }
    .teacher-profile-details { grid-template-columns: 1fr; }
    .how-grid { grid-template-columns: 1fr; }
    .match-card { grid-template-columns: 70px 1fr 90px; }
    .match-actions { grid-column: 2 / -1; grid-template-columns: repeat(3, 1fr); }
    .wizard-results-title { flex-direction: column; }
    .answer-chips { justify-content: flex-start; }
}

@media (max-width: 480px) {
    .content { width: min(96vw, 100%); margin-top: 20px; }
    .card { padding: 17px; border-radius: 16px; }
    .page-heading, .section-title { align-items: stretch; flex-direction: column; }
    .day-actions { justify-content: flex-start; }
    .month-grid { gap: 3px; }
    .calendar-day { min-height: 66px; padding: 6px; border-radius: 9px; }
    .calendar-day-stats { font-size: .58rem; }
    .calendar-day-stats .blocked-count { display: none; }
    .day-slot, .day-slot.free { grid-template-columns: 1fr auto; }
    .day-slot.free.past { grid-template-columns: 1fr auto; justify-content: stretch; }
    .slot-time-range { grid-column: 1; grid-row: 1; }
    .slot-main-text { grid-column: 1; grid-row: 2; }
    .slot-secondary-text { grid-column: 1 / 3; grid-row: 3; }
    .day-slot .status { grid-column: 2; grid-row: 1 / 3; }
    .free-slot-delete { grid-column: 1 / 3; grid-row: 4; justify-self: end; }
    .notification-statuses { grid-column: 1 / 3; grid-row: 4; }
    .participant-chips, .slot-card-actions { grid-column: 1 / 3; }
    .channel-options { grid-template-columns: 1fr; }
    .student-picker { grid-template-columns: 1fr; }
    .inline-lesson-panel { padding: 15px; }
    .inline-actions { display: grid; grid-template-columns: 1fr; }
    .inline-actions button { width: 100%; }
    .slot-actions { grid-template-columns: 1fr; }
    .slot-preview-item { grid-template-columns: 28px 1fr; }
    .slot-preview-item > span:last-child { grid-column: 2; text-align: left; }
    .student-lesson-row { grid-template-columns: 1fr; gap: 4px; }
    .inline-form-grid, .campaign-row, .upcoming-row, .student-slot-card, .student-lesson-card { grid-template-columns: 1fr; }
    .student-booking-panel, .student-lesson-actions { grid-column: 1; }
    .student-lesson-meta, .student-lesson-actions { justify-content: flex-start; }
    .campaign-stats { justify-content: flex-start; }
    .help-tabs { display: grid; grid-template-columns: 1fr; }
    .help-tab { width: 100%; }
    .help-article-card { padding: 20px; }
    .help-article-header, .help-heading-actions { align-items: stretch; flex-direction: column; }
    .help-version-badges, .help-editor-actions { justify-content: flex-start; }
    .storefront-header { width: 92vw; }
    .storefront-actions .storefront-teacher { display: none; }
    .storefront-nav { gap: 18px; font-size: .78rem; }
    .storefront-hero { width: 92vw; min-height: auto; }
    .hero-copy { padding-top: 38px; }
    .hero-copy h1 { font-size: 2.5rem; }
    .hero-copy > p br { display: none; }
    .hero-benefits { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
    .hero-visual { min-height: 300px; }
    .catalog-section { width: 92vw; }
    .catalog-heading, .teacher-title-row { align-items: stretch; flex-direction: column; }
    .catalog-filters { overflow-x: auto; }
    .subject-grid { grid-template-columns: 1fr; }
    .teacher-card { grid-template-columns: 118px 1fr; }
    .teacher-card-photo { min-height: 260px; }
    .teacher-avatar { min-height: 260px; }
    .teacher-card-actions { grid-template-columns: 1fr; }
    .seo-page-hero { padding-top: 34px; }
    .seo-page-state { margin: 36px auto; padding: 28px 20px; }
    .teacher-profile-grid { grid-template-columns: 1fr; }
    .teacher-profile-photo { width: min(300px, 100%); height: 340px; }
    .teacher-profile-main h1 { font-size: 2.25rem; }
    .teacher-profile-details { padding-top: 28px; }
    .storefront-footer { align-items: flex-start; flex-direction: column; }
    .wizard-backdrop { padding: 8px; }
    .wizard-card { width: 100%; max-height: calc(100vh - 16px); border-radius: 18px; }
    .wizard-header, .wizard-content, .wizard-footer { padding-left: 18px; padding-right: 18px; }
    .wizard-header > div { gap: 10px; }
    .wizard-options, .wizard-options.levels { grid-template-columns: 1fr 1fr; }
    .match-card { grid-template-columns: 58px 1fr; }
    .teacher-avatar.compact { width: 58px; min-width: 58px; height: 58px; min-height: 58px; }
    .match-score { grid-column: 1; grid-row: 2; }
    .match-actions { grid-column: 2; grid-template-columns: 1fr; }
    .profile-option-grid { grid-template-columns: 1fr; }
    .profile-photo-editor { grid-template-columns: 88px minmax(0, 1fr); gap: 12px; }
    .profile-photo-preview { width: 88px; height: 88px; border-radius: 15px; }
}
