/* ============================================
   TELEGRAM CHAT MOCKUP
   Имитация интерфейса Telegram для showcase
   Основано на стилях telegram-tt (GPL v3)
   ============================================ */

/* Container - iPhone frame (fixed dimensions) */
.tg-mockup {
    width: 300px;  /* Уменьшено на 20% для компактности */
    height: 465px; /* Пропорционально уменьшено */
    max-width: 100%;
    background: #212121; /* Telegram dark theme background - exact value */
    border-radius: 24px;
    overflow: hidden;
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    /* Telegram exact font stack */
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Apple Color Emoji', 'Segoe UI', Oxygen, Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Chat header */
.tg-mockup__header {
    display: flex;
    align-items: center;
    gap: 8px; /* Уменьшен отступ между элементами */
    padding: 8px;
    height: 56px;
    flex-shrink: 0; /* Don't shrink */
    background: #212121;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    box-sizing: border-box;
}

.tg-mockup__back {
    width: 32px; /* Уменьшено */
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    margin-left: -4px; /* Компенсация для выравнивания */
}

.tg-mockup__back svg {
    width: 20px;
    height: 20px;
    fill: #8774e1;
}

.tg-mockup__back:hover {
    background: rgba(135, 116, 225, 0.1);
}

.tg-mockup__menu {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: auto;
    flex-shrink: 0;
}

.tg-mockup__menu svg {
    width: 24px;
    height: 24px;
    fill: rgba(255, 255, 255, 0.5);
}

.tg-mockup__menu:hover {
    background: rgba(255, 255, 255, 0.1);
}

.tg-mockup__avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #D4A853 0%, #00D4FF 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    font-size: 14px;
    flex-shrink: 0;
    overflow: hidden;
    margin-left: -4px; /* Равный отступ от стрелки как у стрелки от края */
}

.tg-mockup__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tg-mockup__contact {
    flex: 1;
    min-width: 0;
}

.tg-mockup__name {
    font-size: 16px;
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tg-mockup__status {
    font-size: 14px;
    color: #aaa;
}

/* Chat area */
.tg-mockup__chat {
    padding: 12px 16px; /* Extra horizontal padding for message tails */
    flex: 1; /* Fill remaining space */
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background-color: #0d0d0d;
    --chat-bg: #0d0d0d; /* CSS variable for button corner masks */
    position: relative;
    /* Telegram-style doodle pattern - dinosaurs, umbrellas, stars, hearts, etc. */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300' viewBox='0 0 300 300'%3E%3Cg fill='%23ffffff' fill-opacity='0.045'%3E%3C!-- Dinosaur 1 --%3E%3Cpath d='M25 45c2-8 8-12 15-10 3 1 5 4 7 7l3-2c4-2 9 0 10 4 0 2-1 4-3 5l1 4c1 3-1 6-4 6h-5l-1 8h-4l1-8h-6c-3 0-5-2-5-5l-1-3c-4-1-7-4-8-6z'/%3E%3C!-- Heart --%3E%3Cpath d='M75 35c4-4 10-4 14 0 4 4 4 10 0 14l-14 14-14-14c-4-4-4-10 0-14 4-4 10-4 14 0z'/%3E%3C!-- Star --%3E%3Cpath d='M130 25l5 10 11 2-8 8 2 11-10-5-10 5 2-11-8-8 11-2z'/%3E%3C!-- Umbrella --%3E%3Cpath d='M180 30c12 0 22 8 24 20h-48c2-12 12-20 24-20zm-2 20v25m-5 0h10'/%3E%3C!-- Circle --%3E%3Ccircle cx='240' cy='40' r='12'/%3E%3C!-- Cloud --%3E%3Cpath d='M270 45c-2-5 2-10 7-10 4 0 7 3 8 6 3-1 7 1 8 5 0 4-3 7-7 7h-12c-4 0-6-4-4-8z'/%3E%3C!-- Balloon --%3E%3Cellipse cx='35' cy='110' rx='10' ry='14'/%3E%3Cpath d='M35 124v20m-3 0c2 2 4 2 6 0'/%3E%3C!-- Music note --%3E%3Cpath d='M85 100v30m0-30c5-2 10 0 10 5s-5 8-10 6m10-11v30c0 3-4 5-8 4-3-1-5-4-4-7 1-4 6-6 12-3'/%3E%3C!-- Sun --%3E%3Ccircle cx='145' cy='115' r='8'/%3E%3Cpath d='M145 100v-8m0 46v-8m15-15h8m-46 0h8m11-11l5-5m-22 22l5-5m17 0l5 5m-22-22l5 5' stroke='%23fff' stroke-opacity='0.035' stroke-width='2'/%3E%3C!-- Cat --%3E%3Cpath d='M195 120c0-8 6-15 15-15s15 7 15 15-6 12-15 12-15-4-15-12zm5-12l-3-8m23 8l3-8m-18 15c2 2 5 2 7 0'/%3E%3C!-- Flower --%3E%3Ccircle cx='260' cy='115' r='5'/%3E%3Ccircle cx='260' cy='100' r='6' fill-opacity='0.045'/%3E%3Ccircle cx='272' cy='108' r='6' fill-opacity='0.045'/%3E%3Ccircle cx='268' cy='122' r='6' fill-opacity='0.045'/%3E%3Ccircle cx='252' cy='122' r='6' fill-opacity='0.045'/%3E%3Ccircle cx='248' cy='108' r='6' fill-opacity='0.045'/%3E%3C!-- Dinosaur 2 --%3E%3Cpath d='M25 190c0-10 8-18 18-18 5 0 9 2 12 5l8-3c5-1 9 2 9 7 0 3-2 6-5 7v8c0 4-3 7-7 7h-8v10h-6v-10h-8c-4 0-7-3-7-7v-3c-4-2-6-5-6-3z'/%3E%3C!-- Rocket --%3E%3Cpath d='M90 175l15 25h-30zm15 25l8 12h-8zm-30 0l-8 12h8zm12-10v22'/%3E%3C!-- Lightning --%3E%3Cpath d='M150 170l-5 15h10l-8 20 18-22h-10l8-13z'/%3E%3C!-- Trophy --%3E%3Cpath d='M195 175h30v10c0 8-6 15-15 15s-15-7-15-15v-10zm-5 0c-5 0-8 4-8 8 0 5 3 8 8 8m40-16c5 0 8 4 8 8 0 5-3 8-8 8m-20 8v10m-8 0h16'/%3E%3C!-- Plane --%3E%3Cpath d='M265 180l20-10-10 15-10 15zm10 5l-15 10m0-15l15 5'/%3E%3C!-- Gift --%3E%3Crect x='20' y='255' width='25' height='20' rx='2'/%3E%3Crect x='20' y='250' width='25' height='8' rx='1'/%3E%3Cpath d='M32 250v25m-7-15c5-5 7-10 7-10s2 5 7 10'/%3E%3C!-- Ice cream --%3E%3Cpath d='M90 250c-8 0-14 6-14 13h28c0-7-6-13-14-13zm-7 13l7 25 7-25'/%3E%3C!-- Book --%3E%3Crect x='135' y='250' width='25' height='32' rx='2'/%3E%3Cpath d='M140 254h15m-15 5h12m-12 5h15m-15 5h10'/%3E%3C!-- Donut --%3E%3Ccircle cx='210' cy='265' r='15'/%3E%3Ccircle cx='210' cy='265' r='6' fill='%230d0d0d'/%3E%3Ccircle cx='202' cy='258' r='2'/%3E%3Ccircle cx='218' cy='260' r='2'/%3E%3Ccircle cx='205' cy='272' r='2'/%3E%3C!-- Pizza --%3E%3Cpath d='M265 250c15 0 28 12 28 28h-28v-28z'/%3E%3Ccircle cx='275' cy='265' r='3'/%3E%3Ccircle cx='283' cy='272' r='2'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 300px 300px;
    background-repeat: repeat;
    /* Hide scrollbar but keep functionality */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.tg-mockup__chat::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* Messages */
.tg-msg {
    max-width: 85%;
    padding: 5px 8px 6px;
    border-radius: 15px;
    font-size: 16px;
    line-height: 1.4;
    position: relative;
    animation: tg-msg-appear 0.3s ease-out;
    z-index: 1; /* Above pattern overlay */
}

@keyframes tg-msg-appear {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* User message (right side, purple) */
.tg-msg--user {
    align-self: flex-end;
    background: #766ac8;
    color: #fff;
    border-radius: 12px 12px 4px 12px;
    margin-left: auto;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Bot message (left side, dark) */
.tg-msg--bot {
    align-self: flex-start;
    background: #212121;
    color: #fff;
    border-radius: 12px 12px 12px 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Voice message - sharp corner instead of tail */
.tg-msg--voice.tg-msg--user {
    border-radius: 12px 12px 2px 12px;
}

.tg-msg--voice.tg-msg--bot {
    border-radius: 12px 12px 12px 2px;
}

/* Message text */
.tg-msg__text {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 16px;
    font-weight: 400;
    line-height: 21px;
}

/* Message time */
.tg-msg__time {
    font-size: 12px;
    color: #686c72;
    margin-top: 4px;
    text-align: right;
}

.tg-msg--user .tg-msg__time {
    color: rgba(255, 255, 255, 0.7);
}

.tg-msg--user .tg-msg__time {
    color: rgba(255, 255, 255, 0.7);
}

/* Check marks - uses accent color like Telegram */
.tg-msg__checks {
    display: inline-flex;
    align-items: center;
    margin-left: 4px;
    color: #8774e1;
}

.tg-msg__checks svg {
    width: 16px;
    height: 11px;
}

/* On purple user messages, checkmarks should be lighter */
.tg-msg--user .tg-msg__checks {
    color: rgba(255, 255, 255, 0.85);
}

/* Voice message */
.tg-msg--voice {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 220px;
    padding: 8px 12px;
}

.tg-msg__voice-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tg-msg__voice-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tg-msg__voice-top {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-right: 2px; /* Выравнивание с галочками внизу */
}

.tg-msg__voice-play {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #8774e1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.15s;
}

.tg-msg__voice-play svg {
    fill: #fff;
}

.tg-msg--user .tg-msg__voice-play {
    background: #fff;
}

.tg-msg--user .tg-msg__voice-play svg {
    fill: #766ac8;
}

.tg-msg--bot .tg-msg__voice-play {
    background: #8774e1;
}

.tg-msg--bot .tg-msg__voice-play svg {
    fill: #fff;
}

.tg-msg__voice-play:hover {
    transform: scale(1.05);
}

.tg-msg__voice-play svg {
    width: 26px;
    height: 26px;
    fill: #fff;
    margin-left: 2px; /* Telegram exact: 2px optical offset */
}

.tg-msg__voice-waveform {
    flex: 1;
    max-width: 110px; /* Укорочено для места кнопке сворачивания */
    height: 23px; /* Telegram: 24px (canvas 46px / 2 for retina) */
    display: flex;
    align-items: center;
    gap: 3px; /* Чуть больше отступ между барами для аккуратности */
}

.tg-msg__voice-bar {
    width: 2px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 1px;
}

.tg-msg--bot .tg-msg__voice-bar {
    background: rgba(255, 255, 255, 0.45);
}

.tg-msg--user .tg-msg__voice-bar {
    background: rgba(255, 255, 255, 0.6);
}

/* Collapse icon (^) - styled button like in real Telegram */
.tg-msg__voice-collapse-icon {
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.15);
    padding: 4px 6px;
    border-radius: 10px;
    line-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease;
}

.tg-msg__voice-collapse-icon:hover {
    background: rgba(255, 255, 255, 0.25);
}

.tg-msg__voice-collapse-icon svg {
    stroke: rgba(255, 255, 255, 0.85);
    width: 12px;
    height: 12px;
}

.tg-msg--user .tg-msg__voice-collapse-icon {
    background: rgba(255, 255, 255, 0.2);
}

.tg-msg--user .tg-msg__voice-collapse-icon svg {
    stroke: rgba(255, 255, 255, 0.9);
}

.tg-msg__voice-duration {
    font-size: 14px; /* Telegram exact */
    color: #aaa;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-top: 4px; /* Telegram exact */
}

.tg-msg--user .tg-msg__voice-duration {
    color: rgba(255, 255, 255, 0.7);
}

.tg-msg__voice-dot {
    font-size: 8px;
}

.tg-msg__voice-dot--red {
    color: #ff5c5c;
}

.tg-msg__voice-dot--white {
    color: rgba(255, 255, 255, 0.7);
}

/* Voice transcript - normal text like in real Telegram */
.tg-msg__voice-transcript {
    font-size: 16px;
    color: #fff;
    font-style: normal;
    font-weight: 400;
    margin-top: 4px;
    line-height: 1.35;
}

/* Time at bottom of voice message (below transcript) */
.tg-msg__time--voice-bottom {
    text-align: right;
    margin-top: 4px;
}

/* Image message */
.tg-msg--image {
    padding: 3px;
    max-width: 280px;
}

.tg-msg__image {
    border-radius: 10px;
    overflow: hidden;
    line-height: 0;
}

.tg-msg__image img {
    width: 100%;
    height: auto;
    display: block;
}

.tg-msg__caption {
    padding: 6px 8px 2px;
    font-size: 15px;
    line-height: 1.35;
}

.tg-msg__time--image {
    padding: 0 8px 4px;
}

/* File/Document message */
.tg-msg--file {
    padding: 8px;
}

.tg-msg__file {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
}

.tg-msg__file-icon-wrap {
    flex-shrink: 0;
    width: 42px;
    height: 54px;
}

.tg-msg__file-icon {
    width: 42px;
    height: 54px;
}

.tg-msg__file-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.tg-msg__file-name {
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.tg-msg__file-size {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

.tg-msg--user .tg-msg__file-name {
    color: #1a472a;
}

.tg-msg--user .tg-msg__file-size {
    color: rgba(26, 71, 42, 0.7);
}

/* Input area */
.tg-mockup__input {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 6px 8px;
    height: 44px;
    flex-shrink: 0; /* Don't shrink */
    background: #212121;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    box-sizing: border-box;
}

.tg-mockup__input-field {
    flex: 1;
    min-width: 0; /* Allow shrinking */
    background: transparent;
    border: none;
    padding: 6px 4px;
    color: #fff;
    font-size: 15px;
    outline: none;
}

.tg-mockup__input-field::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.tg-mockup__input-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.5);
    transition: color 0.2s;
    flex-shrink: 0;
}

.tg-mockup__input-btn:hover {
    color: rgba(255, 255, 255, 0.8);
}

.tg-mockup__input-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Emoji button */
.tg-mockup__input-btn--emoji svg {
    width: 22px;
    height: 22px;
}

/* Attach button */
.tg-mockup__input-btn--attach svg {
    width: 18px;
    height: 18px;
}

/* Mic button */
.tg-mockup__input-btn--mic {
    background: #212121;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tg-mockup__input-btn--mic:hover {
    background: #2a2a2a;
}

.tg-mockup__input-btn--mic svg {
    width: 18px;
    height: 18px;
}

/* Typing indicator */
.tg-msg--typing .tg-msg__text::after {
    content: '';
    display: inline-block;
    width: 4px;
    height: 14px;
    background: #8774e1;
    margin-left: 4px;
    animation: tg-cursor-blink 0.8s infinite;
    vertical-align: middle;
}

@keyframes tg-cursor-blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Play overlay for animated mockups */
.tg-mockup__play-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.3s;
    z-index: 10;
}

.tg-mockup__play-overlay:hover {
    background: rgba(0, 0, 0, 0.4);
}

.tg-mockup__play-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(135, 116, 225, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.tg-mockup__play-overlay:hover .tg-mockup__play-btn {
    transform: scale(1.1);
}

.tg-mockup__play-btn svg {
    width: 28px;
    height: 28px;
    fill: #fff;
    /* Минимальная оптическая компенсация */
    transform: translateX(1px);
}

.tg-mockup--playing .tg-mockup__play-overlay {
    opacity: 0;
    pointer-events: none;
}

/* Date separator */
.tg-msg__date {
    text-align: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    padding: 8px 0;
    margin: 8px 0;
}

/* List in messages */
.tg-msg__list {
    margin: 6px 0 0 0;
    padding-left: 0;
    list-style: none;
}

.tg-msg__list li {
    position: relative;
    padding-left: 16px;
    margin-bottom: 2px;
}

.tg-msg__list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: #8774e1;
}

/* Placeholder for generated content */
.tg-msg__placeholder {
    display: inline-block;
    padding: 6px 12px;
    background: rgba(135, 116, 225, 0.15);
    border-radius: 8px;
    color: #8774e1;
    font-size: 13px;
    font-style: italic;
    margin: 4px 0;
}

/* Responsive */
@media (max-width: 480px) {
    .tg-mockup {
        width: 100%;
        height: 500px; /* Slightly shorter on mobile */
        border-radius: 0;
    }
}

/* ============================================
   LIGHT THEME
   Светлая тема для интеграции в светлый лендинг
   ============================================ */

.tg-mockup--light {
    background: #ffffff;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(0, 0, 0, 0.05);
}

.tg-mockup--light .tg-mockup__header {
    background: #ffffff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.tg-mockup--light .tg-mockup__back svg {
    fill: #8774e1;
}

.tg-mockup--light .tg-mockup__menu svg {
    fill: #9e9e9e;
}

.tg-mockup--light .tg-mockup__name {
    color: #000000;
}

.tg-mockup--light .tg-mockup__status {
    color: #8e8e93;
}

/* Chat area - светлый фон с паттерном */
.tg-mockup--light .tg-mockup__chat {
    background-color: #e6ebee;
    --chat-bg: #e6ebee; /* CSS variable for button corner masks */
    /* Тематический паттерн V2Bot - иконки задач */
    background-image: url("../../img/v2bot-pattern.svg");
    background-size: 400px 400px;
}

/* User message - зелёный как в Telegram light */
.tg-mockup--light .tg-msg--user {
    background: #eeffde;
    color: #000000;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

/* Bot message - белый */
.tg-mockup--light .tg-msg--bot {
    background: #ffffff;
    color: #000000;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

/* Time */
.tg-mockup--light .tg-msg__time {
    color: rgba(0, 0, 0, 0.45);
}

.tg-mockup--light .tg-msg--user .tg-msg__time {
    color: rgba(0, 128, 0, 0.6);
}

/* Checkmarks */
.tg-mockup--light .tg-msg__checks {
    color: #4fae4e;
}

.tg-mockup--light .tg-msg--user .tg-msg__checks {
    color: #4fae4e;
}

/* Voice message */
.tg-mockup--light .tg-msg__voice-play {
    background: #4fae4e;
}

.tg-mockup--light .tg-msg--bot .tg-msg__voice-play {
    background: #8774e1;
}

.tg-mockup--light .tg-msg__voice-bar {
    background: rgba(0, 0, 0, 0.3);
}

.tg-mockup--light .tg-msg__voice-duration {
    color: rgba(0, 0, 0, 0.5);
}

.tg-mockup--light .tg-msg__voice-dot--white {
    color: #4fae4e;
}

.tg-mockup--light .tg-msg__voice-dot--red {
    color: #e53935;
}

.tg-mockup--light .tg-msg__voice-transcript {
    color: #000000;
}

/* Collapse icon in light theme */
.tg-mockup--light .tg-msg__voice-collapse-icon {
    background: rgba(78, 174, 78, 0.15);
}

.tg-mockup--light .tg-msg__voice-collapse-icon:hover {
    background: rgba(78, 174, 78, 0.25);
}

.tg-mockup--light .tg-msg__voice-collapse-icon svg {
    stroke: #4fae4e; /* Green like in user messages */
}

.tg-mockup--light .tg-msg--bot .tg-msg__voice-collapse-icon {
    background: rgba(135, 116, 225, 0.15);
}

.tg-mockup--light .tg-msg--bot .tg-msg__voice-collapse-icon:hover {
    background: rgba(135, 116, 225, 0.25);
}

.tg-mockup--light .tg-msg--bot .tg-msg__voice-collapse-icon svg {
    stroke: #8774e1; /* Purple for bot messages */
}

/* Voice waveform bars color for user messages */
.tg-mockup--light .tg-msg--user .tg-msg__voice-bar {
    background: rgba(78, 174, 78, 0.6); /* Green bars */
}

/* Input area */
.tg-mockup--light .tg-mockup__input {
    background: #ffffff;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.tg-mockup--light .tg-mockup__input-field {
    color: #000000;
}

.tg-mockup--light .tg-mockup__input-field::placeholder {
    color: rgba(0, 0, 0, 0.4);
}

.tg-mockup--light .tg-mockup__input-btn {
    color: #9e9e9e;
}

.tg-mockup--light .tg-mockup__input-btn:hover {
    color: #666666;
}

.tg-mockup--light .tg-mockup__input-btn--mic {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.tg-mockup--light .tg-mockup__input-btn--mic:hover {
    background: #f5f5f5;
}

/* Play overlay - светлая тема */
.tg-mockup--light .tg-mockup__play-overlay {
    background: rgba(255, 255, 255, 0.35); /* Уменьшено затенение */
}

.tg-mockup--light .tg-mockup__play-overlay:hover {
    background: rgba(255, 255, 255, 0.25);
}

.tg-mockup--light .tg-mockup__play-btn {
    background: linear-gradient(135deg, #D4A853 0%, #F4D03F 50%, #E8C97A 100%);
    box-shadow: 0 4px 20px rgba(212, 168, 83, 0.4);
}

.tg-mockup--light .tg-mockup__play-btn svg {
    fill: #fff;
    transform: translateX(1px);
}

/* List bullets */
.tg-mockup--light .tg-msg__list li::before {
    color: #4fae4e;
}

.tg-mockup--light .tg-msg--bot .tg-msg__list li::before {
    color: #8774e1;
}

/* Date separator */
.tg-mockup--light .tg-msg__date {
    color: rgba(0, 0, 0, 0.4);
}

/* ============================================
   INLINE BUTTONS (Telegram-style)
   Attached block below the message bubble
   ============================================ */

/* Message with buttons - match bottom border-radius to buttons so backgrounds align perfectly */
/* This is the clean CSS solution: no masks needed, just matching radii */
.tg-msg:has(.tg-msg__buttons) {
    /* Bot message: buttons have border-radius 0 0 12px 4px, so message should match */
    border-bottom-left-radius: 4px !important;
    border-bottom-right-radius: 12px !important;
    padding-bottom: 0 !important;
}

/* User message with buttons - opposite corners */
.tg-msg--user:has(.tg-msg__buttons) {
    /* User buttons have border-radius 0 0 4px 12px */
    border-bottom-left-radius: 12px !important;
    border-bottom-right-radius: 4px !important;
}

/* Button row container */
.tg-msg__buttons {
    display: flex;
    margin: 4px -8px 0 -8px; /* Match message padding horizontally */
    background: rgba(135, 116, 225, 0.15);
    border-radius: 0 0 12px 4px; /* Bot message corners: right 12px, left 4px */
    border-top: 1px solid rgba(135, 116, 225, 0.3); /* Horizontal separator from message text */
    overflow: hidden;
    position: relative;
}

/* User message buttons - opposite corners */
.tg-msg--user .tg-msg__buttons {
    border-radius: 0 0 4px 12px; /* User: right 4px, left 12px */
}

/* Individual button */
.tg-msg__button {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 8px 8px;
    background: transparent;
    border: none;
    color: #8774e1;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: background 0.15s ease;
    font-family: inherit;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Vertical divider between buttons */
.tg-msg__button + .tg-msg__button {
    border-left: 1px solid rgba(135, 116, 225, 0.3);
}

.tg-msg__button:hover {
    background: rgba(135, 116, 225, 0.15);
}

/* No primary distinction - all buttons equal in Telegram style */
.tg-msg__button--primary {
    /* Same as regular button */
}

/* User message buttons (green theme) */
.tg-msg--user .tg-msg__buttons {
    background: rgba(255, 255, 255, 0.2);
    border-top-color: rgba(255, 255, 255, 0.3);
}

.tg-msg--user .tg-msg__button {
    color: #fff;
}

.tg-msg--user .tg-msg__button + .tg-msg__button {
    border-left-color: rgba(255, 255, 255, 0.3);
}

.tg-msg--user .tg-msg__button:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Light theme buttons */
.tg-mockup--light .tg-msg__buttons {
    background: rgba(135, 116, 225, 0.12);
    border-top-color: rgba(135, 116, 225, 0.2);
}

.tg-mockup--light .tg-msg__button {
    color: #6b5cb8;
}

.tg-mockup--light .tg-msg__button + .tg-msg__button {
    border-left-color: rgba(135, 116, 225, 0.2);
}

.tg-mockup--light .tg-msg--user .tg-msg__buttons {
    background: rgba(76, 175, 80, 0.15);
    border-top-color: rgba(76, 175, 80, 0.3);
}

.tg-mockup--light .tg-msg--user .tg-msg__button {
    color: #2e7d32;
}

.tg-mockup--light .tg-msg--user .tg-msg__button + .tg-msg__button {
    border-left-color: rgba(76, 175, 80, 0.3);
}
