/* Sage stays anchored to her launcher without blocking the page. */
.sage-panel{position:fixed;right:20px;bottom:110px;z-index:35;width:min(390px,calc(100vw - 32px));height:min(540px,calc(100dvh - 132px));display:flex;flex-direction:column;overflow:hidden;border:1px solid #c7d1c8;border-radius:21px;background:#fffdf7;box-shadow:0 12px 48px #163e5538;color:var(--ink)}
.sage-panel-header{display:flex;align-items:center;gap:11px;flex:none;padding:15px 16px;background:var(--navy);color:#fff0ce;border-bottom:2px solid #d7b77b}
.sage-panel-header>img{width:48px;height:48px;object-fit:contain;border-radius:50%;background:#fff6de;border:1px solid #eed6a5}
.sage-panel-header h2{font:800 23px/1.2 var(--display);margin:0;color:inherit}
.sage-panel-header p{font-size:12px;line-height:1.4;margin:3px 0 0;color:#eee2c8}
.sage-panel-header .sage-minimize{margin-left:auto;flex:none;color:#fff0ce;border:1px solid #fff0ce55}
.sage-panel-header .sage-minimize:hover{background:#ffffff18}
.sage-panel .sage-messages{min-height:0;max-height:none;flex:1;overflow-y:auto;overscroll-behavior:contain;display:flex;flex-direction:column;gap:12px;padding:17px 16px;margin:0;scrollbar-width:thin}
.sage-panel .sage-message{padding:12px 14px;border-radius:14px;background:#edf3e9;margin-right:15px;flex:none;overflow-wrap:anywhere}
.sage-panel .sage-message.user{margin-right:0;margin-left:30px;background:#f7edd9}
.sage-panel .sage-message strong{font:800 12px/1.4 var(--body);color:var(--navy)}
.sage-panel .sage-message p{font-size:14px;line-height:1.6;margin:5px 0 0;white-space:pre-wrap}
.sage-panel .sage-message a{display:block;font-size:13px;line-height:1.5;margin:10px 0 0}
.sage-panel .sage-resource{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;padding:8px 0 5px;border-bottom:1px solid #dbe5d8}
.sage-panel .sage-resource:last-of-type{border-bottom:0}
.sage-panel .sage-resource a{flex:1 1 165px;min-width:0;margin:0}
.sage-panel .sage-resource .publisher-credit{flex-basis:100%;margin:0}
.sage-panel .sage-save{display:inline-flex;align-items:center;justify-content:center;gap:4px;flex:none;margin:0;padding:4px 7px;min-height:26px;border:1px solid #9bbeb5;border-radius:8px;background:transparent;color:var(--forest);font:600 11px/1.1 var(--body);cursor:pointer}
.sage-panel .sage-save:hover,.sage-panel .sage-save:focus-visible{background:#dfebe4}
.sage-panel .sage-save[aria-pressed="true"]{background:#e0eee5;border-color:var(--forest)}
.sage-panel .sage-save-icon{display:block;width:12px;height:12px}
.sage-panel .sage-message small{display:block;font-size:11px;line-height:1.5;margin-top:10px;color:var(--muted)}
.sage-panel .sage-typing{font-size:12px;color:var(--muted);margin:0;padding:0 4px}
.sage-composer{flex:none;padding:13px 15px 15px;border-top:1px solid var(--line);background:#fffdf7}
.sage-composer .field{display:block;width:100%;min-height:64px;max-height:120px;resize:vertical;font-size:15px;line-height:1.45;padding:10px 12px}
.sage-composer-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:10px}
.sage-composer-actions a{font-size:11px;font-weight:700;color:var(--forest);text-decoration:none}
.sage-composer-actions a:hover{text-decoration:underline}
.sage-composer-actions .button{min-width:76px;font-size:12px;padding:9px 16px}
.help-launch[aria-expanded="true"] .sage-prompt{opacity:0;visibility:hidden}
@media(max-width:760px){.sage-panel{right:12px;bottom:152px;width:min(390px,calc(100vw - 24px));height:min(480px,calc(100dvh - 172px))}.sage-panel-header{padding:12px 14px}.sage-panel-header>img{width:42px;height:42px}.sage-panel-header h2{font-size:21px}.sage-panel .sage-messages{padding:14px 12px}.sage-composer{padding:11px 12px 12px}.sage-composer .field{font-size:16px;min-height:60px}}
@media(max-height:550px){.sage-panel{bottom:12px;max-height:calc(100dvh - 24px);height:calc(100dvh - 24px)}.sage-panel .sage-messages{padding:10px 12px}.sage-panel-header{padding:9px 13px}.sage-panel-header>img{width:36px;height:36px}.sage-composer .field{min-height:48px;height:48px;resize:none}}

.sage-panel .sage-navigation{display:inline-flex;align-items:center;justify-content:center;max-width:100%;margin:10px 8px 0 0;padding:8px 12px;border-radius:999px;border:1px solid var(--forest);background:#edf3e9;color:var(--forest);font:700 12px/1.4 var(--body);cursor:pointer}
.sage-panel .sage-navigation:hover,.sage-panel .sage-navigation:focus-visible{background:#dbead6}

/* Chat never becomes a page-level loading experience. */
.sage-panel[hidden]{display:none!important}
.sage-panel .sage-typing{display:flex;align-items:center;gap:8px;padding:7px 5px;color:var(--forest)}
.sage-panel .sage-typing-dots{display:inline-flex;gap:4px;align-items:center;height:12px}
.sage-panel .sage-typing-dots i{display:block;width:5px;height:5px;border-radius:50%;background:currentColor;animation:sage-dot 1.05s ease-in-out infinite}
.sage-panel .sage-typing-dots i:nth-child(2){animation-delay:.16s}
.sage-panel .sage-typing-dots i:nth-child(3){animation-delay:.32s}
@keyframes sage-dot{0%,65%,100%{transform:translateY(0);opacity:.35}30%{transform:translateY(-4px);opacity:1}}
@media(prefers-reduced-motion:reduce){.sage-panel .sage-typing-dots i{animation:none;opacity:.75}}

.sage-composer-links{display:flex;align-items:center;flex-wrap:wrap;gap:12px}
