@font-face{font-family:Inter;src:url('/assets/fonts/inter-latin.woff2') format('woff2');font-weight:400 600;font-display:swap}
@font-face{font-family:Lora;src:url('/assets/fonts/lora-latin.woff2') format('woff2');font-weight:400 600;font-display:swap}
:root{--paper:#f5f2e8;--ivory:#faf8f1;--ink:#26291f;--muted:#707163;--olive:#626d39;--olive-dark:#424d29;--line:#e0dccf;--white:#fff;--sidebar:248px;font-family:Inter,Arial,sans-serif;color:var(--ink);background:var(--ivory);font-synthesis:none}
*{box-sizing:border-box}body{margin:0}button,input,textarea,select{font:inherit;color:inherit}button,a,select,summary{-webkit-tap-highlight-color:transparent;touch-action:manipulation}button{cursor:pointer}button:disabled{cursor:default;opacity:.45}a{color:inherit;text-decoration:none}button{border:0;background:none}button:focus-visible,a:focus-visible,summary:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:2px solid var(--olive);outline-offset:3px}svg{width:20px;height:20px;flex-shrink:0}input,textarea,select{max-width:100%}[hidden]{display:none!important}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}.skip-link{position:fixed;top:-60px;left:270px;z-index:200;padding:10px 15px;border-radius:8px;background:var(--olive);color:white}.skip-link:focus{top:10px}
.chat-app{display:flex;width:100%;height:100vh;height:100dvh;overflow:hidden}.chat-sidebar{width:var(--sidebar);flex-shrink:0;display:flex;flex-direction:column;background:var(--paper);border-right:1px solid var(--line);padding:22px 12px 12px;z-index:40;min-height:0}.chat-brand{display:flex;align-items:center;gap:8px;padding:0 10px 22px;font-family:Lora,Georgia,serif;font-size:24px;line-height:1}.chat-brand svg{width:25px;height:25px}.new-chat{display:flex;align-items:center;justify-content:center;gap:9px;background:var(--olive);color:white;border-radius:11px;padding:11px 12px;font-size:13px;font-weight:500;min-height:42px;margin:0 7px 20px;transition:background .15s}.new-chat:hover,.primary-button:hover,.chat-send:not(:disabled):hover{background:var(--olive-dark)}.new-chat>span{font-size:21px;line-height:16px;font-weight:400}.history-search{display:flex;align-items:center;gap:8px;border:1px solid var(--line);border-radius:9px;margin:0 7px 15px;padding:8px 10px;background:var(--ivory);color:var(--muted)}.history-search svg{width:16px;height:16px}.history-search input{font-size:12px;border:0;outline:0;background:transparent;width:100%;min-width:0}.history-search:focus-within{outline:2px solid #626d3940;outline-offset:1px}.history-search input:focus-visible{outline:none}.history-topline{display:flex;justify-content:space-between;align-items:center;margin:0 5px 8px;min-height:30px}.history-topline select{border:0;background:transparent;color:var(--muted);font-size:11px;padding:6px 3px;min-width:0;cursor:pointer}.history-topline .icon-button{width:28px;height:28px}.history-topline svg{width:14px;height:14px}.history-list{flex:1;overflow-y:auto;min-height:0;padding-bottom:16px;scrollbar-width:thin;scrollbar-color:#d6d3c6 transparent}.history-empty{padding:15px 10px;font-size:12px;color:var(--muted);line-height:1.7}.history-empty a{color:var(--olive);text-decoration:underline}.history-group-label{font-size:10px;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);padding:12px 10px 5px}.history-row{display:flex;align-items:center;min-height:39px;border:1px solid transparent;border-radius:8px;margin:2px 0;position:relative}.history-row:hover{background:#eae8dd}.history-row.active{border-color:var(--line);background:white;box-shadow:0 1px 2px #26291f04}.history-open{font-size:12px;flex:1;text-align:left;padding:10px 9px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0;line-height:1.4}.history-more{width:27px;height:30px;margin-right:3px;border-radius:6px;font-size:18px;opacity:0;color:var(--muted)}.history-row:hover .history-more,.history-row:focus-within .history-more,.history-row.active .history-more{opacity:1}.history-more:hover{background:#e8e6dd}
.account-footer{margin-top:auto;padding-top:8px}.account-menu{position:relative}.account-menu>summary{display:flex;align-items:center;gap:10px;list-style:none;min-height:46px;padding:8px 10px;border-radius:10px;cursor:pointer;user-select:none;font-size:13px}.account-menu>summary::-webkit-details-marker{display:none}.account-menu>summary:hover,.account-menu[open]>summary{background:#26291f0d}.account-avatar{display:flex;align-items:center;justify-content:center;width:30px;height:30px;flex-shrink:0;border-radius:50%;background:#e5e5d6;color:#5d6842;font-size:11px;font-weight:500}.account-avatar svg{width:18px;height:18px}.account-name{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:500}.ellipsis{font-size:20px;color:var(--muted)}.account-popover{position:absolute;bottom:calc(100% + 8px);left:0;width:264px;max-width:calc(100vw - 24px);background:white;border:1px solid var(--line);border-radius:15px;padding:7px;box-shadow:0 6px 24px #26291f17,0 1px 3px #26291f08;z-index:70;max-height:calc(100dvh - 85px);overflow-y:auto}.account-menu:not([open]) .account-popover{display:none}.account-profile{display:flex;flex-direction:column;gap:4px;padding:12px 11px;border-radius:9px;line-height:1.4}.account-profile strong{font-size:13px;font-weight:500}.account-profile>span{font-size:11px;color:var(--muted)}a.account-profile:hover,.menu-item:hover{background:#f6f5ef}.account-divider{height:1px;margin:5px 10px;background:#e9e6dd}.account-allowance{padding:8px 11px 7px;font-size:11px;color:var(--muted);line-height:1.6}.account-allowance p{margin:0 0 2px;white-space:pre-line}.text-button{padding:0;color:var(--olive);font-size:12px;text-decoration:underline;text-underline-offset:3px}.menu-item{display:flex;align-items:center;gap:10px;width:100%;min-height:39px;padding:10px 11px;border-radius:9px;font-size:13px;text-align:left;line-height:1.4}.menu-item svg{width:17px;height:17px}.menu-item>span:last-child{margin-left:auto;color:var(--muted)}.menu-item form{margin:0}
.chat-main{display:flex;flex:1;min-width:0;flex-direction:column;height:100%;background:var(--ivory)}.chat-header{height:57px;flex-shrink:0;display:flex;gap:12px;align-items:center;padding:0 25px;border-bottom:1px solid var(--line);background:var(--ivory)}.chat-header h1{font-size:13px;line-height:1.4;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0;margin:0}.storage-badge{color:var(--muted);font-size:10px;line-height:1;white-space:nowrap;border:1px solid var(--line);padding:5px 8px;border-radius:20px;background:var(--paper)}.chat-header-actions{margin-left:auto;display:flex;gap:7px;align-items:center;flex-shrink:0}.quiet-button{font-size:12px;border:1px solid var(--line);border-radius:8px;min-height:33px;background:white;padding:7px 11px;line-height:1.4}.quiet-button:hover{background:var(--paper)}.icon-button{display:inline-flex;align-items:center;justify-content:center;width:33px;height:33px;border-radius:8px;flex-shrink:0;font-size:22px;line-height:1;color:var(--muted)}.icon-button svg{width:18px;height:18px}.icon-button:hover{background:#26291f08;color:var(--ink)}.mobile-only{display:none}.chat-stage{position:relative;display:flex;flex:1;flex-direction:column;min-height:0}.chat-scroll{flex:1;overflow-y:auto;min-height:0;padding:28px 28px 18px;scrollbar-width:thin;scrollbar-color:#d6d3c6 transparent;overscroll-behavior:contain;outline:none}.chat-scroll:focus-visible{outline:1px solid var(--line);outline-offset:-2px}.chat-welcome{max-width:740px;width:100%;margin:0 auto;text-align:center;padding:26px 0 36px}.chat-welcome>svg{width:36px;height:36px;color:var(--olive);margin-bottom:14px}.chat-welcome h2{font:400 30px/1.35 Lora,Georgia,serif;letter-spacing:-.02em;margin:0 0 12px}.chat-welcome>p{font-size:13px;color:var(--muted);line-height:1.7;margin:0}.chat-starters{display:flex;gap:10px;justify-content:center;margin:27px 0 0}.chat-starters button{display:flex;align-items:center;gap:8px;text-align:left;padding:10px 12px;border:1px solid var(--line);border-radius:10px;background:#fff9;font-size:12px;line-height:1.5}.chat-starters button:hover{background:white;border-color:#c8c4b4}.chat-starters svg{width:15px;height:15px;color:var(--olive)}.chat-starters span{margin-left:5px;color:var(--muted)}.is-empty .chat-stage{justify-content:center}.is-empty .chat-scroll{flex:0 0 auto;overflow:visible;padding-top:0;padding-bottom:0}.is-empty .composer-dock{margin-bottom:min(18vh,160px)}.chat-messages{max-width:760px;margin:0 auto;display:flex;flex-direction:column;gap:30px;padding-bottom:14px}.chat-message{display:flex;gap:14px;min-width:0}.message-avatar{display:flex;align-items:center;justify-content:center;width:30px;height:30px;flex-shrink:0;margin-top:3px;border-radius:50%;background:#626d3912;border:1px solid #626d3920;color:var(--olive);font-size:12px}.message-avatar svg{width:17px;height:17px}.user-message .message-avatar{background:var(--paper);border-color:var(--line);color:var(--muted)}.message-body{flex:1;min-width:0;font-size:15px;line-height:1.9;overflow-wrap:anywhere}.user-message .message-text{color:var(--ink);font-weight:500;padding-top:3px;white-space:pre-wrap}.message-text p{margin:0 0 15px}.message-text p:last-child{margin-bottom:0}.message-text h3{font-size:15px;font-weight:600;margin:20px 0 8px;line-height:1.6}.message-text h3:first-child{margin-top:0}.message-text ul,.message-text ol{padding-left:23px;margin:10px 0 17px}.message-text li{padding-left:4px;margin:7px 0}.message-text strong{font-weight:600}.message-text code{background:var(--paper);border-radius:4px;padding:2px 4px;font-size:.9em;white-space:pre-wrap}.message-text pre{white-space:pre-wrap;background:var(--paper);padding:13px;border-radius:9px;overflow-wrap:anywhere;font:13px/1.7 monospace}.message-tools{display:flex;align-items:center;gap:12px;margin-top:13px}.copy-answer{display:inline-flex;align-items:center;gap:5px;font-size:11px;color:var(--muted);padding:3px 0}.copy-answer svg{width:13px;height:13px}.copy-answer:hover{color:var(--ink)}.source-list{display:flex;flex-direction:column;gap:7px;margin-top:18px}.source-card{font-size:12px;line-height:1.75;border:1px solid var(--line);border-radius:9px;background:#fff9;overflow:hidden}.source-card>summary{display:flex;gap:7px;align-items:center;cursor:pointer;padding:9px 12px;list-style:none;color:#656c48}.source-card>summary::-webkit-details-marker{display:none}.source-card summary svg{width:14px;height:14px;color:#a38137}.source-card summary::after{content:'＋';font-size:13px;margin-left:auto;color:var(--muted)}.source-card[open] summary::after{content:'−'}.source-body{padding:0 13px 12px}.source-body p{font:400 14px/1.8 Lora,Georgia,serif;margin:3px 0 9px;color:#3d4a33;white-space:pre-wrap}.source-body a{font-size:10px;color:var(--olive);text-decoration:underline;text-underline-offset:3px}.source-body .source-error{font:11px/1.7 Inter,Arial,sans-serif;color:var(--muted)}.followup-list{display:flex;flex-wrap:wrap;gap:7px;margin-top:16px}.followup-list button{font-size:11px;padding:7px 10px;border:1px solid var(--line);border-radius:9px;background:#fff8;color:#62664f;text-align:left;line-height:1.5}.followup-list button:hover{background:white;border-color:#bfc5a7}.pending-answer .message-body{display:flex;align-items:center;gap:10px;font-size:12px;color:var(--muted);min-height:35px}.pending-dot{width:7px;height:7px;border-radius:50%;background:var(--olive);animation:breathe 1.4s ease-in-out infinite}.delivery-error{font-size:11px;font-weight:400;color:#8d4d32;margin-top:8px;line-height:1.7}.delivery-error button{font-size:11px;color:var(--olive);text-decoration:underline;padding:4px 0}.new-reply{position:absolute;bottom:220px;left:50%;transform:translateX(-50%);z-index:5;box-shadow:0 2px 12px #26291f0b}
.composer-dock{flex-shrink:0;max-width:816px;width:100%;margin:0 auto;padding:8px 28px max(15px,env(safe-area-inset-bottom));background:var(--ivory)}.chat-composer{background:white;border:1px solid #d5d1c2;box-shadow:0 2px 9px #26291f06;border-radius:16px;padding:12px 12px 10px;transition:border-color .15s}.chat-composer:focus-within{border-color:#9ba67a;box-shadow:0 0 0 2px #626d3910}.chat-composer textarea{display:block;width:100%;min-height:54px;max-height:180px;resize:none;outline:none;border:0;background:transparent;padding:3px 3px 6px;font-size:14px;line-height:1.75}.chat-composer textarea:focus-visible{outline:none}.chat-composer textarea::placeholder{color:#929486}.composer-controls{display:flex;gap:10px;align-items:center}.translation-control{display:flex;gap:5px;align-items:center;background:var(--paper);border:1px solid var(--line);border-radius:7px;padding:0 6px;color:#60634e}.translation-control svg{width:13px;height:13px}.translation-control select{font-size:11px;min-height:30px;cursor:pointer;border:0;background:transparent;padding:3px 0;color:var(--ink);max-width:70px}.chat-count{font-size:10px;color:var(--muted);margin-left:auto}.chat-send{display:inline-flex;align-items:center;justify-content:center;width:33px;height:33px;border-radius:50%;background:var(--olive);color:white;margin-left:auto;flex-shrink:0;transition:background .15s}.chat-send svg{width:19px;height:19px;transform:rotate(-90deg)}.chat-send[aria-busy=true] svg{animation:spin 1s linear infinite}.chat-footnote{text-align:center;font-size:10px;line-height:1.7;color:var(--muted);margin:10px 0 0}.chat-footnote a{text-decoration:underline;text-underline-offset:2px;margin-left:3px}.chat-notice,.chat-error{font-size:11px;line-height:1.7;padding:10px 12px;margin:0 0 9px;border-radius:9px;background:#efeddf;color:#62664f;overflow-wrap:anywhere}.chat-error{background:#f9ede5;color:#804b31}.chat-notice a,.chat-error a{text-decoration:underline}.selected-passage{display:flex;align-items:center;justify-content:space-between;border:1px solid var(--line);border-radius:9px;padding:4px 8px 4px 12px;margin-bottom:8px;background:var(--paper);font-size:11px;color:#59613c}.selected-passage>span{display:flex;gap:7px;align-items:center}.selected-passage svg{width:14px;height:14px}.selected-passage .icon-button{width:27px;height:27px}.sidebar-backdrop{position:fixed;inset:0;z-index:35;background:#26291f38}.chat-toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%);z-index:160;font-size:12px;line-height:1.6;padding:10px 16px;border-radius:10px;background:var(--ink);color:white;box-shadow:0 4px 15px #26291f1a;max-width:calc(100vw - 30px)}.chat-dialog{width:440px;max-width:calc(100vw - 28px);max-height:calc(100dvh - 40px);overflow:auto;padding:23px;border:1px solid var(--line);border-radius:16px;background:var(--ivory);color:var(--ink);box-shadow:0 14px 70px #26291f24}.chat-dialog::backdrop{background:#26291f3b}.dialog-heading{display:flex;gap:15px;justify-content:space-between;align-items:center;margin-bottom:15px}.dialog-heading h2{font-size:17px;font-weight:500;margin:0;line-height:1.4}.dialog-heading .icon-button{margin:-6px -7px 0 0}.chat-dialog p{font-size:12px;line-height:1.8;color:var(--muted);margin:0 0 12px}.chat-dialog label{font-size:12px;line-height:1.7;display:block;margin:12px 0}.chat-dialog input[type=text]{display:block;width:100%;border:1px solid var(--line);border-radius:8px;padding:10px 11px;background:white;font-size:13px;margin-top:5px}.chat-dialog input[type=checkbox]{accent-color:var(--olive);margin-right:7px;vertical-align:middle;width:15px;height:15px}.dialog-actions{display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px;margin-top:21px}.primary-button{background:var(--olive);color:white;font-size:12px;line-height:1.5;border-radius:8px;padding:9px 14px;min-height:35px}.danger-button{border:1px solid #dec6ba;color:#914e30;border-radius:8px;font-size:12px;padding:8px 12px;background:#fff9}.danger-button:hover{background:#f8eae1}.settings-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:15px}.settings-actions button{font-size:11px}.dialog-section{margin-top:18px;padding-top:15px;border-top:1px solid var(--line)}.dialog-note{font-size:10px!important}.no-script{position:fixed;inset:0;z-index:200;display:grid;place-content:center;gap:15px;padding:25px;background:var(--ivory);font-size:16px;text-align:center}.no-script a{text-decoration:underline;color:var(--olive)}
@keyframes breathe{0%,100%{opacity:.35;transform:scale(.8)}50%{opacity:1;transform:scale(1)}}@keyframes spin{to{transform:rotate(360deg)}}
@media(max-width:1000px){:root{--sidebar:230px}.chat-header{padding:0 18px}.storage-badge{display:none}.chat-scroll{padding-left:22px;padding-right:22px}.composer-dock{padding-left:22px;padding-right:22px}.chat-header h1{max-width:280px}}
@media(max-width:767px){.chat-sidebar{position:fixed;inset:0 auto 0 0;width:min(286px,86vw);transform:translateX(-102%);transition:transform .18s;box-shadow:6px 0 25px #26291f0c;padding-top:max(22px,env(safe-area-inset-top))}.chat-sidebar.is-open{transform:translateX(0)}.mobile-only{display:inline-flex}.chat-header{height:54px;padding:0 10px;gap:7px}.chat-header h1{font-size:12px;flex:1;max-width:none}.chat-header-actions{gap:2px}.chat-header-actions .quiet-button{font-size:10px;min-height:29px;padding:5px 7px}.chat-scroll{padding:24px 16px 13px}.chat-message{gap:9px}.message-avatar{width:25px;height:25px;margin-top:4px}.message-avatar svg{width:14px;height:14px}.message-body{font-size:14px;line-height:1.85}.chat-messages{gap:25px}.message-text h3{font-size:14px}.chat-welcome{padding:12px 3px 27px}.chat-welcome h2{font-size:26px;line-height:1.4;max-width:330px;margin-left:auto;margin-right:auto}.chat-welcome>p{font-size:12px;max-width:300px;margin:0 auto}.chat-welcome>svg{width:30px;height:30px;margin-bottom:14px}.chat-starters{gap:7px;flex-direction:column;max-width:280px;margin:22px auto 0}.chat-starters button{justify-content:flex-start;min-height:43px}.chat-starters button span{margin-left:auto}.is-empty .composer-dock{margin-bottom:min(12vh,95px)}.composer-dock{padding:6px 12px max(10px,env(safe-area-inset-bottom))}.chat-composer{padding:10px 10px 9px;border-radius:14px}.chat-composer textarea{font-size:16px;min-height:49px;max-height:140px}.chat-footnote{font-size:9px;margin-top:8px}.history-more{opacity:1}.account-popover{max-width:calc(100vw - 24px)}.followup-list{gap:6px}.followup-list button{font-size:10px}.chat-toast{bottom:18px;font-size:11px}.chat-dialog{padding:20px}.new-reply{bottom:190px}.skip-link{left:15px}.chat-count{font-size:9px}}
@media(max-height:650px){.is-empty .composer-dock{margin-bottom:15px}.chat-welcome{padding-top:8px;padding-bottom:16px}.chat-welcome>svg{display:none}.chat-starters{margin-top:15px}.chat-welcome h2{font-size:25px}.is-empty .chat-scroll{overflow-y:auto;flex:1}.chat-welcome{padding-bottom:10px}.is-empty .chat-stage{justify-content:flex-end}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
