/* Luciole — chargée depuis CDN GitHub */
@font-face {
    font-family: 'Luciole';
    src: url('https://cdn.jsdelivr.net/gh/nicowillis/luciole@main/Luciole-Regular.woff2') format('woff2');
    font-weight: 400; font-style: normal;
}
@font-face {
    font-family: 'Luciole';
    src: url('https://cdn.jsdelivr.net/gh/nicowillis/luciole@main/Luciole-Bold.woff2') format('woff2');
    font-weight: 700; font-style: normal;
}

:root {
    --teal:    #203C47;
    --teal-mid:#445863;
    --orange:  #D14600;
    --grey:    #475467;
    --hint:    #5A6878;
    --cream:   #FAF8FC;
    --white:   #FFFFFF;
    --border:  #C8D3DB;
    --shadow:  0 2px 12px rgba(32,60,71,.10);
    --chat-bg: #EEF2F4;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
    font-family: 'Luciole', Arial, sans-serif;
    background: var(--cream);
    color: var(--grey);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.ia-banner {
    background: var(--orange);
    color: var(--white);
    text-align: center;
    padding: .45rem 1rem;
    font-family: 'Luciole', Arial, sans-serif;
    font-size: .82rem;
    font-weight: bold;
    flex-shrink: 0;
}

header {
    background: var(--teal);
    padding: .9rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 3px solid var(--orange);
    flex-shrink: 0;
}

.logo-img {
    height: 44px;
    width: auto;
    flex-shrink: 0;
    filter: brightness(0) invert(1);
}

.header-text { flex: 1; }

.header-text h1 {
    font-family: 'Nunito', Verdana, Arial, sans-serif;
    font-size: 1rem;
    font-weight: 800;
    color: var(--white);
    line-height: 1.2;
}

.header-text p {
    font-family: 'Luciole', Arial, sans-serif;
    font-size: .75rem;
    color: rgba(255,255,255,.7);
    margin-top: .2rem;
}

.user-info {
    font-family: 'Luciole', Arial, sans-serif;
    font-size: .75rem;
    color: var(--white);
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.3);
    border-radius: 5px;
    padding: .3rem .7rem;
    flex-shrink: 0;
}

.intro {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 1.2rem 1.5rem;
    flex-shrink: 0;
    overflow: hidden;
    transition: max-height .4s ease, padding .4s ease, opacity .3s ease;
}

.intro.hidden {
    max-height: 0 !important;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
    border-bottom: none;
}

.intro-inner { max-width: 760px; margin: 0 auto; }

.intro p {
    font-size: .875rem;
    color: var(--grey);
    line-height: 1.65;
    margin-bottom: .9rem;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .6rem;
    margin-bottom: .9rem;
}

@media (max-width: 580px) { .tools-grid { grid-template-columns: 1fr; } }

.tool-chip {
    background: var(--cream);
    border: 1.5px solid var(--border);
    border-radius: 7px;
    padding: .65rem .85rem;
}

.tool-chip .tool-name {
    font-family: Consolas, 'Courier New', monospace;
    font-size: .78rem;
    font-weight: bold;
    color: var(--teal);
    display: block;
    margin-bottom: .25rem;
}

.tool-chip .tool-desc {
    font-family: 'Luciole', Arial, sans-serif;
    font-size: .78rem;
    color: var(--grey);
    line-height: 1.4;
}

.intro-note {
    font-size: .8rem;
    color: var(--grey);
    background: rgba(32,60,71,.05);
    border-left: 3px solid var(--orange);
    padding: .55rem .9rem;
    border-radius: 0 5px 5px 0;
    line-height: 1.55;
}

.chat-area {
    flex: 1;
    overflow-y: auto;
    padding: 1.2rem 1.5rem;
    background: var(--chat-bg);
    scroll-behavior: smooth;
}

