:root {
    --blue: #0038ff;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    height: 100vh;
    background: #ffffff;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #111827;
}

.viewport {
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
    position: relative;
    justify-content: center;
}

.page-header {
    width: 100%;
    display: flex;
    justify-content: center;
    position: fixed;
    top: 14px;
}

.logo {
    display: inline-flex;
    align-items: center;
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: 0.03em;
}

.logo-img {
    height: 43px;
}

.logo-text {
    font-size: 3rem;
    line-height: 2.1rem;
    font-weight: 700;
    margin-left: 2px;
    font-family: 'UniChat', sans-serif;
    color: #000;
}

.phone-stage {
    flex: 1 1 auto;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.phone-shell {
    width: min(100%, 420px);
    height: min(95vh, 780px);
    background: linear-gradient(180deg, #ffffff 0%, #f5f7fb 100%);
    border-radius: 40px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 32px 80px rgba(15, 23, 42, 0.12);
    padding: 20px 14px 50px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.72rem;
    color: #6b7280;
}

.status-icons {
    display: inline-flex;
    gap: 3px;
}

.status-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #d1d5db;
}

.chat-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 20px;
    background: rgba(17, 24, 39, 0.04);
}

.chat-avatar {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    overflow: hidden;
}

.chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.chat-name {
    font-weight: 600;
    font-size: 1rem;
}

.chat-state {
    font-size: 0.82rem;
    color: #6b7280;
}

.message-feed {
    flex: 1;
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    overflow-x: hidden;
}

.message {
    max-width: 92%;
    padding: 14px 18px;
    border-radius: 22px;
    font-size: 0.98rem;
    line-height: 1.45;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
    opacity: 0;
}

.message p {
    margin: 0;
}

.message--polly {
    align-self: flex-start;
    border-top-left-radius: 8px;
}

.message--user {
    align-self: flex-end;
    background: var(--blue);
    color: #ffffff;
    border: none;
    box-shadow: 0 18px 36px rgba(0, 56, 255, 0.25);
    border-top-right-radius: 8px;
}

.message--profile {
    padding: 12px;
}

.message--profile figure {
    margin: 0;
    background: #ffffff;
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    box-shadow: 0 20px 44px rgba(15, 23, 42, 0.12);
    display: flex;
    flex-direction: column;
}

.message--profile img {
    display: block;
    width: 100%;
    height: 280px;
    object-fit: cover;
}

.message--events {
    padding: 12px;
}

.events-card {
    display: flex;
    gap: 12px;
    background: #ffffff;
    border-radius: 24px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.12);
    overflow: hidden;
}

.events-card__primary {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 100%;
}

.events-card__image {
    position: relative;
    overflow: hidden;
}

.events-card__image img {
    width: 100%;
    height: 240px;
    object-fit: cover;
    display: block;
}

.events-card__badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--blue);
    color: #ffffff;
    border-radius: 14px;
    padding: 6px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    box-shadow: 0 12px 24px rgba(0, 56, 255, 0.25);
}

.events-card__badge strong {
    font-size: 0.88rem;
    letter-spacing: normal;
}

.events-card__body {
    padding: 18px 18px 22px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.events-card__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: #0f172a;
}

.events-card__description {
    margin: 0;
    font-size: 0.9rem;
    color: #475569;
}

.events-card__action {
    align-self: flex-start;
    padding: 10px 18px;
    border-radius: 999px;
    border: none;
    background: var(--blue);
    color: #ffffff;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: 0 16px 28px rgba(0, 56, 255, 0.25);
}

.events-card__pagination {
    display: flex;
    gap: 6px;
    margin-top: 2px;
}

.events-card__dot {
    width: 36px;
    height: 6px;
    border-radius: 6px;
    background: #e5e7eb;
}

.events-card__dot--active {
    background: var(--blue);
}

.events-card__secondary {
    width: 96px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-top-left-radius: 24px;
    border-bottom-left-radius: 24px;
}

.events-card__secondary img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(1.1);
}

.events-card__secondary-title {
    position: absolute;
    bottom: 10px;
    left: 8px;
    right: 8px;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.7);
    color: #ffffff;
    font-size: 0.7rem;
    padding: 6px 8px;
    text-align: center;
}

