/* AdminModal Component Styles */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal.show {
  display: flex;
}

.modal-dialog {
  background: var(--clr-surface);
  color: var(--clr-text);
  border-radius: 1rem;
  width: min(900px, 92vw);
  max-height: 80vh;
  overflow: auto;
  padding: 1rem 1.2rem;
  border: 1px solid var(--clr-border);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.modal-close {
  border: none;
  background: transparent;
  color: var(--clr-text);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  line-height: 1;
  border-radius: 0.25rem;
  transition: background-color 0.2s;
}

.modal-close:hover {
  background: var(--clr-panel);
}

/* Conversation Messages */
:root {
  --ui-font-stack: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans",
    "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji",
    "Noto Color Emoji", "Noto Sans Symbols 2";
}

.conv-msg,
.conv-msg pre {
  font-family: var(--ui-font-stack) !important;
}

.conv-msg {
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--clr-border);
  border-radius: 0.6rem;
  margin: 0.4rem 0;
}

.conv-msg .meta {
  font-size: 0.78rem;
  color: var(--clr-subtle);
  margin-bottom: 0.2rem;
}

.conv-msg.user {
  background: var(--clr-panel);
}

.conv-msg.assistant {
  background: color-mix(in oklab, var(--clr-accent) 10%, var(--clr-panel));
}

/* HTML content in messages */
.msg-html table,
.qpoqqcc-table {
  width: 100%;
  border-collapse: collapse;
}

.msg-html th,
.msg-html td,
.qpoqqcc-table th,
.qpoqqcc-table td {
  border: 1px solid var(--clr-border);
  padding: 0.45rem 0.6rem;
  vertical-align: top;
}

.msg-html th,
.qpoqqcc-table th {
  background: var(--clr-panel);
  color: var(--clr-text);
}

.msg-html td,
.qpoqqcc-table td {
  color: var(--clr-text);
}

.msg-html ul,
.msg-html ol {
  margin: 0.3rem 0 0.6rem 1.2rem;
}

.msg-html p {
  margin: 0.3rem 0;
}

/* Responsive */
@media (max-width: 768px) {
  .modal-dialog {
    width: 95vw;
    max-height: 85vh;
    padding: 0.75rem 1rem;
  }
}
