:root {
    --wa-header: #008069;
    --wa-bg: #efeae2;
    --wa-user-bg: #d9fdd3;
    --wa-bot-bg: #ffffff;
    --wa-shadow: rgba(0, 0, 0, 0.13);
    --wa-text-main: #111b21;
    --wa-text-meta: rgba(0,0,0,0.45);
  }



  /* --- Phone Mockup --- */
  .phone-mockup {
    width: 375px;
    height: 812px;
    background: #000;
    border-radius: 50px;
    padding: 12px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.4);
    position: relative;
    box-sizing: border-box;
    overflow: hidden;
  }

  .notch {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 30px;
    background: #000;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    z-index: 100;
  }

  .screen {
    width: 100%;
    height: 100%;
    background-color: var(--wa-bg);
    border-radius: 38px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    background-image: url('https://user-images.githubusercontent.com/15075759/28719144-86dc0f70-73b1-11e7-911d-60d70fcded21.png');
    background-size: 350px;
    background-repeat: repeat;
    background-blend-mode: soft-light;
  }

  /* --- Header (Text Title Layout) --- */
  .wa-header {
    background-color: var(--wa-header);
    color: white;
    padding: 45px 10px 10px 10px; /* Чуть меньше отступы по бокам */
    display: flex;
    align-items: center;
    /* justify-content не нужен, используем flex-grow для текста */
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    z-index: 10;
    direction: rtl; 
  }

  .nav-arrow { 
    font-size: 24px; 
    cursor: pointer; 
    flex-shrink: 0; /* Не сжимать стрелку */
    margin-left: 8px; /* Отступ от текста */
  }

  /* === ЗАГОЛОВОК (Вместо логотипа) === */
  .header-title {
    flex-grow: 1; /* Занимает всё свободное место */
    font-size: 17px; /* Стандартный размер заголовка App Bar */
    font-weight: 600; /* Semibold */
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Троеточие, если не влезает */
    text-align: right; /* Прижимаем к стрелке (RTL) */
    color: white;
  }

  .header-icons {
    display: flex;
    gap: 15px; /* Чуть плотнее иконки */
    margin-right: 10px;
    flex-shrink: 0;
  }
  .header-icons .material-icons { font-size: 22px; cursor: pointer; }

  /* --- Chat Body --- */
  .chat-body {
    flex: 1;
    padding: 20px 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scroll-behavior: smooth;
    direction: rtl;
  }

  .chat-body::-webkit-scrollbar { width: 4px; }
  .chat-body::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 4px; }

  /* Messages */
  .msg-row {
    display: flex;
    width: 100%;
    margin-bottom: 2px;
  }

  .msg-bubble {
    max-width: 80%;
    padding: 6px 10px 8px 10px;
    border-radius: 10px;
    font-size: 14.2px;
    line-height: 19px;
    position: relative;
    box-shadow: 0 1px 0.5px var(--wa-shadow);
    color: var(--wa-text-main);
    text-align: right;
    
    opacity: 0;
    transform: translateY(20px) scale(0.98);
    animation: msgAppear 0.4s cubic-bezier(0.2, 1, 0.2, 1) forwards;
  }

  @keyframes msgAppear {
    to { opacity: 1; transform: translateY(0) scale(1); }
  }

  /* USER Message Styling */
  .msg-row.user { justify-content: flex-end; }
  .msg-row.user .msg-bubble {
    background-color: var(--wa-user-bg);
    border-top-right-radius: 0;
    font-weight: 600; /* Semibold questions */
  }

  /* BOT Message Styling */
  .msg-row.bot { justify-content: flex-start; }
  .msg-row.bot .msg-bubble {
    background-color: var(--wa-bot-bg);
    border-top-left-radius: 0;
    font-weight: 400; 
  }

  .msg-time {
    font-size: 10px;
    color: var(--wa-text-meta);
    float: left;
    margin-top: 4px;
    margin-right: 8px;
    display: flex;
    align-items: center;
    font-weight: 400;
  }
  
  .check-icon { font-size: 14px; margin-right: 3px; color: #53bdeb; }

  /* Data List */
  .data-list {
    margin: 5px 0 0 0;
    padding: 0;
    list-style: none;
    text-align: right;
  }
  
  .data-list li {
    display: flex;
    justify-content: space-between;
    align-items: flex-start; 
    margin-bottom: 6px;
    border-bottom: 1px dashed rgba(0,0,0,0.08);
    padding-bottom: 4px;
    text-align: right;
  }
  .data-list li:last-child { border-bottom: none; }

  .label-text {
    font-weight: 600; 
    color: var(--wa-text-main);
    white-space: nowrap; 
    margin-left: 8px; 
    text-align: right;
  }

  .value-text {
    font-weight: 400;
    color: var(--wa-text-main);
    text-align: left;
    direction: ltr; 
  }
  
  .text-value-rtl {
    text-align: right; 
    direction: rtl;
    width: 100%;
  }

  .bold-header { font-weight: 700; display: block; margin-bottom: 4px; text-align: right; }

  /* Typing Indicator */
  .typing-indicator {
    padding: 10px 15px;
    background: #fff;
    border-radius: 18px;
    border-bottom-left-radius: 0;
    width: fit-content;
    display: none;
    margin-bottom: 10px;
    box-shadow: 0 1px 0.5px var(--wa-shadow);
    align-self: flex-start;
  }
  
  .typing-dots { display: flex; gap: 4px; }
  .dot {
    width: 6px;
    height: 6px;
    background: #b6b5ba;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
  }
  .dot:nth-child(1) { animation-delay: -0.32s; }
  .dot:nth-child(2) { animation-delay: -0.16s; }
  
  @keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
  }

  /* Footer */
  .wa-footer {
    background-color: #f0f2f5;
    padding: 8px 10px 25px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 20;
    direction: rtl;
  }
  
  .footer-icon { color: #8696a0; font-size: 26px; cursor: pointer; }
  
  .input-field {
    flex: 1;
    background: #fff;
    border-radius: 20px;
    height: 40px;
    display: flex;
    align-items: center;
    padding: 0 15px;
    font-size: 15px;
    color: #54656f;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.05);
    text-align: right;
  }

  .mic-circle {
    width: 45px;
    height: 45px;
    background-color: var(--wa-header);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  }