  html, body {
    margin: 0;
    padding: 0;
    height: 100svh;       /* Use viewport height */
    width: 100vw;        /* Use viewport width */
    font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: white;
    display: flex;
    overflow: hidden;
}

#sidebar {
    width: 220px;
    flex-shrink: 0;
    background: #f7f7f8;
    color: black;
    display: flex;
    flex-direction: column;
    padding: 16px;
    border-right: 1px solid #e0e0e0;
    transition: transform 0.3s ease;
}

#sidebar button {
    background: none;
    border: none;
    color: black;
    padding: 8px 0;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

#sidebar button:hover {
    text-decoration: underline;
}

#sidebarClose {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 32px;       /* bigger X */
    font-weight: bold;
    color: #666;           /* lighter black */
    background: none;
    border: none;
    cursor: pointer;
    line-height: 1;
    text-decoration: none !important; /* force no underline */
    outline: none !important;         /* force no focus outline */
    padding: 0;                        /* remove default padding */
    font-family: inherit;              /* ensure it inherits your site font */
}

#chat-wrapper {
    flex: 1 1 0;         /* Grow to fill remaining space */
    min-width: 0;        /* Fixes flexbox collapse issue */
    height: 100%;        /* Full height */
    display: flex;
    flex-direction: column;
}

#chat-header {
    background-color: white;
    color: black;
    font-weight: bold;
    font-size: 18px;

    /* 👇 this is the important bit */
    padding-top: calc(12px + env(safe-area-inset-top, 0px));
    padding-left: 24px;
    padding-right: 24px;
    padding-bottom: 12px;

    text-align: left;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#header-left {
    display: flex;
    align-items: center;
}

#sidebarToggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
}

#logo {
    margin-left: 8px;
    font-weight: bold;
    font-size: 18px;
}

#chat-container {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    padding: 24px;
    background: white;
    overflow-y: auto;
    box-sizing: border-box;
}

.message {
    padding: 12px 16px;
    margin-bottom: 12px;
    border-radius: 12px;
    max-width: 90%;
    line-height: 1.5;
    word-wrap: break-word;
}

.user {
    background: #e8e8e8;
    margin-left: auto;
    text-align: right;
}

.bot {
    background: #f1f1f1;
    margin-right: auto;
    text-align: left;
}

#input-area {
    display: flex;
    gap: 8px;
    padding: 12px 24px;
    background: #f7f7f8;
    flex-shrink: 0;
}

#userInput {
    width: 100%;
    height: 40px;
    max-height: 40px;
    min-height: 40px;
    padding: 12px;
    font-size: 16px;
    border-radius: 8px;
    border: 1px solid #ccc;
    box-sizing: border-box;
    overflow-y: hidden;
    outline: none;
}

#sendBtn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    background: #4caf50;
    color: white;
    font-weight: bold;
    cursor: pointer;
}

#sendBtn:hover {
    background: #45a049;
}

/* Mobile-friendly adjustments */
@media (max-width: 768px) {
  #sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 220px;
    transform: translateX(-100%); /* hidden by default */
    z-index: 1000;
    transition: transform 0.3s ease;
}

#sidebar.open {
    transform: translateX(0); /* visible when toggled */
  }

  #sidebarToggle {
    display: block; /* ensure button is always visible */
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
  }

  #header-left {
    display: flex;
    align-items: center;
  }

  #logo {
    margin-left: 8px; /* logo immediately to the right */
  }
}

  #sidebarToggle {
    display: block;
  }

  #chat-wrapper {
    flex: 1;
    width: 100%;
  }

  #chat-container {
    padding: 16px;
  }

  #input-area {
    padding: 8px 16px;
    flex-direction: column;
  }

  #userInput {
    width: 100%;
    margin-bottom: 8px;
  }

  #sendBtn {
    width: 100%;
  }
  #empty-state {
    margin: auto;                /* centers vertically & horizontally */
    text-align: center;
    max-width: 600px;
    color: #444;
}

#empty-state h1 {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 12px;
}

#empty-state p {
    font-size: 16px;
    color: #666;
}

}
