/* De Tectis inline message floater — separate from the forum message floater */

.dt-message-floater {
  position: fixed;
  inset: 0;
  z-index: 980;
  display: grid;
  place-items: center;
  padding: 22px;
  pointer-events: none;
}

.dt-message-floater[hidden] {
  display: none !important;
}

.dt-message-floater-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background:
    radial-gradient(circle at 50% 34%, rgba(159,230,83,.12), transparent 38%),
    rgba(0,0,0,.62);
  backdrop-filter: blur(6px);
  pointer-events: auto;
}

.dt-message-floater-panel {
  position: relative;
  z-index: 1;
  width: min(720px, calc(100vw - 34px));
  height: min(560px, calc(100vh - 34px));
  display: grid;
  grid-template-rows: 66px minmax(0, 1fr);
  border: 1px solid rgba(159,230,83,.28);
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 0%, rgba(159,230,83,.07), transparent 42%),
    linear-gradient(180deg, rgba(7,18,19,.97), rgba(1,7,8,.97));
  box-shadow: 0 34px 96px rgba(0,0,0,.72), inset 0 0 0 1px rgba(255,255,255,.014);
  overflow: hidden;
  pointer-events: auto;
}

.dt-mf-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  padding: 12px 14px 12px 18px;
  border-bottom: 1px solid rgba(159,230,83,.16);
  background:
    linear-gradient(90deg, rgba(159,230,83,.065), transparent 70%),
    rgba(1,7,8,.54);
}

.dt-mf-head span,
.dt-mf-list-head strong {
  display: block;
  color: #9fe653;
  font-family: "Rajdhani", "Inter", sans-serif;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1.7px;
  text-transform: uppercase;
}

.dt-mf-head h2 {
  margin: 4px 0 0;
  color: #eef4ec;
  font-family: "Rajdhani", "Inter", sans-serif;
  font-size: 25px;
  line-height: 1;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.dt-mf-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.dt-mf-actions a,
.dt-mf-actions button,
.dt-message-floater-restore {
  display: grid;
  place-items: center;
  border: 1px solid rgba(159,230,83,.22);
  border-radius: 50%;
  background: rgba(2,8,9,.76);
  color: #c2cec1;
  text-decoration: none;
  cursor: pointer;
}

.dt-mf-actions a,
.dt-mf-actions button {
  width: 34px;
  height: 34px;
}

.dt-mf-actions a:hover,
.dt-mf-actions button:hover,
.dt-message-floater-restore:hover {
  border-color: rgba(159,230,83,.52);
  color: #9fe653;
}

.dt-mf-body {
  min-height: 0;
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr);
}

.dt-mf-thread-list {
  min-height: 0;
  border-right: 1px solid rgba(159,230,83,.13);
  background: rgba(1,6,7,.45);
  overflow: hidden;
}

.dt-mf-list-head {
  min-height: 52px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 0 14px;
  border-bottom: 1px solid rgba(159,230,83,.10);
}

.dt-mf-list-head small {
  color: rgba(194,206,193,.70);
  font-size: 10px;
  letter-spacing: .8px;
  text-transform: uppercase;
}

.dt-mf-threads {
  height: calc(100% - 52px);
  overflow: auto;
  scrollbar-width: none;
}

.dt-mf-threads::-webkit-scrollbar,
.dt-mf-messages::-webkit-scrollbar,
.dt-mf-compose textarea::-webkit-scrollbar {
  display: none;
}

.dt-mf-thread,
.dt-mf-loading,
.dt-mf-error {
  min-height: 62px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(139,190,71,.08);
  color: #c2cec1;
  text-decoration: none;
}

.dt-mf-thread:hover,
.dt-mf-thread.active {
  background: rgba(159,230,83,.075);
}

.dt-mf-thread.active {
  box-shadow: inset 3px 0 0 rgba(159,230,83,.55);
}

.dt-mf-thread span,
.dt-mf-avatar,
.dt-mf-empty span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(159,230,83,.24);
  border-radius: 50%;
  background: rgba(159,230,83,.055);
  color: #9fe653;
  font-family: "Rajdhani", "Inter", sans-serif;
  font-weight: 900;
}

.dt-mf-thread div {
  min-width: 0;
}

.dt-mf-thread strong,
.dt-mf-thread em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dt-mf-thread strong {
  color: #eef4ec;
  font-size: 13px;
}

.dt-mf-thread em {
  color: rgba(194,206,193,.70);
  font-size: 11px;
  font-style: normal;
  margin-top: 3px;
}

.dt-mf-thread small {
  color: rgba(194,206,193,.55);
  font-size: 10px;
}

.dt-mf-thread b {
  display: inline-grid;
  place-items: center;
  min-width: 19px;
  height: 19px;
  margin-left: 5px;
  padding: 0 5px;
  border-radius: 999px;
  background: #9fe653;
  color: #061008;
  font-size: 9px;
}

