* {
    box-sizing: border-box;
  }
  
  html, body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    height: 100%;
    display: flex;
    flex-direction: column;
    background-color: #9cadb1;
    background-size: contain;
    overscroll-behavior: none;
  }
  
  #avatar-container {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 0;
    width: auto;
    height: 100%;
  }
  
  #avatar-idle,
  #avatar-speaking {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    transition: opacity 0.5s ease;
  }
  
  #avatar-idle {
    opacity: 1;
  }
  
  #avatar-speaking {
    opacity: 0;
  }
  
  #input-label-container {
    display: flex; 
    align-items: center;
  }
  
  #input-container label {
    font-size: 14px;
    margin-right: 10px;
    color: rgb(228, 228, 228);
  }
  
  #voice-toggle {
    accent-color: rgb(108, 108, 108);
  }
  
  #chat-container {
    position: relative;
    z-index: 2;
    flex: 1;
    display: flex;
    flex-direction: column-reverse;
    overflow-y: auto;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.35) 20%, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0) 80%);
    width: 100%;
    margin: 0 auto;
    padding: 100px; 
    border-top: 1px solid #ccc;
    border-bottom: 1px solid #ccc;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    -webkit-mask-image: linear-gradient(to top, black 0%, black 25%, transparent 60%);
    mask-image: linear-gradient(to top, black 0%, black 25%, transparent 60%);
  }
  
  #chat-container::before {
    content: '';
    position: sticky;
    top: 0;
    height: 80px;
    z-index: 5;
  }
  
  #chat-container .dummy {
    flex-shrink: 0;
    height: 450px; 
  }
  
  .message {
    margin: 10px;
    padding: 10px 15px;
    white-space: pre-wrap;
    max-width: 80%;
    border-radius: 15px;
    font-size: 16px;
  }
  
  .message.user {
    background-color: rgba(56, 56, 56, 0.424);
    color: #e2e2e2;
    align-self: flex-end;
    text-align: left;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    line-height: 1.5;
  }
  
  .message.assistant {
    background-color: rgba(72, 88, 93, 0.327);
    color: #ffffff;
    align-self: flex-start;
    text-align: left;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    line-height: 1.5;
    white-space: normal;
  }
  
  #input-container {
    position: absolute;   
    bottom: 15px;         
    left: 0;              
    right: 0;             
    display: flex;
    padding: 10px;
    background: linear-gradient(to top, rgb(120, 120, 120) 30%, rgb(140, 140, 140) 100%);
    width: 100%;
    max-width: 600px;
    margin: 0px auto;
    border-top: 1px solid #afafaf;
    border-radius: 15px;
    z-index: 3;
  }
  
  #user-input {
    flex: 1;
    padding: 12px;
    font-size: 16px;
    border-radius: 6px 0 0 6px;
    border: 1px solid #969696;
    outline: none;
    background: rgb(210, 210, 210);
    z-index: 3;
    color: rgb(73, 73, 73);
  }
  
  #send-btn, #clear-btn {
    padding: 12px 16px;
    font-size: 16px;
    border: none;
    cursor: pointer;
  }
  
  #send-btn {
    background: #5f5f5f;
    color: white;
    border-radius: 0 6px 6px 0;
  }
  
  #send-btn:hover {
    background: #373737;
  }
  
  #clear-btn {
    margin-left: 5px;
    background: #aaa;
    color: white;
    border-radius: 6px;
  }
  
  #clear-btn:hover {
    background: #888;
  }
  
  code {
    background: #eee;
    padding: 2px 4px;
    border-radius: 4px;
    font-family: monospace;
  }
  
  pre {
    background: #eee;
    padding: 10px;
    border-radius: 6px;
    overflow-x: auto;
  }
  
  a {
    color: #005bbb;
    text-decoration: none;
  }
  
  a:hover {
    text-decoration: underline;
  }
  
  @media (max-width: 600px) {
    html, body {
      background-color: #8da4a8;
    }
  
    #input-container {
      max-width: 60vh;
    }
  
    #user-input, #send-btn, #clear-btn {
      font-size: 16px;
    }
  
    #chat-container {
      padding-top: 15px;
      padding-bottom: 85px;
      padding-left: 15px;
      padding-right: 15px;
      -webkit-mask-image: linear-gradient(to top, black 0%, black 0%, transparent 60%);
      mask-image: linear-gradient(to top, black 0%, black 0%, transparent 60%);
    }
  }
  