/* Deliberately scoped: ordinary Chat and the reader keep their existing layout. */
#ss-prompt-history{position:fixed;inset:0 0 0 auto;box-sizing:border-box;width:280px;padding:24px 20px;display:flex;flex-direction:column;border-left:1px solid rgba(110,90,70,.13);color:var(--warm-text,#5c4d43);font-family:inherit;overflow:hidden;z-index:30}
#ss-prompt-history[hidden],.ss-prompt-opener[hidden],#ss-prompt-history button[hidden]{display:none!important}
#ss-prompt-history h2{margin:0 12px 22px;font-family:inherit;font-size:18px;line-height:1.5;font-weight:600;overflow-wrap:anywhere}
#ss-prompt-history button,.ss-prompt-opener{padding:13px 14px;border:0;border-radius:14px;background:transparent;color:inherit;font:inherit;font-size:15px;text-align:start;cursor:pointer;line-height:1.5}
#ss-prompt-history button:hover,#ss-prompt-history button:focus-visible,.ss-prompt-opener:focus-visible{background:rgba(110,138,126,.14);outline:none}
#ss-prompt-history button[aria-current]{background:rgba(110,138,126,.16);font-weight:600}
#ss-prompt-history button:disabled{opacity:.55;cursor:default}
#ss-prompt-history .ss-prompt-new{background:rgba(255,254,251,.8);border:1px solid rgba(110,90,70,.16);margin-bottom:24px;flex-shrink:0}
#ss-prompt-history nav{display:flex;flex-direction:column;gap:6px;min-height:0;overflow-y:auto;overscroll-behavior:contain}
#ss-prompt-history nav button{flex-shrink:0;width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#ss-prompt-history p{font-size:14px;line-height:1.5}
#ss-prompt-history p:empty{display:none}
#ss-prompt-history .ss-prompt-close{display:none}
@media(min-width:1001px){body.ss-prompt-history #chat-main{margin-right:280px!important}}
body.ss-prompt-history #chat-conversation-panel{scrollbar-gutter:stable!important}
body.ss-prompt-history #chat-conversation-panel::-webkit-scrollbar,#ss-prompt-history nav::-webkit-scrollbar{width:4px;height:4px}
body.ss-prompt-history #chat-conversation-panel::-webkit-scrollbar-track,#ss-prompt-history nav::-webkit-scrollbar-track{background:transparent}
body.ss-prompt-history #chat-conversation-panel::-webkit-scrollbar-thumb,#ss-prompt-history nav::-webkit-scrollbar-thumb{background:rgba(92,77,67,.18)!important;border-radius:4px}
@supports not selector(::-webkit-scrollbar){body.ss-prompt-history #chat-conversation-panel,#ss-prompt-history nav{scrollbar-width:thin;scrollbar-color:rgba(92,77,67,.18) transparent}}
[data-theme=dark] #ss-prompt-history{color:#e6ded5;border-color:#ffffff20}
[data-theme=dark] #ss-prompt-history .ss-prompt-new{background:#ffffff08;border-color:#ffffff20}
@media(max-width:1000px){
  #ss-prompt-history{inset:64px 12px auto auto;max-height:calc(100dvh - 88px);width:min(320px,calc(100vw - 24px));border:1px solid rgba(110,90,70,.16);border-radius:18px;background:var(--cream,#faf7f3);box-shadow:0 8px 24px #00000015;z-index:45;padding:16px}
  #ss-prompt-history .ss-prompt-close{display:block;align-self:flex-end}
  #ss-prompt-history h2{margin-bottom:8px}
  [data-theme=dark] #ss-prompt-history{background:#272320!important}
  .ss-prompt-opener{margin-inline-start:auto}
}
body.ss-pdf-reader-open #ss-prompt-history,body.ss-pdf-reader-open .ss-prompt-opener{display:none!important}
/* Approved prompt-chat refinements. Fade only the clipped edge, never the sidebar. */
@media(min-width:768px){
  body.ss-prompt-history:not(.ss-pdf-reader-open) #chat-conversation-panel{
    -webkit-mask-image:linear-gradient(to bottom,transparent 0px,transparent 12px,rgba(0,0,0,.35) 24px,#000 40px)!important;
    mask-image:linear-gradient(to bottom,transparent 0px,transparent 12px,rgba(0,0,0,.35) 24px,#000 40px)!important;
  }
}
body.chat-ny-in-conversation #chat-back-btn,body.chat-ny-in-conversation #ss-scroll-bottom-fab{
  width:44px!important;height:44px!important;min-width:44px!important;
  color:#44382f!important;background:#faf7f2!important;
  border:1px solid rgba(68,56,47,.26)!important;box-shadow:0 2px 5px rgba(68,56,47,.09)!important;
}
body.chat-ny-in-conversation #chat-back-btn{opacity:1!important}
body.chat-ny-in-conversation #chat-back-btn svg,body.chat-ny-in-conversation #ss-scroll-bottom-fab svg{width:20px!important;height:20px!important;stroke-width:2.2!important;opacity:1!important}
body.chat-ny-in-conversation #chat-back-btn:is(:hover,:focus-visible),body.chat-ny-in-conversation #ss-scroll-bottom-fab:is(:hover,:focus-visible){background:#e9e1d6!important;border-color:#776555!important;outline:none}
html[data-theme=dark] body.chat-ny-in-conversation #chat-back-btn,html[data-theme=dark] body.chat-ny-in-conversation #ss-scroll-bottom-fab{color:#f1e7db!important;background:#332c27!important;border-color:#8f8070!important}
html[data-theme=dark] body.chat-ny-in-conversation #chat-back-btn:is(:hover,:focus-visible),html[data-theme=dark] body.chat-ny-in-conversation #ss-scroll-bottom-fab:is(:hover,:focus-visible){background:#493d33!important}
.ss-prompt-scroll-dots{display:none;align-items:center;justify-content:center;gap:3px}
.ss-prompt-scroll-dots>span{width:4px;height:4px;border-radius:50%;background:currentColor}
body.chat-ny-in-conversation #ss-scroll-bottom-fab:not(.ss-visible){visibility:hidden}
body.chat-ny-in-conversation:has(#typing-bubble) #ss-scroll-bottom-fab svg{display:none}
body.chat-ny-in-conversation:has(#typing-bubble) #ss-scroll-bottom-fab .ss-prompt-scroll-dots{display:flex}
body.chat-ny-in-conversation:has(#typing-bubble) #ss-scroll-bottom-fab.ss-visible .ss-prompt-scroll-dots>span{animation:typingBounce 1.2s infinite}
.ss-prompt-scroll-dots>span:nth-child(2){animation-delay:.15s!important}
.ss-prompt-scroll-dots>span:nth-child(3){animation-delay:.3s!important}
@media(prefers-reduced-motion:reduce){.ss-prompt-scroll-dots>span{animation:none!important}}
body.ss-prompt-history #chat-messages::-webkit-scrollbar{width:4px;height:4px}
body.ss-prompt-history #chat-messages::-webkit-scrollbar-track{background:transparent}
body.ss-prompt-history #chat-messages::-webkit-scrollbar-thumb{background:rgba(92,77,67,.18);border-radius:4px}
html[data-theme=dark] body.ss-prompt-history :is(#chat-conversation-panel,#chat-messages)::-webkit-scrollbar-thumb,
html[data-theme=dark] #ss-prompt-history nav::-webkit-scrollbar-thumb{background:rgba(232,224,216,.22)!important}

/* Initial loading only; refreshes retain the actual rows. */
#ss-prompt-history .ss-prompt-skeleton{display:block;flex-shrink:0;height:48px;border-radius:14px;background:rgba(110,138,126,.09)}
#ss-prompt-history .ss-prompt-skeleton::after{content:"";display:block;margin:18px 14px;height:12px;width:70%;border-radius:6px;background:rgba(110,138,126,.12)}
#ss-prompt-history .ss-prompt-skeleton:nth-child(2)::after{width:55%}

/* Same palette and geometry as the existing list; actions reserve their space. */
#ss-prompt-history .ss-prompt-row{display:flex;align-items:center;flex-shrink:0;min-height:48px;border-radius:14px;position:relative}
#ss-prompt-history .ss-prompt-row:hover,#ss-prompt-history .ss-prompt-row:focus-within{background:rgba(110,138,126,.14)}
#ss-prompt-history .ss-prompt-row.is-active{background:rgba(110,138,126,.16)}
#ss-prompt-history .ss-prompt-open{flex:1;min-width:0;background:transparent}
#ss-prompt-history .ss-prompt-more{flex:0 0 36px;width:36px;padding:6px;font-size:24px;line-height:1.5;opacity:0}
#ss-prompt-history .ss-prompt-row:is(:hover,:focus-within,.is-active) .ss-prompt-more{opacity:1}
#ss-prompt-history button:focus-visible{outline:2px solid var(--warm-text,#5c4d43);outline-offset:-3px}
#ss-prompt-history .ss-prompt-menu{position:fixed;min-width:140px;padding:5px;border:1px solid rgba(110,90,70,.16);border-radius:14px;background:var(--cream,#faf7f3);box-shadow:0 4px 16px #00000015;z-index:50}
#ss-prompt-history .ss-prompt-menu[hidden]{display:none}
#ss-prompt-history .ss-prompt-menu button{display:block;width:100%;padding:9px 14px;border-radius:10px}
#ss-prompt-history .ss-prompt-row form{display:flex;align-items:center;gap:2px;width:100%;padding:4px;box-sizing:border-box}
#ss-prompt-history .ss-prompt-row input{box-sizing:border-box;flex:1;min-width:0;width:100%;padding:9px 6px;border:1px solid rgba(110,90,70,.35);border-radius:10px;background:var(--cream,#faf7f3);color:inherit;font:inherit;font-size:15px}
#ss-prompt-history .ss-prompt-row form button{flex:0 0 30px;width:30px;min-height:36px;padding:0;display:inline-flex;align-items:center;justify-content:center;text-align:center;line-height:1;font-size:18px}
[data-theme=dark] #ss-prompt-history .ss-prompt-menu,[data-theme=dark] #ss-prompt-history .ss-prompt-row input{background:#272320;border-color:#ffffff35}
[data-theme=dark] #ss-prompt-history button:focus-visible{outline-color:#e6ded5}
@media(hover:none){#ss-prompt-history .ss-prompt-more{opacity:1;flex-basis:44px;width:44px}#ss-prompt-history .ss-prompt-row form button{flex-basis:36px;width:36px;min-height:44px}}

#ss-prompt-history .ss-prompt-row .ss-prompt-open[aria-current]{background:transparent}

#ss-prompt-history .ss-prompt-row .ss-prompt-open:is(:hover,:focus-visible){background:transparent}

/* Quiet inline editing; retain a visible focus cue without an outline. */
#ss-prompt-history .ss-prompt-row input,[data-theme=dark] #ss-prompt-history .ss-prompt-row input{border-color:transparent;outline:none}
#ss-prompt-history .ss-prompt-row input:focus,#ss-prompt-history .ss-prompt-row form button:focus-visible{outline:none;box-shadow:none;background:rgba(110,138,126,.20)}
[data-theme=dark] #ss-prompt-history .ss-prompt-row input:focus,[data-theme=dark] #ss-prompt-history .ss-prompt-row form button:focus-visible{box-shadow:none;background:rgba(230,222,213,.18)}

/* One stable row: existing new-chat surface and Historik search styling. */
#ss-prompt-history .ss-prompt-tools{display:flex;align-items:stretch;height:50px;box-sizing:border-box;border-radius:14px;padding:0;position:relative}
#ss-prompt-history .ss-prompt-create{flex:1;min-width:0;padding-inline:0 14px}
#ss-prompt-history .ss-prompt-search-open,#ss-prompt-history .ss-prompt-search-close{flex:0 0 44px;width:44px;padding:0;position:relative;text-align:center}
#ss-prompt-history .ss-prompt-search-open .chd-search-icon{inset-inline-start:14px;color:inherit}
#ss-prompt-history .chd-search-wrap{margin:0;width:100%;height:100%}
#ss-prompt-history .chd-search-wrap[hidden]{display:none}
#ss-prompt-history .chd-search{box-sizing:border-box;height:100%;padding-inline:40px 44px;border:0;background:transparent;color:inherit}
#ss-prompt-history .chd-search:focus{outline:none;box-shadow:none}
#ss-prompt-history .ss-prompt-search-close{position:absolute;inset-block:0;inset-inline-end:0;font-size:20px}
#ss-prompt-history .chd-search-icon{color:inherit}
@media(max-width:1000px){#ss-prompt-history .chd-search{font-size:16px}}

/* One continuous hover/focus surface; keep the two native actions distinct. */
#ss-prompt-history .ss-prompt-tools:hover{background:rgba(110,138,126,.14)}
#ss-prompt-history .ss-prompt-tools:focus-within{background:rgba(110,138,126,.20)}
[data-theme=dark] #ss-prompt-history .ss-prompt-tools:hover{background:rgba(230,222,213,.10)}
[data-theme=dark] #ss-prompt-history .ss-prompt-tools:focus-within{background:rgba(230,222,213,.16)}
#ss-prompt-history .ss-prompt-tools button:is(:hover,:focus-visible){background:transparent;outline:none;box-shadow:none}
#ss-prompt-history .ss-prompt-tools button:focus-visible{text-decoration:underline;text-underline-offset:3px}
#ss-prompt-history .ss-prompt-search-open:focus-visible svg{stroke-width:3}
