/* OmniMod virtual assistant ------------------------------------------------ */
.omni-assistant {
  position: fixed;
  z-index: 260;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  font-family: var(--body, Inter, system-ui, sans-serif);
  color: var(--silver-2, #eeedf5);
}

.omni-assistant * {
  box-sizing: border-box;
}

.omni-assistant button,
.omni-assistant input,
.omni-assistant textarea {
  font: inherit;
}

.assistant-launcher {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-height: 56px;
  padding: 10px 14px 10px 10px;
  border: 1px solid rgba(185, 168, 255, 0.42);
  border-radius: 999px;
  background:
    radial-gradient(circle at 35% 0%, rgba(187, 170, 255, 0.18), transparent 42%),
    linear-gradient(145deg, rgba(24, 18, 39, 0.96), rgba(11, 9, 17, 0.96));
  color: var(--silver-2, #eeedf5);
  box-shadow:
    0 22px 70px -34px rgba(124, 77, 255, 0.95),
    0 16px 44px -28px #000,
    inset 0 1px rgba(255, 255, 255, 0.08);
  cursor: pointer;
  backdrop-filter: blur(18px);
  transition: transform 0.22s var(--ease, ease), border-color 0.22s, box-shadow 0.22s;
}

.assistant-launcher:hover {
  transform: translateY(-2px);
  border-color: rgba(222, 213, 255, 0.68);
  box-shadow:
    0 26px 82px -32px rgba(124, 77, 255, 1),
    0 18px 46px -30px #000,
    inset 0 1px rgba(255, 255, 255, 0.1);
}

.assistant-launcher-mark {
  position: relative;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(185, 168, 255, 0.26);
  border-radius: 14px;
  background: rgba(124, 77, 255, 0.11);
}

.assistant-launcher-mark::after {
  content: "";
  position: absolute;
  right: -1px;
  top: -1px;
  width: 9px;
  height: 9px;
  border: 2px solid #111117;
  border-radius: 999px;
  background: var(--green, #6fe0a5);
  box-shadow: 0 0 14px rgba(111, 224, 165, 0.85);
}

.assistant-launcher-mark img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(124, 77, 255, 0.7));
}

.assistant-launcher-text {
  display: grid;
  gap: 2px;
  text-align: left;
}

.assistant-launcher-text strong {
  color: var(--white, #f8f7fc);
  font-size: 0.82rem;
  line-height: 1.1;
}

.assistant-launcher-text span {
  color: var(--muted, #646271);
  font-family: var(--mono, monospace);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
}

.assistant-panel {
  position: absolute;
  right: 0;
  bottom: 72px;
  width: min(420px, calc(100vw - 28px));
  max-height: min(680px, calc(100vh - 110px));
  display: none;
  overflow: hidden;
  border: 1px solid rgba(185, 168, 255, 0.32);
  border-radius: 22px;
  background:
    radial-gradient(circle at 75% -8%, rgba(124, 77, 255, 0.2), transparent 34%),
    linear-gradient(180deg, rgba(20, 17, 29, 0.98), rgba(9, 8, 13, 0.98));
  box-shadow:
    0 42px 120px -52px rgba(124, 77, 255, 0.95),
    0 34px 90px -50px #000,
    inset 0 1px rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(22px);
}

.omni-assistant.open .assistant-panel {
  display: grid;
  grid-template-rows: auto 1fr auto;
  animation: assistantRise 0.24s var(--ease, ease);
}

.assistant-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 17px 17px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.assistant-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.assistant-title-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(185, 168, 255, 0.22);
  border-radius: 14px;
  background: rgba(124, 77, 255, 0.1);
}

.assistant-title-mark img {
  width: 25px;
  filter: drop-shadow(0 0 9px rgba(124, 77, 255, 0.62));
}

.assistant-title strong,
.assistant-title span {
  display: block;
}

.assistant-title strong {
  color: var(--white, #f8f7fc);
  font-family: var(--display, system-ui, sans-serif);
  font-size: 1rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.assistant-title span {
  color: var(--muted, #646271);
  font-family: var(--mono, monospace);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.assistant-close {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--steel, #92909f);
  cursor: pointer;
  transition: color 0.18s, background 0.18s, border-color 0.18s;
}

.assistant-close:hover {
  color: var(--white, #f8f7fc);
  border-color: rgba(185, 168, 255, 0.32);
  background: rgba(124, 77, 255, 0.09);
}

.assistant-close svg {
  width: 17px;
  height: 17px;
}

.assistant-body {
  min-height: 0;
  padding: 14px 14px 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(124, 77, 255, 0.35) transparent;
}

.assistant-body::-webkit-scrollbar {
  width: 6px;
}

.assistant-body::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(124, 77, 255, 0.3);
}

.assistant-thread {
  display: grid;
  gap: 10px;
  padding-bottom: 13px;
}

.assistant-message {
  display: grid;
  gap: 8px;
  max-width: 92%;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.032);
  color: var(--silver, #c9c7d4);
  font-size: 0.82rem;
  line-height: 1.55;
}

.assistant-message p {
  margin: 0;
}

.assistant-steps {
  margin: 2px 0 0;
  padding-left: 18px;
  color: rgba(236, 229, 255, 0.8);
  line-height: 1.45;
}

.assistant-steps li + li {
  margin-top: 6px;
}

.assistant-message .assistant-evidence {
  margin-top: 2px;
  color: rgba(176, 139, 255, 0.9);
  font-size: 0.78rem;
}

.assistant-message.bot {
  justify-self: start;
}

.assistant-message.user {
  justify-self: end;
  border-color: rgba(185, 168, 255, 0.28);
  background: rgba(124, 77, 255, 0.1);
  color: var(--silver-2, #eeedf5);
}

.assistant-message-title {
  color: var(--white, #f8f7fc);
  font-family: var(--display, system-ui, sans-serif);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.25;
}

.assistant-actions,
.assistant-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.assistant-chip,
.assistant-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 8px 10px;
  border: 1px solid rgba(185, 168, 255, 0.2);
  border-radius: 999px;
  background: rgba(124, 77, 255, 0.055);
  color: var(--violet-2, #bbaaff);
  font-family: var(--mono, monospace);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, color 0.18s;
}

.assistant-chip:hover,
.assistant-action:hover {
  border-color: rgba(222, 213, 255, 0.48);
  background: rgba(124, 77, 255, 0.13);
  color: var(--white, #f8f7fc);
}

.assistant-action.primary {
  color: #0c0a13;
  border-color: rgba(218, 208, 255, 0.45);
  background: linear-gradient(180deg, #cbbfff, #9b7fff 44%, #7c4dff);
}

.assistant-context {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
  padding: 11px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 15px;
  background: rgba(0, 0, 0, 0.12);
}

.assistant-context-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted, #646271);
  font-family: var(--mono, monospace);
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.assistant-context-row strong {
  color: var(--silver-2, #eeedf5);
  font-family: var(--body, Inter, system-ui, sans-serif);
  font-size: 0.72rem;
  letter-spacing: 0;
  text-transform: none;
  text-align: right;
}

.assistant-footer {
  padding: 13px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.12);
}

.assistant-form {
  display: grid;
  grid-template-columns: 1fr 42px;
  gap: 8px;
}

.assistant-input,
.assistant-ticket-form input,
.assistant-ticket-form textarea {
  width: 100%;
  border: 1px solid rgba(185, 168, 255, 0.18);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--silver-2, #eeedf5);
  outline: none;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
}

.assistant-input {
  min-height: 42px;
  padding: 0 12px;
  font-size: 0.82rem;
}

.assistant-input::placeholder,
.assistant-ticket-form input::placeholder,
.assistant-ticket-form textarea::placeholder {
  color: rgba(201, 199, 212, 0.46);
}

.assistant-input:focus,
.assistant-ticket-form input:focus,
.assistant-ticket-form textarea:focus {
  border-color: rgba(185, 168, 255, 0.5);
  background: rgba(124, 77, 255, 0.055);
  box-shadow: 0 0 0 3px rgba(124, 77, 255, 0.12);
}

.assistant-send {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(218, 208, 255, 0.45);
  border-radius: 13px;
  background: linear-gradient(180deg, #cbbfff, #9b7fff 44%, #7c4dff);
  color: #0c0a13;
  cursor: pointer;
  box-shadow: 0 13px 34px -18px rgba(124, 77, 255, 0.95);
}

.assistant-send svg {
  width: 18px;
  height: 18px;
}

.assistant-ticket {
  display: none;
  margin-top: 10px;
  padding: 11px;
  border: 1px solid rgba(185, 168, 255, 0.16);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.025);
}

.assistant-ticket.open {
  display: block;
}

.assistant-ticket-form {
  display: grid;
  gap: 8px;
}

.assistant-ticket-form input {
  min-height: 38px;
  padding: 0 11px;
  font-size: 0.78rem;
}

.assistant-ticket-form textarea {
  min-height: 88px;
  resize: vertical;
  padding: 10px 11px;
  font-size: 0.78rem;
  line-height: 1.55;
}

.assistant-ticket-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.assistant-ticket-actions button {
  min-height: 38px;
  border-radius: 11px;
}

.assistant-statusline {
  margin: 8px 0 0;
  color: var(--muted, #646271);
  font-family: var(--mono, monospace);
  font-size: 0.6rem;
  line-height: 1.45;
}

@keyframes assistantRise {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
}

@media (max-width: 560px) {
  .omni-assistant {
    right: 14px;
    bottom: 14px;
  }

  .assistant-launcher {
    min-height: 52px;
    padding-right: 12px;
  }

  .assistant-launcher-text span {
    display: none;
  }

  .assistant-panel {
    right: -1px;
    bottom: 66px;
    width: calc(100vw - 28px);
    max-height: min(620px, calc(100vh - 96px));
  }

  .assistant-ticket-actions {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .omni-assistant *,
  .omni-assistant *::before,
  .omni-assistant *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