.chat-inner {
    max-width: 760px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.bubble { display: flex; flex-direction: column; max-width: 85%; }
.bubble.user { align-self: flex-end; align-items: flex-end; }
.bubble.bot  { align-self: flex-start; align-items: flex-start; }

.bubble-label {
    font-family: 'Luciole', Arial, sans-serif;
    font-size: .7rem;
    font-weight: bold;
    color: var(--teal);
    margin-bottom: .2rem;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.bubble.bot .bubble-label { color: var(--hint); }

.bubble-content {
    padding: .8rem 1rem;
    border-radius: 12px;
    font-family: 'Luciole', Arial, sans-serif;
    font-size: .875rem;
    line-height: 1.65;
    word-break: break-word;
}

.bubble.user .bubble-content {
    background: var(--teal);
    color: var(--white);
    border-bottom-right-radius: 3px;
}

.bubble.bot .bubble-content {
    background: var(--white);
    color: var(--grey);
    border: 1px solid var(--border);
    border-bottom-left-radius: 3px;
    box-shadow: var(--shadow);
}

.bubble.bot .bubble-content table {
    width: 100%;
    border-collapse: collapse;
    margin: .7rem 0;
    font-size: .8rem;
}

.bubble.bot .bubble-content th {
    background: var(--teal);
    color: var(--white);
    padding: .4rem .65rem;
    text-align: left;
    font-weight: bold;
}

.bubble.bot .bubble-content td {
    padding: .38rem .65rem;
    border-bottom: 1px solid var(--border);
    color: var(--grey);
}

.bubble.bot .bubble-content tr:nth-child(even) td { background: var(--cream); }

.bubble.bot .bubble-content code,
.bubble.bot .bubble-content pre {
    font-family: Consolas, monospace;
    font-size: .82rem;
    background: var(--cream);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: .1em .35em;
    color: var(--teal);
}
.bubble.bot .bubble-content pre{
    margin: 0.35rem;
}
.bubble-content ul{
    padding: 0.5rem 1rem;
}
.bubble-content ul li{
    padding-top: 0.35rem;
}
.typing {
    display: flex;
    align-items: center;
    gap: .3rem;
    padding: .8rem 1rem;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    border-bottom-left-radius: 3px;
    width: fit-content;
    box-shadow: var(--shadow);
}

.typing span {
    width: 7px; height: 7px;
    background: var(--teal);
    border-radius: 50%;
    display: inline-block;
    animation: bounce .9s infinite;
}

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

@keyframes bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: .4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

.input-area {
    background: var(--white);
    border-top: 1px solid var(--border);
    padding: .9rem 1.5rem;
    flex-shrink: 0;
}

.input-inner { max-width: 760px; margin: 0 auto; }

.input-row {
    display: flex;
    gap: .6rem;
    align-items: flex-end;
}

.input-group { flex: 1; }

label[for="user-input"] {
    display: block;
    font-family: 'Luciole', Arial, sans-serif;
    font-size: .82rem;
    font-weight: bold;
    color: var(--teal);
    margin-bottom: .35rem;
}

textarea#user-input {
    width: 100%;
    padding: .65rem .9rem;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-family: 'Luciole', Arial, sans-serif;
    font-size: .9rem;
    color: var(--grey);
    background: var(--white);
    resize: none;
    min-height: 46px;
    max-height: 140px;
    overflow-y: auto;
    line-height: 1.45;
    transition: border-color .2s, box-shadow .2s;
}

textarea#user-input:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(32,60,71,.12);
}

textarea#user-input::placeholder { color: var(--hint); }

.input-hint {
    font-family: 'Luciole', Arial, sans-serif;
    font-size: .72rem;
    color: var(--hint);
    margin-top: .3rem;
}

.btn-send {
    background: var(--teal);
    color: var(--white);
    border: none;
    border-radius: 8px;
    width: 46px;
    height: 46px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    align-self: flex-end;
    transition: background .2s, transform .1s;
}

.btn-send:hover { background: var(--teal-mid); }
.btn-send:active { transform: scale(.95); }
.btn-send:disabled { background: var(--border); cursor: not-allowed; }
.btn-send svg { width: 20px; height: 20px; fill: var(--white); }

footer {
    background: var(--teal);
    color: rgba(255,255,255,.65);
    text-align: center;
    padding: .55rem 1rem;
    font-family: 'Luciole', Arial, sans-serif;
    font-size: .75rem;
    flex-shrink: 0;
}

footer a { color: rgba(255,255,255,.9); text-decoration: underline; }
footer strong { color: var(--white); }

:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }