html, body {
height: 100%;
min-height: 100%;
width: 100vw;
box-sizing: border-box;
}
body {
min-height: 100dvh;
min-width: 100vw;
width: 100vw;
height: 100dvh;
display: flex;
flex-direction: column;
background: #fff;
}
#main-content {
flex: 1 1 0%;
display: flex;
flex-direction: column;
width: 100%;
min-height: 0;
align-items: center;
justify-content: center;
padding-left: 0;
padding-right: 0;
}

/* --- Центрирующий контейнер для пина и блока сообщений --- */
#centered-block {
width: 100%;
max-width: 600px;
margin-left: auto;
margin-right: auto;
display: flex;
flex-direction: column;
align-items: center;
}

/* --- Закреплённое сообщение --- */
#pinned-block {
min-height: 60px;
opacity: 0;
transform: translateY(-16px) scale(0.97);
transition: opacity 0.45s, transform 0.45s;
display: flex;
align-items: stretch;
width: auto;
max-width: 600px;
margin-top: 2.7rem;
margin-left: 3rem;
margin-right: 3rem;
margin-bottom: 1.3rem;
pointer-events: none;
background: transparent;
border: none;
box-shadow: none;
position: relative;
box-sizing: border-box;
padding-top: 1.25rem;
padding-bottom: 1.25rem;
padding-left: 2rem;
padding-right: 2rem;
}
#pinned-block.visible {
background: #f5f5f7;
border: 1.5px solid #e5e7eb;
opacity: 1;
transform: translateY(0) scale(1);
pointer-events: auto;
box-shadow: 0 8px 36px 0 #0001;
border-radius: 1.25rem;
}
#pinned-block.hiding {
opacity: 0;
transform: translateY(-10px) scale(0.98);
}
#pinned-text {
font-weight: normal;
color: #232325;
width: 100%;
word-break: break-word;
font-size: 1rem;
line-height: 1.32;
}
#pinned-meta {
font-size: 0.85em;
color: #929299;
margin-top: 0.44em;
font-weight: normal;
}

/* --- Сообщения и навигация --- */
#msgbox-outer {
width: 100%;
max-width: 600px;
display: flex;
flex-direction: row;
align-items: stretch;
justify-content: center;
gap: 1.6rem;
margin: 0 auto;
}
@media (max-width: 640px) {
#centered-block,
#msgbox-outer {
    max-width: 97vw;
    gap: 0.45rem;
}
}
#msgbox {
min-height: 90px;
display: flex;
flex-direction: column;
justify-content: center;
background: white;
border-radius: 1.25rem;
box-shadow: 0 8px 36px 0 #0002;
margin: 0 auto;
overflow: hidden;
width: 100%;
max-width: 600px;
box-sizing: border-box;
padding-top: 1.25rem;
padding-bottom: 1.25rem;
padding-left: 2rem;
padding-right: 2rem;
transition: transform 0.42s cubic-bezier(.65,0,.35,1), opacity 0.36s cubic-bezier(.6,0,.4,1);
}
#msg-text {
word-break: break-word;
overflow-y: auto;
max-height: 42vh;
font-size: 1rem;
font-weight: normal;
line-height: 1.25;
margin-bottom: 0;
}
#msg-time {
margin-top: 1.2rem;
}
.nav-btn-side {
width: 54px;
min-width: 54px;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
background: transparent;
border-radius: 1.1rem;
border: none;
font-size: 2rem;
color: #333;
cursor: pointer;
box-shadow: none;
margin-top: auto;
margin-bottom: auto;
transition: background 0.16s, box-shadow 0.2s;
outline: none;
}
.nav-btn-side:disabled {
opacity: 0.28;
pointer-events: none;
}
.nav-btn-side:hover:not(:disabled) {
/* Можно включить подсветку */
}

/* Fade анимации для смены сообщений */
#msgbox.fade-in {
opacity: 1 !important;
transition: opacity 0.46s cubic-bezier(.61,0,.37,1);
}
#msgbox.fade-out {
opacity: 0 !important;
transition: opacity 0.23s cubic-bezier(.61,0,.37,1);
}
/* Slide-fade анимации */
#msgbox.slide-left { transform: translateX(-60%) scale(0.96); opacity: 0; z-index: 2; }
#msgbox.slide-right { transform: translateX(60%) scale(0.96); opacity: 0; z-index: 2; }
#msgbox.slide-in-left { transform: translateX(48px); opacity: 0; }
#msgbox.slide-in-right { transform: translateX(-48px); opacity: 0; }
#msgbox.fade-in { opacity: 1 !important; transform: translateX(0) scale(1); }

