html, body {
    height: 100%;
    margin: 0;
    background: #f0f1f3;
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
}

.main-app {
    display: flex;
    height: 100vh;
    width: 100vw;
}

.sidebar {
    width: 230px;
    background: #fff;
    display: flex;
    flex-direction: column;
    padding: 0;
    transition: width 0.24s cubic-bezier(0.65,0,.35,1);
    box-shadow: 1px 0 10px rgba(40,60,75,0.07);
    position: relative;
    z-index: 2;
}

.sidebar.collapsed {
    width: 59px;
}
.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.6em;
    padding: 15px 8px;
    cursor: pointer;
    color: #3652f3;
}
.sidebar-icons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    margin: 42px 0 0 0;
}
.sidebar.collapsed .sidebar-content {
    display: none;
}
.sidebar:not(.collapsed) .sidebar-content {
    display: block;
}
.icon-btn {
    font-size: 1.7em;
    padding: 7px;
    cursor: pointer;
    color: #234E52;
    opacity: 0.95;
    transition: background 0.18s;
    border-radius: 8px;
}
.icon-btn:hover {
    background: #ecf3ff;
}

.sidebar-header {
    font-size: 1.23em;
    font-weight: bold;
    letter-spacing: 0.04em;
    padding: 1.2em 1.2em .7em 1.2em;
    color: #2f3542;
    border-bottom: 1px solid #ececec;
}
.auth-section {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin: 1.1em 0;
}
.btn-auth {
    padding: 8px 18px;
    border: none;
    border-radius: 7px;
    background: #2e6cff;
    color: #fff;
    font-size: 15.5px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 3px;
    transition: background 0.18s;
}
.btn-auth:hover {
    background: #1450dd;
}
.history-header {
    font-size: 1.05em;
    font-weight: 600;
    color: #223161;
    margin: 11px 0 9px 0;
}
.history-list {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1 1 auto;
    overflow-y: auto;
}
.history-item {
    background: #f5f6fa;
    color: #385274;
    padding: 9px 12px;
    border-radius: 7px;
    margin-bottom: 6px;
    cursor: pointer;
    font-size: 0.98em;
    transition: background 0.16s;
}
.history-item:hover {
    background: #dde3f7;
}

/* Chat area, moves left if sidebar expanded */
.chat-area {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    height: 100vh;
    transition: margin-left 0.24s cubic-bezier(0.65,0,.35,1);
}
.chat-area.sidebar-open {
    margin-left: 171px; /* shift chat to left by sidebar difference */
}
.chat-window {
    flex: 1 1 auto;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    padding: 38px 5vw 0 5vw;
    background: #eceffc;
    border: none;
}
.message {
    max-width: 63%;
    margin-bottom: 16px;
    padding: 12px 18px;
    border-radius: 18px 18px 18px 7px;
    background: #fff;
    color: #274161;
    word-break: break-word;
    font-size: 1.07em;
    line-height: 1.65;
    box-shadow: 0 2px 6px rgba(40,60,75,0.055);
    transition: background 0.18s;
}
.model-message {
    background: #7c7878;
    color: #f6f6f7;
    margin-left: 0;
    margin-right: auto;
    border-radius: 0px 0px 70px 0px;
}
.user-message {
    background: #f6f6f7;
    color: #000000;
    margin-left: auto;
    margin-right: 0;
    border-radius: 0px 0px 0px 70px;
}

.message h1, .message h2, .message h3, .message h4, .message h5 {
    font-weight: 700;
    margin: 0 0 7px 0;
    color: #0dda8b;
}
.message strong, .message b {
    font-weight: 600;
    color: #0dda8b;
}
.message ul, .message ol {
    margin-left: 24px;
    margin-bottom: 8px;
}
.message li {
    margin-bottom: 7px;
}
.message p {
    margin-bottom: 7px;
}

