body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 16px;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: #111;
}

#app {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: visible;
}

h1 {
    margin: 0 0 8px;
    font-size: 22px;
    text-align: center;
}

h2, h3 {
    margin-top: 16px;
    margin-bottom: 8px;
    font-size: 18px;
}

.package-description {
    margin: 0 0 16px;
    font-size: 15px;
    line-height: 1.4;
    color: #555;
    font-style: italic;
}

#packages {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.package-btn,
.duration-btn,
.time-btn {
    display: block;
    width: 100%;
    margin: 0;
    padding: 12px 16px;
    border: none;
    border-radius: 10px;
    background: #f5f7fb;
    color: #111;
    font-size: 16px;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.package-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.package-desc {
    font-size: 14px;
    color: #555;
}

.package-btn.selected,
.duration-btn.selected,
.time-btn.selected {
    background: #2a6fdb;
    color: #fff;
    box-shadow: 0 0 0 2px rgba(42, 111, 219, 0.4);
}

.section {
    margin-top: 16px;
    max-width: 100%;
    box-sizing: border-box;
    overflow: visible;
}

.hint {
    margin: 0 0 8px;
    font-size: 13px;
    color: #777;
}

#start-date-input,
#prac-date,
#sleep-morning-time,
#sleep-evening-time {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 2px solid #2a6fdb;
    font-size: 15px;
    box-sizing: border-box;
    background-color: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

/* Время опроса «Как ты провёл день?» и «Трекер сна» — одинаковые размер и рамка */
#compass-settings-section .compass-time-input,
.compass-time-input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 2px solid #2a6fdb;
    font-size: 15px;
    box-sizing: border-box;
    background-color: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

/* Чекбоксы «Дневник дня» и «Отслеживание в моменте» — такой же размер, как у слотов времени (06:00, 07:00…) */
.compass-setting-checkbox-row {
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px 0;
}
.compass-setting-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 15px;
    line-height: 1.4;
    cursor: pointer;
}
.compass-setting-checkbox-label span {
    flex: 1;
}
.compass-setting-checkbox {
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
    margin: 0;
    margin-top: 2px;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: #2a6fdb;
}

.error {
    margin-top: 6px;
    font-size: 13px;
    color: #d33;
}

#summary {
    margin-top: 20px;
    padding: 16px;
    background: #f5f7fb;
    border-radius: 12px;
}

#summary-text {
    margin-bottom: 12px;
    white-space: pre-line;
}

.compass-moment-table-wrap {
    overflow-x: auto;
    margin-bottom: 16px;
}
.compass-moment-table {
    font-size: 13px;
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
}
.compass-moment-table th,
.compass-moment-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #e0e0e0;
    border-right: 1px solid #c0c4cc;
    text-align: left;
    vertical-align: top;
}
.compass-moment-table th:last-child,
.compass-moment-table td:last-child {
    border-right: none;
}
.compass-moment-table thead th {
    border-bottom: 2px solid #2a6fdb;
    font-weight: 600;
}
.compass-moment-table .compass-moment-datetime {
    font-size: 12px;
    color: #666;
    display: block;
    margin-top: 4px;
}
.compass-moment-table td {
    white-space: pre-wrap;
}
.compass-moment-table .compass-moment-cell-state {
    white-space: normal;
}

.compass-standup-entries {
    margin-top: 12px;
}
.compass-standup-entry {
    margin-bottom: 16px;
    padding: 12px;
    background: #f5f7fb;
    border-radius: 10px;
}
.compass-standup-text {
    font-size: 14px;
    line-height: 1.4;
    color: #444;
    white-space: normal;
}

.compass-goals-table-wrap {
    overflow-x: auto;
    margin-top: 12px;
    margin-bottom: 16px;
}
.compass-goals-table {
    font-size: 14px;
    width: 100%;
    border-collapse: collapse;
}
.compass-goals-table th,
.compass-goals-table td {
    padding: 10px 12px;
    border: 1px solid #c0c4cc;
    text-align: left;
    vertical-align: top;
}
.compass-goals-table thead th {
    background: #2a6fdb;
    color: #fff;
    font-weight: 600;
    border-color: #2a6fdb;
}
.compass-goals-table tbody tr:nth-child(even) {
    background: #f5f7fb;
}
.compass-goals-table tbody td {
    line-height: 1.5;
}