/* --- Общий стиль модалок --- */
.modal-bg, #mood-modal-bg {
position: fixed;
left: 0;
top: 0;
width: 100vw;
height: 100vh;
background: rgba(255,255,255,0.85);
backdrop-filter: blur(2.5px);
z-index: 1000;
display: flex;
align-items: center;
justify-content: center;
opacity: 0;
pointer-events: none;
transition: opacity 0.32s;
}
.modal-bg.open, #mood-modal-bg.open {
opacity: 1;
pointer-events: auto;
}
.about-modal, #mood-modal {
background: rgba(255,255,255,0.98);
border-radius: 2rem;
box-shadow: 0 8px 56px 0 #0002;
padding: 2.4rem 2.7rem 2.4rem 2.7rem;
max-width: 92vw;
min-width: 310px;
max-height: 83vh;
width: 610px;
display: flex;
flex-direction: column;
align-items: stretch;
opacity: 0;
transform: scale(0.97) translateY(24px);
transition: opacity 0.36s, transform 0.36s;
}
.modal-bg.open .about-modal, #mood-modal-bg.open #mood-modal {
opacity: 1;
transform: scale(1) translateY(0);
}
.about-modal .about-ok, #mood-modal .mood-modal-close {
border-radius: 9999px;
padding: 0.32em 1.4em;
font-size: 1.14em;
background: #f3f4f6;
box-shadow: 0 1px 6px #0001;
color: #444;
border: none;
margin: 2.2em auto 0 auto;
transition: background 0.18s;
}
.about-modal .about-ok:hover, #mood-modal .mood-modal-close:hover {
background: #e2e8f0;
}
.about-modal .about-title, .mood-modal-title {
font-weight: 600;
font-size: 1.18em;
margin-bottom: 1.2em;
text-align: center;
letter-spacing: 0.01em;
}
.about-modal .text-base {
max-height: 42vh;
overflow-y: auto;
}
.about-modal .text-base p {
    word-break: break-word;
    width: 100%;
    text-align: left;
    font-size: 1rem;
    font-weight: normal;
    line-height: 1.25;
    margin-bottom: 0;
}

/* --- Mood Bar (продолговатый прогресс-бар с маркером) --- */
.mood-bar-wrap {
min-width: 210px;
min-height: 36px;
position: relative;
display: flex;
flex-direction: column;
align-items: center;
margin-right: 0.2em;
}
.mood-bar {
display: flex;
flex-direction: row;
align-items: flex-end;
gap: 4px;
background: transparent;
position: relative;
z-index: 2;
min-width: 390px;
padding-top: 5px;
padding-bottom: 2px;
}
.mood-bar-block {
width: 28px;
height: 30px;
border-radius: 15px;
box-shadow: 0 2px 14px #e5e7eb33;
transition: background 0.22s, box-shadow 0.16s;
background: #eee;
margin: 0 2.2px;
}
.mood-bar-block.gray { background: #e5e7eb; }
.mood-bar-marker {
position: absolute;
top: 50%;
left: 0;
width: 20px;
height: 20px;
border-radius: 50%;
background: #232325;
border: 2px solid #fff;
box-shadow: 0 4px 18px #0001, 0 1px 3px #2221;
transform: translate(-50%, -50%);
z-index: 10;
pointer-events: none;
transition: left 0.32s cubic-bezier(.68,0,.32,1);
}
.mood-bar-labels {
width: 100%;
display: flex;
flex-direction: row;
justify-content: space-between;
font-size: 0.90em;
margin-top: 5px;
color: #b5b5b9;
font-weight: 400;
user-select: none;
pointer-events: none;
}

@media (max-width: 640px) {
.mood-bar-wrap { min-width: 122px; }
.mood-bar { min-width: 170px; gap: 2px; padding-top: 2px; padding-bottom: 2px; }
.mood-bar-block { width: 13.3px; height: 19px; border-radius: 7.2px; margin: 0 1px; }
.mood-bar-marker { width: 13px; height: 13px; top: 50%; border-width: 2px; }
.mood-bar-labels { font-size: 0.75em; margin-top: 3px; }
}

.pin-icon {
position: absolute;
top: -17px;
left: 18px;
z-index: 2;
background: #fff;
border-radius: 1.2em;
box-shadow: 0 2px 10px #0001;
padding: 2px 4px;
pointer-events: none;
opacity: 0.92;
}
#pinned-block {
position: relative; /* обязательно! */
}
.about-modal a, .about-modal a:visited {
color: #2196f3;      /* Светло-голубой */
text-decoration: underline; /* Подчёркивание */
transition: color 0.2s;
word-break: break-all;
}
.about-modal a:hover, .about-modal a:focus {
color: #1565c0;      /* Потемнее при наведении */
text-decoration: underline;
}

#pinned-block a, #pinned-block a:visited {
color: #2196f3;
text-decoration: underline;
transition: color 0.2s;
word-break: break-all;
}
#pinned-block a:hover, #pinned-block a:focus {
color: #1565c0;
text-decoration: underline;
}
