* {
    box-sizing: border-box;
    margin: 0;
    padding: 0
}

:root {
    --blue: #2563eb;
    --blue2: #4f46e5;
    --bg: #f5f7fb;
    --card: #fff;
    --text: #111827;
    --muted: #6b7280;
    --border: #e5e7eb;
    --sidebar: #fff
}

body.dark {
    --bg: #090d16;
    --card: #111827;
    --text: #f9fafb;
    --muted: #9ca3af;
    --border: #1f2937;
    --sidebar: #0d1320
}

html,
body {
    width: 100%;
    height: 100%
}

body {
    font-family: Inter, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow: hidden
}

button,
textarea {
    font-family: inherit
}

button {
    cursor: pointer
}

.app {
    width: 100%;
    height: 100vh;
    display: flex
}

.sidebar {
    width: 290px;
    background: var(--sidebar);
    border-right: 1px solid var(--border);
    padding: 22px 16px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 4px 8px 24px
}

.gidi-logo {
    width: 45px;
    height: 45px;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 23px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--blue), var(--blue2));
    box-shadow: 0 8px 25px rgba(37, 99, 235, .25)
}

.brand h1 {
    font-size: 20px
}

.brand span {
    font-size: 11px;
    color: var(--muted)
}

.new-chat {
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(37, 99, 235, .25);
    border-radius: 11px;
    background: rgba(37, 99, 235, .08);
    color: var(--blue);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-bottom: 25px
}

.new-chat span {
    font-size: 20px
}

.side-title {
    color: var(--muted);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.2px;
    padding: 0 8px 9px
}

.functions {
    display: flex;
    flex-direction: column;
    gap: 4px
}

.function {
    border: none;
    background: transparent;
    color: var(--text);
    width: 100%;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px;
    border-radius: 11px;
    text-align: left
}

.function:hover {
    background: rgba(100, 116, 139, .08)
}

.function.active {
    background: rgba(37, 99, 235, .1);
    color: var(--blue)
}

.function-icon {
    font-size: 19px
}

.function strong {
    display: block;
    font-size: 12px
}

.function small {
    display: block;
    color: var(--muted);
    font-size: 9px;
    margin-top: 3px
}

.sidebar-history {
    margin-top: 25px;
    flex: 1;
    overflow-y: auto
}

.history-item {
    border: none;
    width: 100%;
    background: transparent;
    color: var(--text);
    text-align: left;
    padding: 8px;
    border-radius: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 11px
}

.history-item:hover {
    background: rgba(100, 116, 139, .08)
}

.sidebar-bottom {
    border-top: 1px solid var(--border);
    padding-top: 12px
}

.sidebar-bottom button {
    border: none;
    background: transparent;
    color: var(--muted);
    width: 100%;
    text-align: left;
    padding: 8px;
    font-size: 11px
}

.sidebar-bottom button:hover {
    color: var(--text)
}

.sidebar-bottom p {
    color: var(--muted);
    font-size: 9px;
    text-align: center;
    margin-top: 10px
}

.main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column
}

.topbar {
    height: 68px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 25px
}

.top-info {
    display: flex;
    align-items: center;
    gap: 10px
}

.mini-logo {
    width: 35px;
    height: 35px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--blue), var(--blue2));
    color: #fff;
    font-weight: 900
}

.top-info strong {
    display: block;
    font-size: 14px
}

.top-info small {
    color: var(--muted);
    font-size: 10px
}

.top-actions button {
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 19px
}

.mobile-menu {
    display: none;
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 20px
}

.chat-area {
    flex: 1;
    overflow-y: auto;
    padding: 35px
}

.welcome {
    max-width: 700px;
    margin: 30px auto;
    text-align: center
}

.welcome-logo {
    width: 75px;
    height: 75px;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 22px;
    color: #fff;
    font-size: 36px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--blue), var(--blue2));
    box-shadow: 0 15px 40px rgba(37, 99, 235, .22)
}

.welcome h2 {
    margin-top: 20px;
    font-size: 29px
}

.welcome h2 span {
    color: var(--blue)
}

.welcome>p {
    color: var(--muted);
    margin-top: 8px;
    font-size: 13px
}

.quick-actions {
    margin-top: 30px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px
}