.chat-input-bar {
    position: sticky;
    bottom: 0;
    left: 0;
    background: #fff;
    border-top: 1px solid #ececec;
    padding: 14px 5vw 13px 5vw;
    width: 100%;
    display: flex;
    flex-direction: column;
    z-index: 10;
    box-sizing: border-box;
}
#promptInput {
    width: 100%;
    min-height: 4px;
    font-size: 1.11em;
    border-radius: 13px;
    border: 1px solid #d2d7e2;
    padding: 1px 1px;
    margin-bottom: 8px;
    resize: vertical;
    font-family: inherit;
    background: #fafbfd;
    box-sizing: border-box;
}
.input-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 3px;
}
#fileInput {
    font-size: 1em;
    padding: 1px 6px;
    background: none;
    border: none;
}
#submitButton {
    background: #000000;
    color: #fff;
    border: none;
    border-radius: 11px;
    padding: 11px 23px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    margin-left: 7px;
    transition: background 0.2s;
}
#submitButton:hover {
    background: #1450dd;
}
.status-text {
    font-size: 1em;
    color: #5c5c6c;
    margin-top: 2px;
    margin-bottom: 0;
    display: block;
}


.suggestion-container {
    display: flex;
    flex-wrap: wrap;
    gap: 100px;
    margin-bottom: 16px;
    margin-top: 8px;
    align-items: center;
}

.suggestion-button {
    background: #eef2fb;
    color: #3975ff;
    border: none;
    border-radius: 15px;
    padding: 8px 22px;
    font-size: 1em;
    cursor: pointer;
    font-weight: 500;
    box-shadow: 0 1px 4px 0 rgba(46,108,255,0.05);
    transition: background 0.15s, color 0.15s, box-shadow 0.17s;
    outline: none;
}

.suggestion-button:hover, .suggestion-button:focus {
    background: #dde3f7;
    color: #077e39;
    box-shadow: 0 1px 8px 0 rgba(46,108,255,0.09);
}

@media (max-width: 650px) {
    html, body {
        padding: 0;
        margin: 0;
        min-width: 0;
        background: #f7f8fa;
    }
    .main-app {
        flex-direction: column;
        width: 100vw;
        min-width: 0;
        padding: 0;
        box-sizing: border-box;
        align-items: stretch;
    }
    .sidebar {
        width: 100vw !important;
        min-width: 0;
        max-width: 100vw !important;
        border-radius: 0;
        box-shadow: none;
        position: relative;
        z-index: 2;
        margin: 0;
        padding: 0;
    }
    .sidebar-content, .auth-section,
    .history-list, .history-header,
    .sidebar-header {
        width: 100vw;
        box-sizing: border-box;
        padding: 10px 0 0 0;
        margin: 0;
    }
    .btn-auth {
        width: 95vw;
        margin: 7px 2vw 7px 2vw;
        font-size: 1em;
        padding: 11px 5px;
        box-sizing: border-box;
    }
    .history-item {
        width: 95vw;
        font-size: 1em;
        margin: 5px 2vw 5px 2vw;
        padding: 10px 8px;
        box-sizing: border-box;
    }
    .chat-area {
        width: 100vw;
        min-width: 0;
        left: 0;
        padding: 0;
    }
    .suggestion-container {
        flex-direction: column;
        gap: 9px;
        width: 97vw;
        box-sizing: border-box;
        align-items: stretch;
        margin: 11px 2vw;
    }
    .suggestion-button {
        width: 100%;
        min-width: 0;
        font-size: 1.07em;
        padding: 10px 0;
        border-radius: 11px;
        margin-bottom: 0;
        box-sizing: border-box;
    }
    .chat-window {
        width: 100vw;
        padding: 10px 2vw 0 2vw;
        box-sizing: border-box;
        min-width: 0;
    }
    .message {
        width: 97vw;
        max-width: 97vw;
        padding: 10px 11px;
        font-size: 1.06em;
        margin-left: 0 !important;
        margin-right: 0 !important;
        border-radius: 13px;
        box-sizing: border-box;
    }
    .chat-input-bar {
        width: 100vw;
        padding: 14px 2vw 13px 2vw;
        box-sizing: border-box;
    }
    #promptInput {
        width: 100vw;
        min-width: 0;
        font-size: 1em;
        padding: 10px 8px;
        margin-bottom: 8px;
        box-sizing: border-box;
    }
    #fileInput, #submitButton {
        font-size: 1em;
        padding: 10px 8px;
        width: auto;
        margin: 0;
        box-sizing: border-box;
    }
}