.compass-summary {
    font-size: 14px;
    line-height: 1.4;
    color: #444;
    white-space: pre-line;
}
.compass-ai-report-text {
    margin-top: 8px;
    font-size: 14px;
    line-height: 1.5;
    color: #222;
    white-space: pre-line;
}
.compass-legend-title {
    margin-bottom: 0.25rem;
}
#compass-legend {
    list-style: none;
    margin: 0.25rem 0 0;
    padding: 0;
}
#compass-legend li {
    position: relative;
    padding-left: 20px;
    margin: 2px 0;
    font-size: 14px;
    color: #222;
}
#compass-legend li::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 50%;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    transform: translateY(-50%);
}
#compass-legend li[data-state="apathy"]::before {
    background-color: #800080;
}
#compass-legend li[data-state="passive"]::before {
    background-color: #0000ff;
}
#compass-legend li[data-state="relaxed"]::before {
    background-color: #00bcd4;
}
#compass-legend li[data-state="balance"]::before {
    background-color: #4caf50;
}
#compass-legend li[data-state="engaged"]::before {
    background-color: #ffeb3b;
}
#compass-legend li[data-state="overaroused"]::before {
    background-color: #ff9800;
}
#compass-legend li[data-state="panic"]::before {
    background-color: #f44336;
}
.compass-settings {
    margin-top: 12px;
}
.compass-slots {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    margin: 8px 0 12px;
}
.compass-slot {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 999px;
    background: #f3f5fb;
}
.compass-slot input[type="checkbox"] {
    accent-color: #2a6fdb;
}
.chart-container {
    position: relative;
    width: 100%;
    height: 220px;
}

.sleep-duration-summary {
    text-align: center;
    font-size: 15px;
    color: #333;
    margin: 8px 0 16px 0;
    padding: 10px 16px;
    background: linear-gradient(135deg, #e8f4fd 0%, #f0f7ff 100%);
    border-radius: 10px;
    border-left: 4px solid #4da3ff;
}
.sleep-duration-summary .duration-value {
    font-weight: 600;
    color: #2a6fdb;
    font-size: 17px;
}

#confirm-btn,
#prac-confirm-btn,
.primary-btn {
    background: #2a6fdb;
    color: #fff;
    border: none;
    padding: 14px 24px;
    border-radius: 10px;
    font-size: 17px;
    cursor: pointer;
    width: 100%;
}
#prac-confirm-btn:disabled {
    cursor: not-allowed;
}

/* Кнопка «Дневник Практикума» в мини‑приложении — крупная и заметная */
.prac-journal-btn {
    display: block;
    width: 100%;
    margin-top: 16px;
    padding: 16px 24px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #2a6fdb, #1e5bb8);
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(42, 111, 219, 0.35);
}
.prac-journal-btn:active {
    transform: scale(0.98);
}

/* Трекер сна */
.sleep-settings-row {
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sleep-settings-group {
    margin-top: 12px;
    margin-bottom: 8px;
}

.sleep-settings-group h3 {
    margin-top: 0;
    margin-bottom: 6px;
    font-size: 15px;
}

.sleep-settings-group label {
    display: block;
    font-size: 14px;
    margin: 4px 0;
}

/* Мигающий синий текст для индикаторов загрузки */
.blink-blue {
    color: #1a5a9e;
    animation: blink-blue-pulse 1s infinite;
}

@keyframes blink-blue-pulse {
    0%, 50% {
        opacity: 1;
    }
    50%, 100% {
        opacity: 0.3;
    }
}

/* Форма записи на консультацию — крупные поля ввода */
.consult-form-row label {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 6px;
}
.consult-form .consult-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 17px;
    line-height: 1.4;
    min-height: 48px;
    border-radius: 10px;
    border: 2px solid #2a6fdb;
    box-sizing: border-box;
    background-color: #fff;
}
.consult-form .consult-textarea {
    min-height: 120px;
    resize: vertical;
    padding: 14px 16px;
    font-size: 16px;
    line-height: 1.5;
}

.tabs {
    display: flex;
    gap: 8px;
}

