/* MCT Aether 1.0 — isolated floating website assistant */
#mct-aether-launcher,
#mct-aether-panel,
#mct-aether-panel * {
  box-sizing: border-box;
}
#mct-aether-launcher {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9998;
  width: 62px;
  height: 62px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #155eef, #08b8d8);
  box-shadow: 0 12px 34px rgba(10, 78, 180, .34);
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}
#mct-aether-launcher:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 38px rgba(10, 78, 180, .42);
}
#mct-aether-launcher svg { width: 29px; height: 29px; }
#mct-aether-panel {
  position: fixed;
  right: 24px;
  bottom: 98px;
  z-index: 9999;
  width: min(380px, calc(100vw - 28px));
  height: min(570px, calc(100dvh - 125px));
  min-height: 390px;
  display: none;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(130, 166, 210, .28);
  border-radius: 20px;
  background: #f8fbff;
  color: #14243d;
  box-shadow: 0 22px 70px rgba(4, 22, 52, .28);
  font-family: Manrope, Arial, sans-serif;
}
#mct-aether-panel.is-open { display: flex; animation: mctAetherIn .18s ease-out; }
@keyframes mctAetherIn {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
#mct-aether-header {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 16px;
  color: #fff;
  background: linear-gradient(120deg, #071d43, #123f78);
}
#mct-aether-mark {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: #7deaff;
  background: rgba(91, 190, 255, .15);
  border: 1px solid rgba(125, 234, 255, .24);
}
#mct-aether-mark svg { width: 23px; height: 23px; }
#mct-aether-heading { min-width: 0; flex: 1; }
#mct-aether-heading strong { display: block; font-size: 14px; font-weight: 800; letter-spacing: -.2px; }
#mct-aether-heading span { display: block; margin-top: 3px; color: #a9c9e9; font-size: 10px; }
#mct-aether-status { display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: #42e6a4; }
#mct-aether-close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 9px;
  color: #eaf4ff;
  background: rgba(255,255,255,.1);
  font-size: 21px;
  cursor: pointer;
}
#mct-aether-messages {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding: 17px 14px;
  background: linear-gradient(180deg, #f8fbff, #f2f7fd);
}
.mct-aether-message {
  max-width: 88%;
  padding: 11px 13px;
  border-radius: 14px;
  font-size: 12px;
  line-height: 1.65;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.mct-aether-message.assistant {
  align-self: flex-start;
  color: #243a56;
  background: #fff;
  border: 1px solid #e4ebf4;
  border-bottom-left-radius: 5px;
}
.mct-aether-message.user {
  align-self: flex-end;
  color: #fff;
  background: linear-gradient(135deg, #175ee8, #287de8);
  border-bottom-right-radius: 5px;
}
.mct-aether-message.error { color: #9b2c2c; background: #fff1f1; border-color: #ffdada; }
#mct-aether-compose {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #e4ebf4;
  background: #fff;
}
#mct-aether-input {
  flex: 1;
  min-width: 0;
  min-height: 42px;
  max-height: 100px;
  resize: none;
  padding: 12px 13px;
  border: 1px solid #dce6f1;
  border-radius: 13px;
  outline: none;
  color: #14243d;
  background: #f7faff;
  font: 12px/1.45 Manrope, Arial, sans-serif;
}
#mct-aether-input:focus { border-color: #5595ef; box-shadow: 0 0 0 3px rgba(48, 126, 230, .1); }
#mct-aether-send {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 13px;
  color: #fff;
  background: #1767e8;
  cursor: pointer;
}
#mct-aether-send:disabled { opacity: .55; cursor: wait; }
#mct-aether-send svg { width: 18px; height: 18px; }
#mct-aether-footnote {
  padding: 0 12px 10px;
  color: #8091a7;
  background: #fff;
  text-align: center;
  font: 9px Manrope, Arial, sans-serif;
}
@media (max-width: 480px) {
  #mct-aether-launcher { right: 16px; bottom: 16px; width: 56px; height: 56px; }
  #mct-aether-panel { right: 10px; bottom: 82px; width: calc(100vw - 20px); height: min(590px, calc(100dvh - 100px)); }
}
@media (prefers-reduced-motion: reduce) {
  #mct-aether-launcher, #mct-aether-panel.is-open { animation: none; transition: none; }
}