.dt-mf-chat {
  min-height: 0;
  background: rgba(0,5,6,.22);
}

.dt-mf-empty {
  height: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 22px;
  text-align: center;
}

.dt-mf-empty span {
  width: 58px;
  height: 58px;
  font-size: 22px;
}

.dt-mf-empty h3 {
  margin: 0;
  color: #9fe653;
  font-family: "Rajdhani", "Inter", sans-serif;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.dt-mf-empty p {
  margin: 0;
  color: rgba(194,206,193,.72);
  font-size: 12px;
}

.dt-mf-empty a {
  min-height: 34px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(159,230,83,.25);
  border-radius: 999px;
  color: #9fe653;
  padding: 0 14px;
  text-decoration: none;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.dt-mf-conversation {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: 64px minmax(0, 1fr) auto;
}

.dt-mf-conversation[hidden] {
  display: none !important;
}

.dt-mf-conversation-head {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(159,230,83,.12);
}

.dt-mf-avatar {
  width: 46px;
  height: 46px;
}

.dt-mf-conversation-head h3,
.dt-mf-conversation-head p {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dt-mf-conversation-head h3 {
  color: #eef4ec;
  font-size: 15px;
}

.dt-mf-conversation-head p {
  margin-top: 3px;
  color: #9fe653;
  font-size: 11px;
}

.dt-mf-messages {
  min-height: 0;
  overflow: auto;
  padding: 12px 14px;
  scrollbar-width: none;
}

.dt-mf-message {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 9px;
  margin-bottom: 12px;
}

.dt-mf-message.mine {
  grid-template-columns: minmax(0, 1fr) 34px;
}

.dt-mf-message.mine .dt-mf-message-avatar {
  grid-column: 2;
}

.dt-mf-message.mine .dt-mf-bubble {
  grid-column: 1;
  grid-row: 1;
  justify-self: end;
  background: rgba(159,230,83,.10);
  border-color: rgba(159,230,83,.23);
}

.dt-mf-message-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(159,230,83,.20);
  border-radius: 50%;
  color: #9fe653;
  font-size: 12px;
  font-weight: 900;
}

.dt-mf-bubble {
  width: fit-content;
  max-width: min(100%, 430px);
  border: 1px solid rgba(139,190,71,.12);
  border-radius: 13px;
  background: rgba(4,14,15,.70);
  padding: 9px 11px;
}

.dt-mf-bubble strong,
.dt-mf-bubble time {
  display: inline-block;
  vertical-align: middle;
}

.dt-mf-bubble strong {
  color: #9fe653;
  font-size: 11px;
}

.dt-mf-bubble time {
  color: rgba(194,206,193,.55);
  font-size: 10px;
  margin-left: 6px;
}

.dt-mf-bubble p {
  margin: 6px 0 0;
  color: #d6dfd3;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.dt-mf-attachment {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  border: 1px solid rgba(159,230,83,.16);
  border-radius: 10px;
  padding: 7px;
  color: #c2cec1;
  text-decoration: none;
}

.dt-mf-attachment img {
  grid-column: 1 / -1;
  width: 100%;
  max-height: 180px;
  object-fit: contain;
  background: rgba(0,0,0,.28);
  border-radius: 8px;
}

.dt-mf-attachment span {
  color: #9fe653;
}

.dt-mf-attachment b,
.dt-mf-attachment small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dt-mf-attachment small {
  color: rgba(194,206,193,.55);
}

.dt-mf-compose {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 44px;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid rgba(159,230,83,.13);
}

.dt-mf-file-input {
  display: none;
}

.dt-mf-compose textarea {
  min-height: 46px;
  max-height: 112px;
  resize: vertical;
  border: 1px solid rgba(159,230,83,.18);
  border-radius: 12px;
  background: rgba(1,7,8,.74);
  color: #eef4ec;
  padding: 12px;
  outline: 0;
}

.dt-mf-attach,
.dt-mf-send {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  align-self: end;
  border: 1px solid rgba(159,230,83,.24);
  border-radius: 50%;
  background: rgba(159,230,83,.08);
  color: #9fe653;
  font-weight: 900;
}

.dt-mf-file-preview {
  grid-column: 1 / -1;
  border: 1px solid rgba(159,230,83,.14);
  border-radius: 10px;
  color: rgba(194,206,193,.82);
  padding: 8px 10px;
  font-size: 11px;
}

.dt-mf-file-preview[hidden] {
  display: none !important;
}

.dt-message-floater.is-minimized {
  display: block;
  inset: auto 18px 18px auto;
  width: auto;
  height: auto;
  padding: 0;
}

.dt-message-floater.is-minimized .dt-message-floater-backdrop,
.dt-message-floater.is-minimized .dt-message-floater-panel {
  display: none;
}

.dt-message-floater.is-minimized .dt-message-floater-restore {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 2;
  display: grid !important;
  grid-template-columns: 22px auto;
  gap: 8px;
  width: auto;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  pointer-events: auto;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.dt-mf-error,
.dt-mf-loading {
  grid-template-columns: 1fr;
  color: rgba(194,206,193,.70);
  font-size: 12px;
  line-height: 1.4;
}

@media (max-width: 760px) {
  .dt-message-floater {
    padding: 10px;
  }

  .dt-message-floater-panel {
    width: calc(100vw - 20px);
    height: calc(100vh - 20px);
    grid-template-rows: 62px minmax(0, 1fr);
  }

  .dt-mf-head h2 {
    font-size: 18px;
    letter-spacing: 1.5px;
  }

  .dt-mf-body {
    grid-template-columns: 1fr;
    grid-template-rows: 210px minmax(0, 1fr);
  }

  .dt-mf-thread-list {
    border-right: 0;
    border-bottom: 1px solid rgba(159,230,83,.13);
  }

  .dt-mf-threads {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(230px, 78%);
    height: auto;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .dt-mf-thread {
    border-right: 1px solid rgba(139,190,71,.08);
    border-bottom: 0;
  }

  .dt-mf-bubble {
    max-width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dt-message-floater-backdrop {
    backdrop-filter: none;
  }
}


/* -------------------------------------------------------------------------
   R9.3 — thread render visibility repair
   Author CSS display rules were overriding native [hidden] behavior on the
   empty state. Force hidden states so the selected conversation can display.
------------------------------------------------------------------------- */

.dt-message-floater[hidden],
.dt-mf-empty[hidden],
.dt-mf-conversation[hidden],
.dt-message-floater-restore[hidden],
.dt-mf-file-preview[hidden] {
  display: none !important;
}

.dt-message-floater.has-active-thread .dt-mf-empty {
  display: none !important;
}

.dt-message-floater.has-active-thread .dt-mf-conversation {
  display: grid !important;
}

.dt-message-floater:not(.is-minimized) .dt-message-floater-restore {
  display: none !important;
}

.dt-mf-messages .dt-mf-loading,
.dt-mf-messages .dt-mf-error {
  display: block;
  min-height: auto;
  border: 1px solid rgba(159,230,83,.14);
  border-radius: 12px;
  margin: 8px 0;
  padding: 12px;
  background: rgba(2,8,9,.48);
}


/* -------------------------------------------------------------------------
   R9.4 — splash buffer expansion
   Shows the original bridge splash for 1.4 seconds, loads conversations during
   the buffer, then expands into the full De Tectis message floater.
------------------------------------------------------------------------- */

.dt-message-floater {
  --dt-mf-buffer-ms: 1400ms;
}

.dt-message-floater-splash {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  align-content: center;
  width: min(360px, calc(100vw - 40px));
  min-height: 158px;
  border: 1px solid rgba(159,230,83,.30);
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 0%, rgba(159,230,83,.10), transparent 42%),
    linear-gradient(180deg, rgba(6,18,18,.97), rgba(2,8,9,.96));
  box-shadow: 0 34px 90px rgba(0,0,0,.68);
  padding: 22px;
  text-align: center;
  opacity: 0;
  transform: scale(.965);
  pointer-events: none;
}

.dt-message-floater-splash[hidden] {
  display: none !important;
}

.dt-message-floater-splash span {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin: 0 auto 12px;
  border: 1px solid rgba(159,230,83,.32);
  border-radius: 50%;
  color: #9fe653;
  font-size: 24px;
  box-shadow: 0 0 32px rgba(159,230,83,.08);
}

.dt-message-floater-splash strong {
  display: block;
  color: #9fe653;
  font-family: "Rajdhani", "Inter", sans-serif;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}

.dt-message-floater-splash em {
  display: block;
  margin-top: 7px;
  color: #c2cec1;
  font-size: 12px;
  font-style: normal;
  line-height: 1.45;
}

.dt-message-floater.is-buffering .dt-message-floater-splash {
  opacity: 1;
  transform: scale(1);
  transition: opacity .20s ease, transform .20s ease;
}

.dt-message-floater.is-buffering .dt-message-floater-panel {
  opacity: 0;
  transform: scale(.84);
  pointer-events: none;
}

.dt-message-floater.is-panel-ready .dt-message-floater-panel {
  opacity: 1;
  transform: scale(1);
  transition: opacity .22s ease, transform .24s cubic-bezier(.2,.8,.2,1);
}

.dt-message-floater-panel {
  transform-origin: center center;
}

@media (max-width: 760px) {
  .dt-message-floater-splash {
    width: min(340px, calc(100vw - 28px));
    min-height: 146px;
    padding: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dt-message-floater.is-buffering .dt-message-floater-splash,
  .dt-message-floater.is-panel-ready .dt-message-floater-panel {
    transition: none;
  }

  .dt-message-floater.is-buffering .dt-message-floater-panel {
    transform: none;
  }
}