.tab-btn {
    flex: 1;
    padding: 10px 12px;
    border-radius: 10px;
    border: none;
    background: #e0e5ed;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    color: #4a5568;
}

.tab-btn.selected {
    background: #2a6fdb;
    color: #fff;
    box-shadow: 0 0 0 2px rgba(42, 111, 219, 0.25);
}

/* Кнопка «Проекты (краткая версия)»: отдельная форма, эмодзи в тексте */
.compass-sprint-short-btn {
    display: inline-block;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 20px;
    border: 1px solid #d0d5dd;
    background: #e0e5ed;
    color: #4a5568;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}
/* При нажатии (открыта краткая версия) — синяя */
.compass-sprint-short-btn.active {
    background: #2F80ED;
    color: #fff;
    border-color: #2F80ED;
}

/* Названия проектов спринта: не обрезать многострочный текст */
.sprint-project-name-input {
    min-height: 38px !important;
    overflow-y: auto !important;
}
/* В краткой версии — больше высота, чтобы многострочное название было видно полностью */
.sprint-short-name-input {
    min-height: 44px !important;
    overflow-y: auto !important;
}

.consult-tabs {
    margin-top: 8px;
    margin-bottom: 8px;
}

.secondary-btn {
    margin-top: 8px;
    margin-bottom: 8px;
    padding: 10px 16px;
    border-radius: 10px;
    border: none;
    background: #f5f7fb;
    font-size: 15px;
    cursor: pointer;
    width: 100%;
}

.sleep-notes-toggle {
    margin-top: 12px;
}

.sleep-notes {
    margin-top: 16px;
    padding: 12px;
    border-radius: 10px;
    background: #f7f8fc;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.sleep-note-entry {
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.consult-entry {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.consult-entry-main {
    flex: 1;
}

.consult-entry-actions {
    flex-shrink: 0;
}

.consult-reschedule-btn {
    padding: 6px 10px;
    border-radius: 8px;
    border: none;
    background: #f5f7fb;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}

.consult-cancel-btn {
    padding: 6px 10px;
    border-radius: 8px;
    border: none;
    background: #ffe6e6;
    color: #b71c1c;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    margin-left: 6px;
}

.consult-status-done {
    font-size: 13px;
    font-weight: 600;
    color: #4caf50;
}

.sleep-note-entry:last-child {
    border-bottom: none;
}

.sleep-note-date {
    font-size: 13px;
    font-weight: 600;
    color: #1a5a9e;
    margin-bottom: 4px;
}

.sleep-note-text {
    font-size: 14px;
    color: #111;
    white-space: pre-line;
}

.version {
    text-align: center;
    font-size: 10px;
    color: #999;
    margin-top: 16px;
}

/* Дневник Практикума */
.journal-day {
    margin-top: 12px;
    padding: 12px;
    border-radius: 10px;
    background: #f7f8fc;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.journal-day-header {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.journal-block {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.journal-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #888;
    margin-bottom: 4px;
}

.journal-question {
    font-size: 13px;
    color: #555;
    white-space: pre-line;
    margin-bottom: 4px;
}

.journal-answer {
    font-size: 14px;
    color: #111;
    white-space: pre-line;
    padding: 8px 10px;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(42, 111, 219, 0.1);
}

.journal-summary {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(42, 111, 219, 0.06) 0%, rgba(42, 111, 219, 0.02) 100%);
    border-left: 3px solid rgba(42, 111, 219, 0.4);
}
.journal-summary-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #2a6fdb;
    margin-bottom: 4px;
}
.journal-summary-text {
    font-size: 13px;
    color: #333;
    line-height: 1.4;
}

/* Экран «Дневник»: выбор категории */
.diary-category-section {
    position: relative;
    max-width: 100%;
    box-sizing: border-box;
    overflow: visible;
}
.diary-category-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 14px 16px;
    border: 2px solid #2a6fdb;
    border-radius: 10px;
    background: #f5f7fb;
    cursor: pointer;
    font-size: 16px;
}
.diary-category-label {
    font-weight: 600;
    color: #333;
}
.diary-category-value {
    flex: 1;
    text-align: right;
    color: #2a6fdb;
    padding: 0 8px;
}
.diary-category-arrow {
    font-size: 12px;
    color: #2a6fdb;
}
.diary-category-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 6px;
    padding: 6px 0;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    z-index: 10;
}
.diary-category-dropdown.open {
    display: block;
    /* Позиция задаётся в JS (position: fixed), чтобы список не обрезался белой карточкой */
}
.diary-category-dropdown button {
    display: block;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: none;
    text-align: left;
    font-size: 15px;
    cursor: pointer;
    color: #111;
}
.diary-category-dropdown button:hover {
    background: #f0f4ff;
}
.diary-category-dropdown button:active {
    background: #e0e8ff;
}
.diary-current-practicum {
    margin: 12px 0;
    padding: 10px 12px;
    background: #e8f4fd;
    border-radius: 8px;
    font-size: 14px;
    color: #1a5a9e;
}
.diary-entries-section {
    margin-top: 16px;
}