.quick-actions button {
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    border-radius: 13px;
    padding: 15px;
    text-align: left;
    display: flex;
    gap: 11px;
    align-items: center
}

.quick-actions button:hover {
    border-color: var(--blue);
    transform: translateY(-1px)
}

.quick-actions b {
    font-size: 20px
}

.quick-actions strong {
    display: block;
    font-size: 11px
}

.quick-actions small {
    display: block;
    color: var(--muted);
    margin-top: 3px;
    font-size: 9px
}

.messages {
    max-width: 850px;
    margin: auto
}

.message {
    display: flex;
    margin-bottom: 18px
}

.message.user {
    justify-content: flex-end
}

.message.ai {
    justify-content: flex-start
}

.bubble {
    max-width: 78%;
    padding: 13px 15px;
    border-radius: 15px;
    font-size: 13px;
    line-height: 1.65;
    white-space: pre-wrap
}

.user .bubble {
    color: #fff;
    background: linear-gradient(135deg, var(--blue), var(--blue2));
    border-bottom-right-radius: 4px
}

.ai .bubble {
    background: var(--card);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px
}

.code-block {
    margin-top: 10px;
    border-radius: 10px;
    overflow: hidden;
    background: #0b1020;
    color: #e5e7eb
}

.code-header {
    padding: 7px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #151c2e;
    font-size: 9px;
    color: #9ca3af
}

.copy-code {
    border: none;
    background: transparent;
    color: #cbd5e1;
    font-size: 10px
}

.code-content {
    padding: 12px;
    overflow-x: auto;
    font-family: "Courier New", monospace;
    font-size: 11px;
    white-space: pre
}

.typing {
    display: flex;
    gap: 4px;
    align-items: center
}

.typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--muted);
    animation: typing 1s infinite
}

.typing span:nth-child(2) {
    animation-delay: .15s
}

.typing span:nth-child(3) {
    animation-delay: .3s
}

@keyframes typing {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: .4
    }

    30% {
        transform: translateY(-4px);
        opacity: 1
    }
}

.composer {
    background: var(--card);
    border-top: 1px solid var(--border);
    padding: 12px 25px 14px
}

.composer-box {
    max-width: 850px;
    margin: auto;
    border: 1px solid var(--border);
    border-radius: 15px;
    padding: 7px 8px;
    display: flex;
    align-items: flex-end;
    gap: 7px;
    background: var(--bg)
}

.tool-button,
.send-button {
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 10px
}

.tool-button {
    background: transparent;
    font-size: 18px
}

.send-button {
    background: linear-gradient(135deg, var(--blue), var(--blue2));
    color: #fff;
    font-size: 18px
}

#messageInput {
    flex: 1;
    border: none;
    outline: none;
    resize: none;
    background: transparent;
    color: var(--text);
    font-size: 13px;
    padding: 10px 4px;
    max-height: 130px
}

.composer-info {
    max-width: 850px;
    margin: 6px auto 0;
    text-align: center;
    color: var(--muted);
    font-size: 8px
}

.mobile-nav {
    display: none
}

@media(max-width:750px) {
    body {
        padding-bottom: 62px
    }

    .sidebar {
        position: fixed;
        left: -300px;
        top: 0;
        bottom: 0;
        z-index: 50;
        transition: .25s
    }

    .sidebar.open {
        left: 0
    }

    .mobile-menu {
        display: block
    }

    .topbar {
        height: 62px;
        padding: 0 15px
    }

    .chat-area {
        padding: 20px 12px 10px
    }

    .welcome {
        margin-top: 20px
    }

    .welcome h2 {
        font-size: 23px
    }

    .welcome-logo {
        width: 62px;
        height: 62px;
        font-size: 30px
    }

    .quick-actions {
        grid-template-columns: 1fr
    }

    .bubble {
        max-width: 90%
    }

    .composer {
        padding: 8px 10px
    }

    .mobile-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 62px;
        background: var(--card);
        border-top: 1px solid var(--border);
        z-index: 40;
        display: flex;
        justify-content: space-around
    }

    .mobile-nav-item {
        flex: 1;
        border: none;
        background: transparent;
        color: var(--muted);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px
    }

    .mobile-nav-item span {
        font-size: 17px
    }

    .mobile-nav-item small {
        font-size: 8px
    }

    .mobile-nav-item.active {
        color: var(--blue)
    }
}