:root{font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#272323;background:#fffafa;font-synthesis:none;line-height:1.55}*{box-sizing:border-box}body{margin:0}button,textarea{font:inherit}button,a,textarea{-webkit-tap-highlight-color:transparent}button{cursor:pointer}button:disabled{cursor:wait;opacity:.55}button:focus-visible,a:focus-visible,textarea:focus-visible,[tabindex]:focus-visible{outline:3px solid #c51f30;outline-offset:4px}a{color:#b51c2c}.header{height:88px;background:white;border-bottom:1px solid #eadcde;display:flex;align-items:center;justify-content:space-between;padding:0 max(6vw,24px)}.brand{display:flex;align-items:center;gap:12px;color:#272323;text-decoration:none;font-size:23px;font-weight:700;letter-spacing:-.7px}.brand-light{font-weight:400}.brand-icon{background:#c51f30;color:white;width:37px;height:41px;display:grid;place-items:center;border-radius:6px;font:31px Georgia,serif}.header-note{font-size:14px;color:#71666a}.shell{max-width:1040px;margin:auto;padding:30px 30px 0}.toolbar{display:flex;justify-content:space-between;align-items:center;margin-bottom:25px;gap:15px}.toolbar nav{display:flex;gap:6px;padding:4px;background:#fae9ec;border-radius:9px}.tab{border:0;border-radius:6px;background:transparent;padding:9px 22px;color:#6d5f63;font-size:14px;font-weight:600}.tab.active{background:white;color:#c51f30;box-shadow:0 1px 4px #68131e12}#history-count{margin-left:5px;font-size:12px;color:#706368}.button{border:1px solid transparent;border-radius:7px;padding:10px 16px;font-size:14px;font-weight:600;display:inline-flex;gap:12px;align-items:center;justify-content:center}.secondary{background:white;border-color:#e6d4d8;color:#71303a}.primary{background:#c51f30;color:white;min-width:92px}.primary:hover{background:#a41828}.secondary:hover{background:#fff0f2}.danger{background:#a41828;color:white}#chat-view{background:white;border:1px solid #eadcde;border-radius:12px;overflow:hidden;box-shadow:0 5px 24px #75132404}.conversation-heading{padding:25px 30px;border-bottom:1px solid #f1e3e6;display:flex;align-items:flex-start;justify-content:space-between;gap:20px}h1{font-size:20px;letter-spacing:-.4px;margin:0;font-weight:600}.conversation-heading p{font-size:14px;color:#706368;margin:5px 0 0}.mode{font-size:12px;padding:5px 10px;background:#ffedf0;border-radius:5px;white-space:nowrap;color:#973141;margin-top:4px}#messages{height:clamp(340px,46vh,620px);overflow-y:auto;overscroll-behavior:contain;padding:24px 30px}.welcome{max-width:730px;margin:20px auto 10px;text-align:center}.welcome-mark{font:36px Georgia,serif;color:#c51f30;margin-bottom:15px}.welcome h2{font:26px Georgia,serif;letter-spacing:-.4px;margin:0 0 12px}.welcome>p{color:#73666a;font-size:15px;max-width:495px;margin:0 auto 25px}.suggestions{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;text-align:left}.suggestions button{position:relative;border:1px solid #eadcde;background:#ffffff;border-radius:8px;padding:16px 22px 17px 16px;text-align:left;font-size:14px;line-height:1.6;color:#443438}.suggestions button:hover{border-color:#d96777;background:#fff4f5}.suggestions span{display:block;color:#75676c;font-size:12px;margin-bottom:8px}.suggestions b{position:absolute;right:9px;bottom:15px;font-weight:400;color:#985461}.composer-wrap{padding:12px 30px 20px}form{border:1px solid #e0cbd0;border-radius:9px;padding:14px 15px 12px;box-shadow:0 2px 6px #75132405}form:focus-within{border-color:#c51f30;box-shadow:0 0 0 3px #c51f3012}textarea{width:100%;resize:vertical;min-height:60px;max-height:220px;border:0;background:transparent;color:#272323;outline:none!important;padding:0;font-size:16px}textarea::placeholder{color:#7b6b71}.composer-bottom{display:flex;align-items:center;justify-content:space-between;gap:10px}.composer-bottom>span{font-size:12px;color:#7b6b71}.disclaimer{font-size:12px;text-align:center;color:#796970;margin:13px 0 0}.message{display:flex;gap:13px;max-width:790px;margin:0 auto 26px}.avatar{flex:none;width:31px;height:31px;border-radius:6px;display:grid;place-items:center;background:#ffedf0;color:#b51c2c;font:24px Georgia,serif}.user .avatar{font:12px Inter,sans-serif;background:#f5f1f2;color:#6b6064}.message-body{min-width:0;flex:1}.message-label{font-size:13px;font-weight:600;margin:3px 0 8px;display:flex;align-items:center;gap:10px}.message-label time{font-size:12px;color:#817077;font-weight:400}.message-text{font-size:16px;white-space:pre-wrap;overflow-wrap:anywhere;color:#493c40}.user .message-text{background:#fff0f2;border-radius:0 9px 9px 9px;padding:12px 16px;display:inline-block}.sources{margin-top:12px;font-size:13px;display:flex;gap:8px;flex-wrap:wrap}.sources a{background:#fff4f5;border:1px solid #efd6dc;border-radius:5px;padding:5px 9px;text-decoration:none;overflow-wrap:anywhere}.sources a:hover{text-decoration:underline}.message-mode{font-size:12px;color:#7b6870;margin-top:8px}.history-heading{padding:15px 0 22px}.history-heading p{font-size:14px;color:#74646a;max-width:650px}#history-list{display:grid;gap:12px;min-height:420px;align-content:start}.history-card{display:flex;align-items:center;gap:10px;background:white;border:1px solid #eadcde;border-radius:9px;padding:6px 14px 6px 5px}.history-open{border:0;background:transparent;text-align:left;flex:1;min-width:0;padding:15px;color:#493239}.history-open strong{display:block;font-size:16px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.history-open span{display:block;color:#7d6871;font-size:13px;margin-top:5px}.delete-button{background:transparent;color:#a32939;border:0;padding:10px;border-radius:5px;font-size:14px}.delete-button:hover{background:#ffedf0}.empty-history{text-align:center;padding:75px 20px;color:#78656c}.empty-history h2{font-size:20px;color:#493239}.empty-history p{font-size:15px}footer{display:flex;justify-content:space-between;font-size:12px;color:#816f76;padding:20px 1px}footer>span:first-child{font-weight:600}#notice{margin:0 0 16px;padding:12px 16px;background:#fff3f4;border:1px solid #edcbd1;border-radius:7px;color:#883442;font-size:14px}dialog{border:1px solid #eadcde;border-radius:12px;max-width:440px;width:calc(100% - 36px);padding:28px;color:#443438}dialog::backdrop{background:#39151d60}dialog h2{font-size:20px;margin:0}dialog p{color:#706368;font-size:15px}.dialog-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:24px}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}[hidden]{display:none!important}@media(max-width:640px){.header{height:70px;padding:0 20px}.header-note{display:none}.shell{padding:18px 12px 0}.toolbar{margin-bottom:16px;gap:8px}.tab{padding:9px 14px}.toolbar .button{padding:10px;font-size:12px;gap:4px}.conversation-heading{padding:20px;display:block}.mode{display:inline-block;margin-top:12px}h1{font-size:18px}#messages{padding:24px 18px;height:46vh;min-height:345px}.welcome{margin:5px auto}.welcome h2{font-size:24px}.suggestions{grid-template-columns:1fr;gap:8px}.suggestions button{padding:10px 22px 10px 12px}.suggestions span{display:none}.welcome>p{font-size:14px;margin-bottom:18px}.composer-wrap{padding:10px 13px 15px}.composer-bottom>span{max-width:160px;font-size:11px}.message{gap:9px}.message-text{font-size:15px}.disclaimer{font-size:12px}.dialog-actions{flex-wrap:wrap}}

.choose-heading{max-width:650px;margin:35px 0 30px}.choose-heading h1{font-size:28px}.choose-heading p{color:#706368;font-size:16px}.bot-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;margin-bottom:60px}.bot-card{background:white;border:1px solid #eadcde;border-radius:12px;padding:25px;display:flex;flex-direction:column;align-items:flex-start}.bot-card-icon{font:32px Georgia,serif;color:#c51f30;margin-bottom:20px}.bot-card h2{font-size:19px;line-height:1.4;margin:0 0 12px}.bot-card p{font-size:15px;color:#706368;margin:0 0 26px;flex:1}.bot-card .button{text-decoration:none;white-space:normal;text-align:center;width:100%;font-size:14px}.bot-history-link{font-size:14px;align-self:center;margin-top:16px;text-underline-offset:3px}.bot-navigation{display:flex;align-items:center;gap:16px;margin-bottom:22px}.bot-navigation>span{font-weight:600;font-size:16px}@media(max-width:760px){.bot-cards{grid-template-columns:1fr}.choose-heading{margin-top:18px}.choose-heading h1{font-size:24px}.bot-card{padding:22px}.bot-card-icon{margin-bottom:10px}.bot-card p{margin-bottom:20px}}

#language-switch{flex-shrink:0;min-width:90px}.header{gap:18px}.header-note{margin-left:auto}@media(max-width:640px){.toolbar{flex-wrap:wrap}.composer-bottom>span{max-width:190px}.bot-navigation{flex-wrap:wrap}}

.brand{color:#b51c2c}.brand-icon{font-family:inherit;font-size:25px;font-weight:700}.bot-card{border-top:3px solid #c51f30}.tab.active{color:#a41828}.header{border-top:4px solid #c51f30}@media(max-width:380px){.brand{font-size:20px;gap:8px}.header{padding-left:12px;padding-right:12px;gap:10px}}

.send-actions{display:flex;gap:8px;align-items:center}.attachment-list{display:flex;gap:8px;flex-wrap:wrap;margin:10px 0}.attachment-chip{display:flex;align-items:center;gap:8px;padding:8px 10px;max-width:100%;border:1px solid #edcbd1;border-radius:7px;background:#fff5f6;font-size:13px;overflow-wrap:anywhere}.attachment-chip span{min-width:0}.attachment-chip img{width:54px;height:54px;object-fit:cover;border-radius:4px;flex-shrink:0}.attachment-chip button{border:0;background:transparent;color:#a41828;font-size:22px;padding:0 5px}.attachment-help{font-size:12px;color:#796970;margin:8px 0 12px}.attachment-list:empty{display:none}@media(max-width:640px){.composer-bottom{flex-wrap:wrap}.send-actions{margin-left:auto}.send-actions .button{padding:10px 12px}}

.login-panel{max-width:540px;margin:70px auto;padding:32px;background:white;border:1px solid #eadbdd;border-radius:16px}.login-panel h1{font-size:1.7rem}.login-panel p{line-height:1.6;color:#5e5054}#account{display:flex;align-items:center;gap:8px;font-size:.875rem}#account-name{max-width:130px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#sync-recovery{padding:12px 0}[hidden]{display:none!important}@media(max-width:700px){.header{flex-wrap:wrap}#account-name{display:none}.login-panel{margin:25px auto;padding:22px}}

.memory-hint{font-size:1rem;padding:12px 16px;background:#fff4f4;border-left:3px solid #bc2434;border-radius:4px;color:#663b40}.memory-heading{display:flex;align-items:center;justify-content:space-between;gap:16px}#memory-dialog{width:min(720px,calc(100vw - 32px));max-height:85vh;overflow:auto;padding:24px;border:1px solid #e3cdd0;border-radius:14px}#memory-dialog::backdrop{background:#25151a88}#memory-description{line-height:1.6}.memory-toggle{display:flex;gap:10px;align-items:center;padding:12px 0;font-size:1rem}.memory-toggle input{width:22px;height:22px;accent-color:#bc2434}.memory-card{border-top:1px solid #eadbdd;padding:18px 0}.memory-card summary{cursor:pointer;font-size:1rem;font-weight:600;padding:8px 0}.memory-card button{margin-top:10px}.memory-text{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.6}.memory-sources{font-size:.875rem;color:#725259;margin:10px 0}.memory-sources summary{cursor:pointer}.memory-sources p{margin:6px 0}.bot-navigation{flex-wrap:wrap}

.pin-message{display:block;margin-top:10px;padding:7px 12px;border:1px solid #d9b8bd;border-radius:8px;background:#fff;color:#9b1d2d;font:inherit;font-size:.875rem;cursor:pointer}.pin-message[aria-pressed="true"]{background:#ffe8eb;border-color:#b82337;font-weight:600}.pin-message:disabled{opacity:.5;cursor:default}.pin-message:focus-visible{outline:3px solid #b82337;outline-offset:3px}
.message-text.formatted{white-space:normal;overflow-wrap:anywhere}.message-text.formatted p{margin:0 0 .85em}.message-text.formatted p:last-child{margin-bottom:0}.message-text.formatted ul,.message-text.formatted ol{margin:.5em 0 1em;padding-left:1.5em}.message-text.formatted li{margin:.5em 0}.message-text.formatted a{text-decoration:underline;text-underline-offset:3px}.message-text.formatted pre{white-space:pre-wrap;background:#fff4f4;padding:12px;border-radius:6px}.message-text.formatted code{font-family:ui-monospace,monospace;font-size:.9em}

/* Let wrapped controls contribute to layout instead of overflowing the header. */
.header{height:auto;min-height:88px;flex-wrap:wrap;padding-top:16px;padding-bottom:16px;row-gap:12px}
.brand{min-width:0;max-width:100%;overflow-wrap:anywhere}.brand-icon{flex-shrink:0}
.header-note{min-width:0}#account{min-width:0;flex-wrap:wrap}
.button,.tab,.pin-message,.delete-button{min-height:44px}
.button{white-space:normal;overflow-wrap:anywhere;text-align:center;max-width:100%}
.toolbar,.toolbar nav,.bot-navigation,.send-actions{min-width:0;flex-wrap:wrap}
.toolbar nav{max-width:100%}.bot-navigation>span{min-width:0;overflow-wrap:anywhere}
.conversation-heading>div{min-width:0}.conversation-heading h1{overflow-wrap:anywhere}
.message-label{flex-wrap:wrap}.message-label time{flex-shrink:0}
.attachment-chip{min-width:0}.attachment-chip button{min-width:44px;min-height:44px;flex-shrink:0}
.sources a{max-width:100%;min-width:0}.memory-heading{flex-wrap:wrap}.memory-heading h2{min-width:0;overflow-wrap:anywhere}
.memory-toggle{align-items:flex-start}.memory-toggle input{flex-shrink:0;margin-top:5px}
.memory-card summary{overflow-wrap:anywhere}dialog{max-height:85dvh;overflow:auto}
footer{flex-wrap:wrap;gap:8px 20px;overflow-wrap:anywhere}footer>span{min-width:0}
#sync-recovery{display:flex;flex-wrap:wrap;gap:8px}
@media(max-width:760px){
 .header{display:grid;grid-template-columns:minmax(0,1fr) auto;min-height:0;gap:12px;padding:14px 16px}
 .header-note{display:none}.brand{grid-column:1 / -1;font-size:22px}
 #account{grid-column:1;grid-row:2;justify-self:start}#account-name{display:none}
 #language-switch{grid-column:2;grid-row:2;justify-self:end;min-width:0}
 .toolbar{align-items:stretch}.toolbar .button{font-size:14px}
 .toolbar nav{flex:1 1 auto}.toolbar .tab{flex:1;padding:10px 12px}
 .bot-navigation{gap:10px;margin-bottom:16px}.bot-navigation>span{flex:1 1 140px}
 .memory-heading{gap:12px}#memory-dialog{padding:18px;max-height:85dvh}
 .history-open span{overflow-wrap:anywhere}.history-card{padding-right:6px}
 .composer-bottom{align-items:stretch}.composer-bottom>span{max-width:none;flex-basis:100%;font-size:12px}
 .send-actions{width:100%;margin-left:0}.send-actions .button{flex:1 1 90px;min-width:0;font-size:14px}
 .message-text{font-size:16px}.pin-message{font-size:14px}
 #messages{height:clamp(240px,45dvh,520px);min-height:240px}
 .shell{padding-bottom:env(safe-area-inset-bottom,0px)}
}
@media(max-width:380px){
 .toolbar>nav,.toolbar>#new-chat{width:100%}.toolbar>#new-chat{justify-content:center}
 .bot-navigation>span{flex-basis:100%;order:-1}
 .history-card{align-items:flex-start}.history-open{padding:12px 8px}
 .login-panel{padding:18px 12px}.conversation-heading{padding:16px}
 #messages{padding:20px 12px}.composer-wrap{padding:10px}
}

/* History rows must shrink inside the viewport even with long saved titles. */
#history-view,#history-list{min-width:0;max-width:100%}
#history-list{grid-template-columns:minmax(0,1fr)}
.history-card{min-width:0;max-width:100%;display:grid;grid-template-columns:minmax(0,1fr) 44px;gap:8px;align-items:center;padding:6px 8px}
.history-open{width:100%;max-width:100%;min-width:0;overflow:hidden}
.history-open strong{max-width:100%}.history-open span{white-space:normal;overflow-wrap:anywhere}
.delete-button{display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;padding:10px;color:#b51c2c;justify-self:end}
.delete-button svg{flex-shrink:0;pointer-events:none}
@media(max-width:640px){
 .history-card{gap:4px;padding:4px 6px}.history-open{padding:12px 8px}
 .history-open strong{font-size:14px;line-height:1.5}.history-open span{font-size:12px;line-height:1.5;margin-top:4px}
 #import-history{width:100%;margin-bottom:12px}.history-heading{padding-bottom:12px}
}
