:root {
    --ph-bg: transparent;
    --ph-skeleton-base: #F0F0F0;
    --ph-shimmer: rgba(255, 255, 255, 0.6);
    --ph-bubble-left: #F0F0F0;
    --ph-bubble-right: #F0F0F0;
}
[data-theme='dark'] {
    --ph-skeleton-base: #212121;
    --ph-shimmer: #2C2C2C;
    --ph-bubble-left: #212121;
    --ph-bubble-right: #212121;
}
@keyframes ph-bubble-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
.tg-skeleton {
    position: relative;
    overflow: hidden;
    background: var(--ph-skeleton-base) !important;
}
.tg-skeleton::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent 25%, var(--ph-shimmer) 50%, transparent 75%);
    background-size: 200% 100%;
    animation: ph-bubble-shimmer 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    pointer-events: none;
}
.ph-bubble::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent 25%, var(--ph-shimmer) 50%, transparent 75%);
    background-size: 200% 100%;
    animation: ph-bubble-shimmer 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    pointer-events: none;
}
.skeleton-item {
    display: flex;
    align-items: center;
    padding: 9px 16px;
    width: 100%;
    height: 72px;
    box-sizing: border-box;
}
.skeleton-avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    margin-right: 16px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    background: var(--ph-skeleton-base) !important;
}
.skeleton-avatar-circle::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent 25%, var(--ph-shimmer) 50%, transparent 75%);
    background-size: 200% 100%;
    animation: ph-bubble-shimmer 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    pointer-events: none;
}
.skeleton-text-block {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-family: -apple-system, system-ui, sans-serif !important;
    -webkit-user-select: none;
    user-select: none;
}
.skeleton-text-block, .skeleton-text-block * {
    color: var(--ph-skeleton-base) !important;
    letter-spacing: -.03em !important;
}
.skeleton-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.skeleton-line-long {
    height: 14px;
    border-radius: 4px;
    background: var(--ph-skeleton-base) !important;
    width: 100%;
    display: block;
}
.skeleton-line-short {
    height: 14px;
    border-radius: 4px;
    background: var(--ph-skeleton-base) !important;
    width: 100%;
    display: block;
}
.skeleton-line-tiny {
    width: 32px;
    height: 10px;
    border-radius: 4px;
    background: var(--ph-skeleton-base) !important;
    display: block;
}
.ph-item {
    width: 100%;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-sizing: border-box;
}
.ph-msg {
    display: flex;
    width: 100%;
}
.ph-msg.left { justify-content: flex-start; }
.ph-msg.right { justify-content: flex-end; }
.ph-bubble {
    min-height: 44px;
    min-width: 30%;
    max-width: 70%;
    border-radius: 16px;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}
.ph-msg.left .ph-bubble {
    background-color: var(--ph-bubble-left) !important;
    border-radius: 16px 16px 16px 0;
    padding-left: 22px;
    padding-right: 16px;
    -webkit-mask-box-image: url("data:image/svg+xml;charset=utf-8,<svg height='35' viewBox='0 0 96 70' width='48' xmlns='http://www.w3.org/2000/svg'><path d='m96 35c1 7-5 37-42 35-37 2-43-28-42-35-1-7 5-37 42-35 37-2 43 28 42 35z'/><path d='m0 70c6-2 12-10 12-19v-16l14 27s-8 8-26 8z'/></svg>") 50% 42% 46% 56%;
}
.ph-msg.right .ph-bubble {
    background-color: var(--ph-bubble-right) !important;
    border-radius: 16px 16px 0 16px;
    padding-right: 22px;
    padding-left: 16px;
    -webkit-mask-box-image: url("data:image/svg+xml;charset=utf-8,<svg height='35' viewBox='0 0 96 70' width='48' xmlns='http://www.w3.org/2000/svg'><path d='m84 35c1 7-5 37-42 35-37 2-43-28-42-35-1-7 5-37 42-35 37-2 43 28 42 35z'/><path d='m96 70c-6-2-12-10-12-19v-16l-14 27s8 8 26 8z'/></svg>") 50% 56% 46% 42%;
}
.ph-media-1-1 {
    aspect-ratio: 1 / 1;
    width: 100%;
    border-radius: 16px;
    background: var(--ph-skeleton-base) !important;
    position: relative;
    overflow: hidden;
}
.ph-media-1-1::after {
    content: "";
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent 25%, var(--ph-shimmer) 50%, transparent 75%);
    background-size: 200% 100%;
    animation: ph-bubble-shimmer 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
.ph-media-4-3 {
    aspect-ratio: 4 / 3;
    width: 100%;
    border-radius: 16px;
    background: var(--ph-skeleton-base) !important;
    position: relative;
    overflow: hidden;
}
.ph-media-4-3::after {
    content: "";
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent 25%, var(--ph-shimmer) 50%, transparent 75%);
    background-size: 200% 100%;
    animation: ph-bubble-shimmer 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
.ph-voice {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    width: 100%;
}
.ph-voice-play {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--ph-skeleton-base) !important;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}
.ph-voice-play::after {
    content: "";
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent 25%, var(--ph-shimmer) 50%, transparent 75%);
    background-size: 200% 100%;
    animation: ph-bubble-shimmer 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
.ph-voice-bar {
    height: 4px;
    flex-grow: 1;
    border-radius: 2px;
    background: var(--ph-skeleton-base) !important;
    position: relative;
    overflow: hidden;
}
.ph-voice-bar::after {
    content: "";
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent 25%, var(--ph-shimmer) 50%, transparent 75%);
    background-size: 200% 100%;
    animation: ph-bubble-shimmer 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}