/* Всплывающее уведомление (активный практикум) */
.prac-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}
.prac-modal {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    max-width: 340px;
    width: 100%;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}
.prac-modal-message {
    margin: 0 0 16px;
    font-size: 15px;
    line-height: 1.45;
    color: #222;
}
.prac-modal-close {
    display: block;
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-radius: 10px;
    background: #2a5298;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
}
.prac-modal-close:active {
    opacity: 0.9;
}

/* Управление практикумом: пропуск дня, пауза */
.practicum-controls {
    margin-top: 12px;
    padding: 14px;
    background: #f8f9fc;
    border-radius: 12px;
    border: 1px solid #e4e8f0;
}
.practicum-day-status {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 600;
    color: #1a237e;
}
.practicum-controls-hint {
    margin: 0 0 12px;
    font-size: 13px;
    line-height: 1.4;
    color: #555;
}
.practicum-controls-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.prac-action-btn {
    padding: 10px 14px;
    border: 1px solid #2a5298;
    border-radius: 8px;
    background: #fff;
    color: #2a5298;
    font-size: 14px;
    cursor: pointer;
}
.prac-action-btn:active {
    opacity: 0.9;
}
.prac-action-btn-primary {
    background: #2a5298;
    color: #fff;
}
.practicum-action-message {
    margin: 10px 0 0;
    font-size: 13px;
    color: #1a5a9e;
}

