/* Personal history interaction adapted to enterprise ACLs; native modal focus. */
.history-button {
  display: flex;
}
.conversation-history {
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 20px;
  margin: auto;
  width: min(440px, calc(100vw - 24px));
  max-height: min(740px, calc(100dvh - 32px));
  overflow: auto;
  box-shadow: 0 24px 100px #0005;
}
.conversation-history::backdrop {
  background: #0007;
  backdrop-filter: blur(3px);
}
.conversation-history header,
.conversation-history article,
.new-conversation,
.history-select,
.conversation-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}
.conversation-history header {
  justify-content: space-between;
  margin-bottom: 18px;
}
.conversation-history h2 {
  font-size: 18px;
  margin: 0;
}
.conversation-history button {
  min-height: 40px;
  padding: 9px;
  border-radius: 10px;
}
.conversation-history button:hover {
  background: var(--soft);
}
.new-conversation {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--soft);
}
.history-search {
  display: block;
  font-size: 12px;
  margin-top: 16px;
}
.history-search input,
.history-list input {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  color: var(--ink);
  background: var(--page);
  margin: 6px 0;
}
.history-archive {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 15px 0;
  font-size: 13px;
}
.history-list {
  min-height: 100px;
}
.history-list h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 20px 8px 6px;
}
.history-list article {
  gap: 2px;
  border-radius: 10px;
}
.history-list article:hover {
  background: var(--soft);
}
.history-list form {
  width: 100%;
}
.history-select {
  flex: 1;
  min-width: 0;
  text-align: left;
  font-size: 14px;
}
.history-select svg {
  flex-shrink: 0;
}
.history-select span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.history-privacy {
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 18px;
}
.conversation-heading {
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
  padding: 16px 24px;
}
.conversation-heading span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.conversation-heading button,
.older-messages {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
}
.older-messages {
  display: block;
  margin: 12px auto;
}
.message.status {
  border-left: 2px solid var(--accent);
  color: var(--muted);
}
@media (max-width: 767px) {
  .conversation-history {
    margin: 0;
    width: min(86vw, 360px);
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0 20px 20px 0;
    padding-top: max(20px, env(safe-area-inset-top));
  }
}