.mobile-sidebar-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 13px;
    z-index: 2500;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 5px;
    border-radius: 7px;
    box-shadow: 0 2px 10px rgba(50,80,200,0.09);
}
.mobile-sidebar-toggle svg {
    display: block;
}

/* Show only on small screens */
@media (max-width: 600px) {
    .mobile-sidebar-toggle {
        display: block;
    }
    .sidebar {
        display: none;
        position: fixed;
        background: #fff;
        top: 0;
        left: 0;
        height: 100vh;
        width: 91vw;
        z-index: 3000;
        box-shadow: 4px 0 28px 3px rgba(40,60,100,0.09);
        transition: transform 0.22s cubic-bezier(.73,0,.29,1);
        border-radius: 0 15px 15px 0;
        overflow-y: auto;
    }
    .sidebar.active {
        display: block;
        transform: translateX(0%);
    }
    /* When sidebar visible, main area is dimmed slightly */
    body.sidebar-open::after {
        content: "";
        display: block;
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0,12,38,0.14);
        z-index: 2999;
        pointer-events: all;
    }
}

.sidebar-mobile-close-x {
    display: none;
    position: absolute;
    right: 17px;
    top: 17px;
    font-size: 2.2em;
    color: #2843c6;
    font-weight: bold;
    background: #f7f9ff;
    border-radius: 7px;
    padding: 2px 12px 2px 12px;
    z-index: 3022;
    cursor: pointer;
    box-shadow: 0 1px 8px #b9beea12;
    transition: background 0.13s;
}
.sidebar-mobile-close-x:hover {
    background: #eeeefc;
}
@media (max-width: 600px){
  .sidebar-mobile-close-x { display: block; }
}

.suggestion-marquee-container {
  width: 100vw;
  overflow: hidden;
  margin-bottom: 8px;
  margin-top: 6px;
  position: relative;
  background: transparent;
  height: 44px;
}

.suggestion-marquee-track {
  display: flex;
  gap: 10px;
  align-items: center;
  animation: marquee-scroll 17s linear infinite;
}

.suggestion-button {
  background: #eef2fb;
  color: #2843c6;
  border: none;
  border-radius: 13px;
  padding: 8px 19px;
  font-size: 1em;
  cursor: pointer;
  font-weight: 500;
  box-shadow: 0 1px 4px 0 rgba(46,108,255,0.06);
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
  outline: none;
  margin: 0 5px 0 0;
  white-space: nowrap;
}

@keyframes marquee-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-55%); }
}

/* Only show marquee on small screens */
@media (max-width: 600px){
  .suggestion-container { display: none; }
  .suggestion-marquee-container { display: block; }
}
@media (min-width: 601px){
  .suggestion-marquee-container { display: none; }
}

.auth-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0; top: 0; width: 100vw; height: 100vh;
  overflow: auto;
  background: rgba(32,48,76,0.18);
  justify-content: center;
  align-items: center;
}
.auth-modal-content {
  background: #fff;
  margin: 8vw auto;
  border-radius: 15px;
  box-shadow: 0 2px 24px #00319b22;
  width: 95vw; max-width: 370px;
  padding: 28px 27px 24px 27px;
  position: relative;
}
.auth-modal-close {
  position: absolute;
  right: 16px; top: 11px;
  font-size: 2.1em; font-weight: bold;
  color: #2e6cff;
  cursor: pointer;
  border-radius: 13px;
  padding: 1px 11px;
  transition: background 0.16s;
  z-index: 10;
}
.auth-modal-close:hover {
  background: #d6e1fa;
}
@media (max-width: 600px){
  .auth-modal-content { padding: 10vw 5vw;}
}