/* Психолог 24/7 — полноэкранный чат: скролл только у сообщений */
html.psych-page {
    height: 100%;
    overflow: hidden;
    touch-action: pan-y;
}
body.psych-body {
    margin: 0;
    padding: 0;
    height: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
    background: var(--tg-theme-bg-color, #f9f5f0);
    color: var(--tg-theme-text-color, #111);
}

.psych-app {
    width: 100%;
    max-width: none;
    height: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Шапка — первый flex-элемент, не скроллится */
.psych-header {
    flex-shrink: 0;
    position: relative;
    padding: 12px 12px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: var(--tg-theme-bg-color, #f9f5f0);
    z-index: 20;
    box-sizing: border-box;
}

.psych-header h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #3c2a4d;
    flex: 1 1 auto;
}

.psych-menu-btn {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: none;
    background: rgba(60, 42, 77, 0.08);
    cursor: pointer;
    position: relative;
}

.psych-menu-btn span {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 18px;
    height: 3px;
    border-radius: 2px;
    background: #3c2a4d;
}

.psych-menu-btn span:nth-child(1) { top: 8px; }
.psych-menu-btn span:nth-child(2) { top: 50%; margin-top: -1.5px; }
.psych-menu-btn span:nth-child(3) { bottom: 8px; }

.psych-menu {
    position: absolute;
    top: 48px;
    right: 12px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    padding: 6px 0;
    z-index: 50;
    min-width: 180px;
    display: none;
}

.psych-menu.open {
    display: block;
}

.psych-menu-item {
    width: 100%;
    padding: 10px 14px;
    border: none;
    background: transparent;
    text-align: left;
    font-size: 15px;
    cursor: pointer;
}

.psych-menu-item:hover,
.psych-menu-item:active {
    background: #f5f0ff;
}

/* Одна прокручиваемая зона: сообщения + поле ввода вместе */
.psych-main {
    flex: 1 1 0;
    min-height: 0;
    padding: 0 8px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.psych-messages {
    padding: 4px 2px 8px;
    min-height: 0;
}

.psych-message {
    display: flex;
    margin-bottom: 8px;
}

.psych-message-user {
    justify-content: flex-end;
}

.psych-message-assistant {
    justify-content: flex-start;
}

.psych-bubble {
    max-width: 85%;
    padding: 10px 12px;
    border-radius: 16px;
    font-size: 15px;
    line-height: 1.4;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.psych-message-user .psych-bubble {
    background: #2a5298;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.psych-message-assistant .psych-bubble {
    background: #f3e7ff;
    color: #2c1249;
    border-bottom-left-radius: 4px;
}

.psych-typing {
    margin: 4px 4px 0;
    font-size: 13px;
    color: #777;
}

/* Подвал с полем ввода — в конце прокручиваемой зоны, всегда рядом с последним сообщением */
.psych-footer {
    padding: 6px 0 8px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    background: var(--tg-theme-bg-color, #f9f5f0);
    box-sizing: border-box;
}

.psych-body.keyboard-open .psych-footer {
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* История диалогов */
.psych-history-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.psych-history-modal {
    width: 100%;
    max-width: 420px;
    max-height: 80vh;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    padding: 14px 14px 12px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.psych-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.psych-history-title {
    font-size: 16px;
    font-weight: 600;
    color: #3c2a4d;
}

.psych-history-close {
    border: none;
    background: transparent;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
}

.psych-history-list {
    flex: 1;
    overflow-y: auto;
    margin: 4px 0 0;
}

.psych-history-empty {
    margin: 6px 0 0;
    font-size: 14px;
    color: #777;
}

.psych-history-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 8px;
    border-radius: 10px;
    cursor: pointer;
}

.psych-history-item:hover {
    background: #f7f2ff;
}

.psych-history-main {
    flex: 1;
    min-width: 0;
}

.psych-history-name {
    font-size: 14px;
    font-weight: 500;
    color: #2c1249;
    margin-bottom: 2px;
}

.psych-history-meta {
    font-size: 12px;
    color: #777;
}

.psych-history-delete {
    flex-shrink: 0;
    border: none;
    background: #ffe6e6;
    color: #b71c1c;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 999px;
    cursor: pointer;
}

.psych-input-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: #fff;
    border-radius: 16px;
    padding: 6px 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.psych-input {
    flex: 1;
    border: none;
    resize: none;
    font-size: 15px;
    line-height: 1.4;
    max-height: 200px;
    min-height: 22px;
    outline: none;
    overflow-y: auto;
    box-sizing: border-box;
}

.psych-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #2a5298;
    cursor: pointer;
    position: relative;
}

.psych-send-btn::before {
    content: "";
    position: absolute;
    inset: 10px;
    border-radius: 2px;
    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(45deg) translate(-1px, -1px);
}

.psych-send-btn.sending {
    opacity: 0.6;
}

/* Всплывающее уведомление Шкалы НейроБаланса (по центру, с кнопкой Ок) */
html.compass-toast-open,
body.compass-toast-open {
    overflow: hidden;
}
.compass-toast-wrap {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    pointer-events: auto;
    opacity: 0;
    transition: opacity 0.25s ease;
}
.compass-toast-wrap.compass-toast-visible {
    opacity: 1;
}
.compass-toast {
    padding: 18px 28px;
    background: #2a6fdb;
    color: #fff;
    border-radius: 14px;
    font-size: 16px;
    text-align: center;
    max-width: 320px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    transform: scale(0.95);
    transition: transform 0.25s ease;
}
.compass-toast-wrap.compass-toast-visible .compass-toast {
    transform: scale(1);
}
.compass-toast.compass-toast-error {
    background: #c62828;
}

/* Легенда состояний в статистике */
.compass-legend-list {
    list-style: none;
    padding: 0;
    margin: 12px 0;
}
.compass-legend-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 15px;
}
.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

/* Кнопки периода (Сегодня, Неделя, Месяц) */
.period-btn {
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
}
.period-btn:hover {
    border-color: #4da3ff;
    color: #4da3ff;
}
.period-btn.selected {
    background: #4da3ff;
    border-color: #4da3ff;
    color: #fff;
}
