/* The closed assistant occupies its own space beside the page actions. */
.lux-chat-launcher {
  position: static;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: auto;
  max-width: 100%;
  min-height: 48px;
  padding: 6px 14px;
  margin: 0;
  color: #e8edf2;
  background: #13202c;
  border: 1px solid #42617b;
  border-radius: 12px;
  cursor: pointer;
  font: 600 1rem/1.4 Arial, Helvetica, sans-serif;
  text-align: center;
}
.lux-chat-launcher img { flex: 0 0 36px; width: 36px; height: 36px; object-fit: cover; object-position: center 10%; border-radius: 50%; }
.lux-chat-launcher span { overflow-wrap: anywhere; }
.lux-chat-entry { display: flex; justify-content: flex-end; padding: 12px 20px; }
.lux-chat-launcher:focus-visible,.lux-chat :focus-visible { outline: 3px solid #78b9d6; outline-offset: 3px; }
.lux-chat-launcher:hover { background: #203447; }
.lux-chat-launcher[hidden],dialog.lux-chat:not([open]) { display: none; }
.lux-chat,.lux-chat * { box-sizing: border-box; }
/* Native modal: one viewport-sized grid, with only the transcript scrolling. */
dialog.lux-chat[open] {
  position: fixed;
  inset: 0;
  margin: auto;
  display: grid;
  grid-template-rows: auto auto minmax(0,1fr) auto auto;
  width: min(430px,calc(100vw - 24px));
  height: min(700px,calc(100dvh - 24px - env(safe-area-inset-bottom)));
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 24px - env(safe-area-inset-bottom));
  min-width: 0;
  padding: 0;
  overflow: hidden;
  color: #e8edf2;
  background: #091018;
  border: 1px solid #42617b;
  border-radius: 18px;
  box-shadow: 0 24px 70px #0009;
  font: 1rem/1.5 Arial, Helvetica, sans-serif;
  letter-spacing: normal;
  text-align: left;
}
.lux-chat::backdrop { background: #03070bb3; }
.lux-chat-header { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid #2e4050; }
.lux-chat-avatar { flex: 0 0 44px; width: 44px; height: 44px; object-fit: cover; object-position: center 10%; border-radius: 50%; }
.lux-chat-title { display: grid; min-width: 0; gap: 3px; overflow-wrap: anywhere; }
.lux-chat-title strong { font-size: 1rem; line-height: 1.4; }
.lux-chat-title span { color: #a7b5c2; font-size: .875rem; line-height: 1.4; }
.lux-chat-close { flex: 0 0 44px; width: 44px; height: 44px; margin-left: auto; padding: 0; color: #fff; background: #182431; border: 1px solid #42617b; border-radius: 50%; cursor: pointer; font: 1.5rem/1 Arial,sans-serif; }
.lux-chat-intro { padding: 10px 16px; color: #aebbc6; border-bottom: 1px solid #2e4050; font-size: .875rem; line-height: 1.5; max-height: 20dvh; overflow: auto; }
.lux-chat-intro a { color: #f3cf63; }
.lux-chat-log { min-width: 0; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 12px 16px; scrollbar-color: #3f5263 #091018; }
.lux-chat-message { padding: 12px 14px; border-radius: 12px; background: #172a3b; margin: 0 0 10px; font-size: 1rem; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.lux-chat-message.user { background: #15477a; margin-left: 20px; }
.lux-chat-compose { display: grid; gap: 6px; padding: 12px 16px; border-top: 1px solid #2e4050; margin: 0; }
.lux-chat-compose label { margin: 0; color: #b0beca; font-size: .875rem; line-height: 1.5; }
.lux-chat-compose > div { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
.lux-chat-compose input { min-width: 0; width: 100%; min-height: 48px; padding: 10px 12px; margin: 0; color: #fff; background: #070d13; border: 1px solid #526372; border-radius: 12px; font: inherit; }
.lux-chat-compose input::placeholder { color: #a7b5c2; }
.lux-chat-compose button { min-height: 48px; padding: 10px 12px; color: #06101a; background: #f3cf63; border: 0; border-radius: 12px; cursor: pointer; font: 600 1rem/1.4 Arial,sans-serif; }
.lux-chat-compose button:disabled { opacity: .6; cursor: wait; }
.lux-chat-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; padding: 10px 16px; border-top: 1px solid #2e4050; }
.lux-chat-actions a,.lux-chat-link { display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 44px; padding: 8px 12px; border: 1px solid #42617b; border-radius: 10px; color: #e8edf2; background: #13202c; font: 600 .875rem/1.4 Arial,sans-serif; text-align: center; text-decoration: none; overflow-wrap: anywhere; }
.lux-chat-link { margin-bottom: 8px; color: #f3cf63; }
@media(max-width:380px) {
  .lux-chat-header,.lux-chat-compose,.lux-chat-actions,.lux-chat-log { padding: 10px 12px; }
  .lux-chat-compose > div { grid-template-columns: minmax(0,1fr); }
}
@media(max-height:500px) {
  .lux-chat-intro { display: none; }
  dialog.lux-chat[open] { grid-template-rows: auto minmax(0,1fr) auto auto; }
  .lux-chat-header,.lux-chat-compose,.lux-chat-actions { padding-block: 6px; }
}