/* Markdown formatting and safe, directly clickable links in Aether replies */
#mct-aether-messages .mct-aether-message.assistant p { margin: 0 0 7px; }
#mct-aether-messages .mct-aether-message.assistant p:last-child { margin-bottom: 0; }
#mct-aether-messages .mct-aether-message.assistant strong { font-weight: 800; color: #102d52; }
#mct-aether-messages .mct-aether-message.assistant em { font-style: italic; }
#mct-aether-messages .mct-aether-message.assistant h1,
#mct-aether-messages .mct-aether-message.assistant h2,
#mct-aether-messages .mct-aether-message.assistant h3 { margin: 7px 0 5px; line-height: 1.3; color: #102d52; }
#mct-aether-messages .mct-aether-message.assistant h1 { font-size: 17px; }
#mct-aether-messages .mct-aether-message.assistant h2 { font-size: 15px; }
#mct-aether-messages .mct-aether-message.assistant h3 { font-size: 13px; }
#mct-aether-messages .mct-aether-message.assistant ul,
#mct-aether-messages .mct-aether-message.assistant ol { margin: 5px 0 8px; padding-left: 21px; }
#mct-aether-messages .mct-aether-message.assistant li { margin: 2px 0; }
#mct-aether-messages .mct-aether-message.assistant blockquote { margin: 7px 0; padding: 5px 9px; border-left: 3px solid #5b9af0; background: #f1f6fd; border-radius: 4px; }
#mct-aether-messages .mct-aether-message.assistant hr { border: 0; border-top: 1px solid #dce6f1; margin: 8px 0; }
#mct-aether-messages .mct-aether-message.assistant code { padding: 1px 4px; border-radius: 4px; background: #edf2f8; color: #17477c; font-family: Consolas, monospace; font-size: .92em; }
#mct-aether-messages .mct-aether-message.assistant pre { max-width: 100%; overflow-x: auto; padding: 9px; border-radius: 8px; background: #10243d; color: #edf6ff; white-space: pre; }
#mct-aether-messages .mct-aether-message.assistant pre code { padding: 0; background: transparent; color: inherit; }
#mct-aether-messages .mct-aether-message.assistant a.mct-aether-link { color: #075ecb; text-decoration: underline; text-underline-offset: 2px; font-weight: 700; overflow-wrap: anywhere; cursor: pointer; }
#mct-aether-messages .mct-aether-message.assistant a.mct-aether-link:hover { color: #003f91; }

/* Keep the Aether message composer visually identical on every MCT page,
   regardless of page-level form/input styles. */
#mct-aether-panel #mct-aether-compose {
  display: flex !important;
  align-items: flex-end !important;
  gap: 8px !important;
  padding: 12px !important;
  border: 0 !important;
  border-top: 1px solid #e4ebf4 !important;
  border-radius: 0 !important;
  background: #fff !important;
  box-shadow: none !important;
}
#mct-aether-panel #mct-aether-input {
  display: block !important;
  flex: 1 1 auto !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 42px !important;
  max-height: 100px !important;
  margin: 0 !important;
  resize: none !important;
  padding: 12px 13px !important;
  border: 1px solid #dce6f1 !important;
  border-radius: 13px !important;
  outline: none !important;
  color: #14243d !important;
  background: #f7faff !important;
  box-shadow: none !important;
  font: 12px/1.45 Manrope, Arial, sans-serif !important;
  letter-spacing: normal !important;
  text-transform: none !important;
}
#mct-aether-panel #mct-aether-input:focus {
  border-color: #5595ef !important;
  box-shadow: 0 0 0 3px rgba(48, 126, 230, .1) !important;
}
#mct-aether-panel #mct-aether-input::placeholder {
  color: #8292a8 !important;
  opacity: 1 !important;
}
#mct-aether-panel #mct-aether-send {
  flex: 0 0 42px !important;
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 13px !important;
  box-shadow: none !important;
}

/* Hide the composer scrollbar while keeping textarea scrolling functional. */
#mct-aether-panel #mct-aether-input {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}
#mct-aether-panel #mct-aether-input::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}


/* Compact Aether chat actions */
#mct-aether-clear,
#mct-aether-stop {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 9px;
  color: #eaf4ff;
  background: rgba(255,255,255,.1);
  font-size: 13px;
  cursor: pointer;
}
#mct-aether-stop[hidden] { display: none !important; }
#mct-aether-messages .mct-aether-copy {
  display: block;
  margin: 8px 0 0 auto;
  padding: 4px 9px;
  border: 1px solid #dce6f1;
  border-radius: 7px;
  color: #315579;
  background: #f7faff;
  font: 10px Manrope, Arial, sans-serif;
  cursor: pointer;
}
#mct-aether-messages .mct-aether-copy:hover {
  border-color: #8bb8ef;
  background: #edf5ff;
}


/* Use the repository's official Aether logo in the launcher and chat header. */
#mct-aether-launcher {
  padding: 8px;
  background: linear-gradient(135deg, #071d43, #123f78);
}
#mct-aether-launcher .mct-aether-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
}
#mct-aether-mark {
  overflow: hidden;
  background: rgba(255,255,255,.96);
  border-color: rgba(255,255,255,.35);
}
#mct-aether-mark .mct-aether-logo {
  display: block;
  width: 100%;
  height: 100%;
  padding: 4px;
  object-fit: contain;
  border-radius: 11px;
}