.message--progress {
    padding: 10px 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

.progress-track {
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: #e5e7eb;
    overflow: hidden;
}

.progress-bar {
    width: 0;
    height: 100%;
    background: var(--blue);
    border-radius: 999px;
    animation: progressFill 1.6s ease forwards;
}

.composer {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    margin-top: auto;
    position: fixed;
    bottom: 25px;
    z-index: 30;
}

.composer-input {
    width: min(100%, 340px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 18px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.14);
    backdrop-filter: blur(18px);
    color: #475569;
    font-size: 0.96rem;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.composer-input:hover,
.composer--open .composer-input {
    border-color: rgba(0, 56, 255, 0.5);
    box-shadow: 0 36px 56px rgba(0, 56, 255, 0.2);
    color: #111827;
}

.composer-placeholder {
    flex: 1;
    text-align: left;
}

.composer-send {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--blue);
    transform: rotate(180deg);
}

.composer-actions {
    position: absolute;
    bottom: calc(100% + 18px);
    left: 50%;
    transform: translate(-50%, 16px);
    width: min(100%, 420px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.composer--open .composer-actions {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, 0);
}

.composer-action {
    width: 150px;
    height: 70px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 14px 18px;
    border-radius: 18px;
    background: linear-gradient(135deg, #0038ff, #2858ff);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.98rem;
    text-decoration: none;
    box-shadow: 0 24px 42px rgba(0, 56, 255, 0.28);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: none;
}

.composer-action:nth-child(2) {
    background: linear-gradient(135deg, #1a4dff, #4a6fff);
}

.composer-action:nth-child(3) {
    background: linear-gradient(135deg, #4a6fff, #7c8dff);
}

.composer-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 30px 52px rgba(0, 56, 255, 0.32);
}

.composer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 10;
}

body.composer-open .composer-backdrop {
    opacity: 1;
    pointer-events: auto;
}

body.composer-open {
    overflow: hidden;
}

@keyframes progressFill {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

.profile-meta {
    padding: 18px 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.profile-name {
    margin: 0;
    font-size: 1.26rem;
    font-weight: 600;
    color: #1f2937;
}

.sync-action {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: 16px;
    background: var(--blue);
    color: #ffffff;
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    text-decoration: none;
    align-self: flex-start;
    box-shadow: 0 16px 28px rgba(0, 56, 255, 0.28);
}

.sync-action svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.message--visible {
    opacity: 1;
    animation-duration: 0.7s;
    animation-fill-mode: forwards;
    animation-timing-function: cubic-bezier(0.22, 0.88, 0.36, 1);
}

.message--polly.message--visible {
    animation-name: slideInLeft;
}

.message--user.message--visible {
    animation-name: slideInRight;
}

@keyframes slideInLeft {
    0% {
        opacity: 0;
        transform: translateX(-24px) translateY(16px);
    }
    60% {
        opacity: 1;
        transform: translateX(6px) translateY(-4px);
    }
    100% {
        opacity: 1;
        transform: translateX(0) translateY(0);
    }
}

@keyframes slideInRight {
    0% {
        opacity: 0;
        transform: translateX(24px) translateY(16px);
    }
    60% {
        opacity: 1;
        transform: translateX(-6px) translateY(-4px);
    }
    100% {
        opacity: 1;
        transform: translateX(0) translateY(0);
    }
}

.message-feed.message-feed--fade-out .message {
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

@media (min-width: 960px) {
    .message {
        max-width: 72%;
        padding: 12px 16px;
        border-radius: 20px;
        font-size: 0.9rem;
    }

    .profile-meta {
        padding: 16px 16px 18px;
        gap: 12px;
    }

    .profile-name {
        font-size: 1.1rem;
    }

    .message--profile img {
        height: 240px;
    }

    .message--events {
        max-width: 78%;
    }

    .events-card__image img {
        height: 220px;
    }

    .events-card__secondary {
        width: 88px;
    }
}

@media (max-width: 540px) {
    .page-header {
        display: none;
    }

    .viewport {
        padding: 0;
    }

    .page-header {
        padding: 18px 18px 0;
    }

    .phone-stage {
        width: 100%;
        flex: 1 1 auto;
    }

    .phone-shell {
        width: 100%;
        height: calc(100% - 77px);
        border-radius: 0;
        border: none;
        box-shadow: none;
        padding: 11px 14px 65px;
        background: #ffffff;
    }

    .logo-text {
        display: none;
    }

    .message {
        font-size: 0.92rem;
    }

    .message--profile img {
        height: 220px;
    }

    .events-card {
        flex-direction: column;
    }

    .events-card__image img {
        height: 200px;
    }

    .events-card__secondary {
        width: 100%;
        border-radius: 0 0 24px 24px;
    }

    .events-card__secondary-title {
        font-size: 0.68rem;
    }

    .composer {
        padding: 0 18px 32px;
        gap: 16px;
        align-items: stretch;
        bottom: -15px;
    }

    .composer-input {
        width: 100%;
    }

    .composer-actions {
        width: 100%;
        left: 0;
        right: 0;
        transform: translateY(16px);
    }

    .composer--open .composer-actions {
        transform: translateY(0);
    }
}
