.chat-navigation { display: flex; align-items: center; gap: 4px; margin-right: auto; }
.chat-nav-button, .history-icon { display: inline-grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 11px; color: #565656; background: transparent; border: 1px solid transparent; border-radius: 11px; }
.chat-nav-button svg, .history-icon svg { width: 21px; height: 21px; }
.chat-nav-button:hover, .history-icon:hover { background: #f2f2f2; border-color: #e7e7e7; }
.chat-nav-button:disabled { opacity: .4; }
.history-dialog { width: min(960px, calc(100vw - 56px)); height: min(700px, calc(100dvh - 72px)); padding: 0; margin: auto; max-width: none; max-height: none; overflow: hidden; border: 1px solid #dfdfdf; border-radius: 22px; background: #fff; color: #232323; box-shadow: 0 30px 100px #25252530; font-family: var(--font, -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif); }
.history-dialog::backdrop { background: #2020203b; backdrop-filter: blur(4px); }
.history-header { display: flex; align-items: center; gap: 12px; min-height: 78px; padding: 15px 22px 15px 28px; border-bottom: 1px solid #e7e7e7; }
.history-header h2 { margin: 0; font-size: 19px; font-weight: 550; letter-spacing: -.4px; flex: 1; }
.history-back { display: none; }
.history-content { display: grid; grid-template-columns: 280px minmax(0, 1fr); height: calc(100% - 78px); min-height: 0; }
.history-list-panel { display: flex; flex-direction: column; min-height: 0; overflow: hidden; padding: 20px 12px; background: #f9f9f9; border-right: 1px solid #e7e7e7; }
.history-search { display: block; margin: 0 4px 14px; }
.history-search input { width: 100%; min-height: 44px; border: 1px solid #dddddd; border-radius: 11px; background: #fff; color: #232323; padding: 11px 12px; font: inherit; font-size: 13px; -webkit-appearance: none; appearance: none; }
.history-status { padding: 0 12px; margin: 12px 0; color: #6a6a6a; font-size: 14px; line-height: 1.65; }
.history-status:empty { display: none; }
.history-list { overflow: auto; min-height: 0; scrollbar-width: thin; }
.history-more { display: block; flex: none; margin: 12px 4px 0; min-height: 44px; padding: 10px 14px; border: 1px solid #dddddd; border-radius: 11px; font: inherit; font-size: 13px; background: #fff; color: #535353; }
.history-more:hover { background: #efefef; }
.history-more:disabled { opacity: .5; }
.history-entry { display: block; text-align: left; width: 100%; margin: 2px 0 5px; padding: 14px 12px; border: 1px solid transparent; border-radius: 12px; background: none; color: inherit; }
.history-entry:hover { background: #efefef; }
.history-entry[aria-pressed="true"] { background: #fff; border-color: #dedede; box-shadow: 0 3px 9px #25252504; }
.history-entry-title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; line-height: 1.5; }
.history-entry-date { display: block; color: #757575; font-size: 11px; line-height: 1.6; margin-top: 5px; }
.history-reader { min-width: 0; overflow: auto; outline: none; scrollbar-width: thin; padding: 28px 32px 40px; }
.history-reader:focus-visible { outline: 2px solid #a7a7a7; outline-offset: -5px; border-radius: 12px; }
.history-reader-empty { min-height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; max-width: 300px; margin: auto; }
.history-empty-icon { width: 54px; height: 54px; padding: 14px; margin: 0 0 18px; border: 1px solid #ededed; border-radius: 16px; color: #636363; background: #f9f9f9; }
.history-empty-icon svg { width: 100%; height: 100%; }
.history-reader-empty h3 { margin: 0 0 10px; font-family: Georgia, serif; font-size: 26px; line-height: 1.25; font-weight: 400; letter-spacing: -.6px; }
.history-reader-empty p { font-size: 14px; line-height: 1.7; color: #727272; margin: 0; }
.history-reader-head { padding: 0 0 23px; border-bottom: 1px solid #ededed; margin-bottom: 26px; }
.history-readonly { display: block; font-size: 11px; color: #737373; margin-bottom: 12px; }
.history-reader-head h3 { font-family: Georgia, serif; font-weight: 400; letter-spacing: -.6px; font-size: 27px; line-height: 1.25; overflow-wrap: anywhere; margin: 0 0 11px; }
.history-reader-head > p { font-size: 12px; color: #737373; margin: 0; }
.history-messages { display: flex; flex-direction: column; gap: 22px; }
.history-message { width: fit-content; max-width: 94%; min-width: 100px; }
.history-speaker { display: block; margin-bottom: 7px; color: #717171; font-size: 11px; }
.history-message p { background: #f2f2f2; border: 1px solid #eeeeee; border-radius: 4px 17px 17px; font-size: 14px; line-height: 1.75; padding: 14px 17px; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.history-message-you { margin-left: auto; }
.history-message-you .history-speaker { text-align: right; }
.history-message-you p { background: #252525; color: #fff; border-color: #252525; border-radius: 17px 17px 4px; }
.history-message-guard p, .history-message-decision p { background: #fff; border-style: dashed; color: #6a6a6a; font-size: 12px; }
.history-message-document { width: 100%; }
.history-message-document p { background: #fff; border-radius: 13px; }
@media (max-width: 760px) {
  .chat-navigation { gap: 0; }
  .chat-nav-button { width: 40px; height: 44px; padding: 10px; }
  .history-dialog { width: calc(100vw - 20px); height: calc(100dvh - 32px); border-radius: 19px; }
  .history-header { padding: 10px 12px 10px 19px; min-height: 65px; gap: 6px; }
  .history-header h2 { font-size: 18px; }
  .history-content { display: block; height: calc(100% - 65px); }
  .history-list-panel { border-right: 0; height: 100%; padding: 18px 12px; }
  .history-reader { display: none; height: 100%; padding: 22px 20px 32px; }
  .history-reading .history-list-panel { display: none; }
  .history-reading .history-reader { display: block; }
  .history-reading .history-back { display: inline-grid; }
  .history-entry { padding: 16px 12px; }
  .history-entry-title { font-size: 15px; }
  .history-message { max-width: 96%; }
}
