* { box-sizing: border-box; }
html { font-size: 10px; }
html, body { margin: 0; height: 100%; background: #fff; color: #323232; }
body { font: 400 1.7rem/1.25 "Open Sans", "Noto Sans", sans-serif; }
body { display: flex; flex-direction: column; overflow: hidden; }
header { flex: 0 0 2.8rem; height: 2.8rem; padding: .4rem 1rem; color: #fff; background: #2a2a2a; text-align: center; }
h1 { margin: 0; overflow: hidden; font-size: 1.7rem; font-weight: 400; line-height: 2rem; text-overflow: ellipsis; white-space: nowrap; }
main { flex: 1; overflow: hidden; }
.panel { display: none; height: 100%; padding: .6rem 1rem; overflow-y: auto; }
.panel.active { display: block; }
#chat.panel.active { display: flex; flex-direction: column; overflow: hidden; }
label { display: block; margin: .8rem 0 .3rem; color: #5b5b5b; font-size: 1.4rem; font-weight: 400; }
input, select, textarea { width: 100%; min-height: 3.8rem; padding: .6rem .8rem; border: .1rem solid #9b9b9b; border-radius: 0; background: #fff; font: 400 1.7rem/1.2 "Open Sans", "Noto Sans", sans-serif; }
.focusable:focus { outline: none; color: #fff; background-color: #0061e0; border-color: #0061e0; }
#chat-content { min-height: 0; flex: 1; display: flex; flex-direction: column; }
#chat-content[hidden] { display: none; }
#conversation { min-height: 0; flex: 1; overflow-y: auto; padding-bottom: 4px; }
.message { margin: .4rem 0 .8rem; padding: .8rem; overflow-wrap: break-word; white-space: pre-wrap; }
.assistant { background: #e8e8ea; }
.user { background: #d9f4ec; }
.error { background: #ffe0e0; color: #8b0000; }
.notice { margin: .8rem 0; color: #5b5b5b; font-size: 1.2rem; }
#count { position: absolute; bottom: -2px; inset-inline-start: 10px; font-size: 10px; color: #666; }
.send-button { min-height: 3.8rem; padding: .6rem .8rem; border: 0; border-radius: 0; color: #fff; background: #0061e0; font-size: 1.7rem; font-weight: 400; }
.send-button:focus { color: #323232; background: #c7e0ff; outline: .2rem solid #0061e0; outline-offset: -.2rem; }
.composer { position: relative; flex: 0 0 auto; display: flex; gap: 5px; padding: 0 10px; padding-top: 5px; padding-bottom: 12px; background: #f7f7f8; border-top: 1px solid #ddd; margin: 0 -10px;}
.composer textarea { flex: 1; min-width: 0; resize: none; }
.composer textarea:focus::placeholder { color: white; }
.composer .send-button { flex: 0 0 42px; width: 42px; margin: 0; font-size: 18px; }
.settings-save { width: 100%; margin-top: 10px; }
.important-notice { padding: 6px; border-inline-start: 3px solid #10a37f; background: #e7f6f1; text-align: start; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
h2 { margin: .2rem 0 .6rem; font-size: 1.7rem; font-weight: 600; }
.history-heading { display: flex; min-height: 4.8rem; align-items: stretch; justify-content: space-between; gap: .1rem; border-bottom: .1rem solid #d8d8d8; }
.history-link { flex: 1 1 auto; min-width: 0; padding: .8rem; border: 0; color: #323232; background: #fff; text-align: start; font: 400 1.7rem/1.2 "Open Sans", "Noto Sans", sans-serif; }
.history-link, .delete-chat { cursor: pointer; }
.history-link:focus { color: #fff; background: #0061e0; outline: none; }
.current-badge { display: inline-block; margin-inline-end: .6rem; color: #0061e0; font-size: 1.2rem; vertical-align: .1rem; }
.history-link:focus .current-badge { color: #fff; }
.delete-chat { flex: 0 0 3.8rem; width: 3.8rem; padding: .8rem 1.1rem; border: 0; color: #8b0000; background: #fff; }
.delete-chat:focus { color: #fff; background: #8b0000; outline: none; }
.trash-glyph { position: relative; display: block; width: 1.4rem; height: 1.4rem; margin-top: .3rem; border: .2rem solid currentColor; border-top: 0; }
.trash-glyph::before { content: ""; position: absolute; top: -.5rem; left: -.3rem; width: 1.6rem; border-top: .2rem solid currentColor; }
.trash-glyph::after { content: ""; position: absolute; top: -.8rem; left: .3rem; width: .6rem; height: .3rem; border: .2rem solid currentColor; border-bottom: 0; }
.thinking { height: 22px; margin-bottom: 5px; padding: 5px 8px; }
.thinking span { display: inline-block; width: 7px; height: 7px; margin-right: 4px; border-radius: 50%; background: #10a37f; animation: think 1.1s infinite ease-in-out; }
.thinking span:nth-child(2) { animation-delay: .16s; }
.thinking span:nth-child(3) { animation-delay: .32s; }
.thinking[hidden] { display: none; }
@keyframes think { 0%, 60%, 100% { transform: translateY(0); opacity: .35; } 30% { transform: translateY(-5px); opacity: 1; } }
.toast { position: fixed; z-index: 20; top: 2.8rem; inset-inline: 0; padding: .8rem 1rem; color: #fff; background: rgba(50,50,50,.97); font-size: 1.4rem; text-align: start; box-shadow: 0 .2rem .5rem rgba(0,0,0,.35); animation: toast-in .18s ease-out; }
.toast[hidden] { display: none; }
@keyframes toast-in { from { transform: translateY(-.8rem); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
footer { direction: ltr; flex: 0 0 3rem; height: 3rem; display: flex; background: #101010; }
footer button { flex: 1; min-width: 0; border: 0; padding: .5rem .4rem; overflow: hidden; color: #fff; background: #101010; font: 600 1.4rem/2rem "Open Sans", "Noto Sans", sans-serif; text-overflow: ellipsis; white-space: nowrap; }
footer button:first-child { text-align: start; }
footer button:last-child { text-align: end; }
#soft-center { font-weight: bold; }
