    .app {
      width: 100%;
      max-width: 480px;
      margin: 0 auto;
      height: calc(var(--vh) * 100);
      background: #ffffff;
      display: flex;
      flex-direction: column;
    }

    .app-header {
      padding: 12px 16px;
      text-align: center;
      border-bottom: 1px solid #eee;
      background: #ffffff;
    }

    .app-header-title {
      font-weight: 600;
      font-size: 16px;
      margin-bottom: 2px;
    }

    .app-header-subtitle {
      font-size: 13px;
      color: #777;
    }

    .app-chat {
      flex: 1 1 auto;
      min-height: 0;
      padding: 12px 16px;
      overflow-y: auto;
      display: flex;
      flex-direction: column;
      gap: 6px;
      background: #ffffff;
    }

    .app-bubble {
      display: inline-block;
      max-width: 80%;
      padding: 8px 13px;
      border-radius: 18px;
      font-size: 14px;
      line-height: 1.4;
      opacity: 0;
      transform: translateY(8px);
      animation: fadeInUp 0.25s forwards;
    }

    .app-bubble.left {
      align-self: flex-start;
      background: #f1f1f5;
      border-bottom-left-radius: 4px;
    }

    .app-bubble.right {
      align-self: flex-end;
      background: #f3e6ff;
      border-bottom-right-radius: 4px;
    }

    @keyframes fadeInUp {
      to { opacity: 1; transform: translateY(0); }
    }

    .app-footer {
      padding: 10px 16px 16px;
      border-top: 1px solid #eee;
      background: #ffffff;
    }

    .app-btn {
      width: 100%;
      border: none;
      border-radius: 999px;
      padding: 12px 16px;
      font-size: 15px;
      font-weight: 600;
      background: #ff4b79;
      color: #ffffff;
      cursor: pointer;
    }

    .app-btn:active { transform: scale(0.97); }

    .app-answer-form {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .app-answer-input {
      flex: 1;
      padding: 9px 13px;
      border-radius: 999px;
      border: 1px solid #ddd;
      font-size: 16px;
      outline: none;
    }

    .app-answer-input:focus { border-color: #ff4b79; }

    .app-answer-form .btn {
      flex: 0 0 80px;
      padding-inline: 8px;
      font-size: 14px;
    }
    
    .message-wrapper {
        display: flex;
        align-items: flex-start;
        gap: 8px;
        align-self: flex-start;
        max-width: 100%;
    }

    .avatar {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        background: #ccc;
        color: #fff;
        font-weight: 600;
        font-size: 14px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        overflow: hidden;
    }
    .avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    
/* Приветствие на маршруте */

/* Основной экран */
    .screen {
      position: relative;
      min-height: 100vh;
      padding:
        calc(env(safe-area-inset-top, 0px) + 16px)
        16px
        calc(env(safe-area-inset-bottom, 0px) + 96px) /* место под кнопку */
        16px;
    }

    /* Персонаж */
    .mascot {
      position: absolute;
      left: -18px;
      top: 44%;
      transform: translateY(-50%);
      width: min(240px, 40vw);
      pointer-events: none;
    }

    /* Бабл */
    .bubble {
      position: absolute;
      left: 44%;
      top: 44%;
      transform: translateY(-50%);
      max-width: min(270px, 50vw);
      background: #ffffff;
      border: 2px solid #e2e2e2;
      border-radius: 16px;
      padding: 18px;
      font-size: 14px;
      line-height: 1.35;
      color: #4a4a4a;
    }

    .bubble::before {
      content: "";
      position: absolute;
      left: -12px;
      top: 32%;
      width: 18px;
      height: 18px;
      background: #ffffff;
      border-left: 2px solid #e2e2e2;
      border-bottom: 2px solid #e2e2e2;
      transform: rotate(45deg);
    }

    /* Кнопка — ВАЖНО */
    .button-wrapper {
      position: fixed;
      left: 16px;
      right: 16px;
      bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
    }

    .btn {
      width: 100%;
      border: none;
      border-radius: 999px;
      padding: 12px 16px;
      font-size: 15px;
      font-weight: 600;
      background: #ff4b79;
      color: #ffffff;
      cursor: pointer;
    }

    .btn:active {
      opacity: 0.9;
    }
    
    /* Картинка внутри бабла */
    .app-img-bubble img.bubble-img {
        display: block;
        max-width: 100%;
        height: auto;
        border-radius: 14px;
        margin-top: 8px;
        cursor: zoom-in;
    }

    /* Оверлей для увеличения картинки */
    .img-modal {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.72);
        display: none;
        align-items: center;
        justify-content: center;
        padding: 18px;
        z-index: 9999;
    }

    .img-modal.open { display: flex; }

    .img-modal img {
        max-width: min(92vw, 520px);
        max-height: 86vh;
        width: auto;
        height: auto;
        border-radius: 16px;
        cursor: zoom-out;
    }

    .img-modal-close {
        position: fixed;
        top: 12px;
        right: 12px;
        width: 42px;
        height: 42px;
        border: none;
        border-radius: 999px;
        background: rgba(255,255,255,0.18);
        color: #fff;
        font-size: 22px;
        line-height: 42px;
        cursor: pointer;
    }
  