/* Assistant launcher, drawer, messages, model/key controls, and assistant responsive rules. */

.assistant-launcher{
  position: fixed;
  right: clamp(18px, calc((100vw - 1200px) / 4 - 32px), 132px);
  top: 50%;
  transform: translateY(-50%);
  width: 64px;
  height: 64px;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(12,16,26,0.94), rgba(23,29,44,0.96));
  box-shadow: 0 22px 44px rgba(0,0,0,0.34), 0 0 0 1px rgba(255,255,255,0.03) inset;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 60;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
  backdrop-filter: blur(14px);
}

.assistant-launcher:hover{
  transform: translateY(-50%) scale(1.03);
  border-color: rgba(125,211,252,0.34);
  box-shadow: 0 28px 56px rgba(0,0,0,0.42), 0 0 0 1px rgba(125,211,252,0.08) inset;
}

.assistant-launcher img{
  width: 63px;
  height: 63px;
  object-fit: cover;
  border-radius: 16px;
}

.assistant-backdrop{
  position: fixed;
  inset: 0;
  background: transparent;
  backdrop-filter: none;
  pointer-events: none;
  z-index: 69;
}

.assistant-drawer{
  position: fixed;
  top: 18px;
  right: 18px;
  width: min(348px, calc(100vw - 28px));
  height: calc(100vh - 36px);
  transform: translateX(calc(100% + 28px));
  opacity: 0;
  pointer-events: none;
  transition: transform 220ms ease, opacity 180ms ease;
  z-index: 70;
}

.assistant-drawer.is-open{
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.assistant-shell{
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px 18px 16px;
  border-radius: 26px;
  border: 1px solid rgba(255,255,255,0.12);
  background:
    linear-gradient(180deg, rgba(14,18,28,0.98), rgba(11,15,24,0.98)),
    radial-gradient(120% 100% at 100% 0%, rgba(125,211,252,0.11), transparent 54%),
    radial-gradient(120% 100% at 0% 100%, rgba(167,139,250,0.10), transparent 58%);
  box-shadow: 0 34px 68px rgba(0,0,0,0.46), 0 0 0 1px rgba(255,255,255,0.02) inset;
  backdrop-filter: blur(20px);
}

.assistant-shell-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.assistant-shell-brand{
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.assistant-shell-logo{
  width: 44px;
  height: 44px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 12px 24px rgba(0,0,0,0.28);
}

.assistant-shell-title{
  color: rgba(244,248,255,0.96);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.assistant-close{
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  color: rgba(231,240,251,0.82);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.assistant-close:hover{
  background: rgba(255,255,255,0.08);
  color: rgba(248,251,255,0.98);
}

.assistant-meta-label{
  margin-bottom: 6px;
  color: rgba(197,214,232,0.58);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.assistant-meta-value{
  color: rgba(237,244,255,0.92);
  font-size: 12px;
  line-height: 1.45;
}

.assistant-onboarding,
.assistant-model-block,
.assistant-footer{
  padding: 12px 13px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.035);
}

.assistant-onboarding{
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.assistant-main{
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.assistant-main[hidden]{
  display: none;
}

.assistant-onboarding.is-hidden{
  display: none !important;
}

.assistant-main.is-visible{
  display: flex !important;
}

.assistant-section-divider{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 2px;
}

.assistant-section-divider::before,
.assistant-section-divider::after{
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: linear-gradient(90deg, rgba(255,255,255,0.04), rgba(255,255,255,0.14), rgba(255,255,255,0.04));
}

.assistant-section-divider-label{
  color: rgba(164,214,255,0.88);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.assistant-key-wrap{
  position: relative;
}

.assistant-provider-input,
.assistant-provider-select{
  width: 100%;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  color: rgba(241,247,255,0.94);
  font-size: 12px;
  font-family: var(--font-body);
}

.assistant-provider-input{
  padding: 10px 12px;
  padding-right: 42px;
}

.assistant-key-wrap.is-invalid .assistant-provider-input{
  border-color: rgba(248,113,113,0.48);
  box-shadow: 0 0 0 1px rgba(248,113,113,0.14) inset;
}

.assistant-key-wrap.is-valid .assistant-provider-input{
  border-color: rgba(74,222,128,0.48);
  box-shadow: 0 0 0 1px rgba(74,222,128,0.12) inset;
}

.assistant-key-check{
  position: absolute;
  top: 50%;
  right: 13px;
  transform: translateY(-50%);
  color: rgba(74,222,128,0.98);
  font-size: 18px;
  font-weight: 800;
}

.assistant-provider-select{
  min-height: 38px;
  padding: 0 12px;
}

.assistant-provider-status{
  color: rgba(196,214,233,0.66);
  font-size: 11px;
  line-height: 1.4;
}

.assistant-provider-status[data-tone="success"]{
  color: rgba(134,239,172,0.95);
}

.assistant-provider-status[data-tone="error"]{
  color: rgba(253,186,116,0.95);
}

.assistant-messages{
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 4px;
}

.assistant-message{
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 13px 14px 12px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(150deg, rgba(255,255,255,0.05), rgba(255,255,255,0.025));
  box-shadow: 0 10px 22px rgba(0,0,0,0.14);
}

.assistant-message.user{
  align-self: flex-end;
  background: linear-gradient(150deg, rgba(56,189,248,0.13), rgba(56,189,248,0.06));
  border-color: rgba(56,189,248,0.14);
}

.assistant-message-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.assistant-role{
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(152,214,255,0.82);
}

.assistant-message.user .assistant-role{
  color: rgba(191,229,255,0.88);
}

.assistant-message-body{
  color: rgba(238,245,255,0.94);
  font-size: 13px;
  line-height: 1.58;
  white-space: normal;
}

.assistant-message-body p{
  margin: 0 0 10px;
}

.assistant-message-body p:last-child{
  margin-bottom: 0;
}

.assistant-message-body ul{
  margin: 0;
  padding-left: 18px;
}

.assistant-message-body li + li{
  margin-top: 6px;
}

.assistant-message-body pre{
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(10,14,22,0.72);
  overflow: auto;
  white-space: pre;
}

.assistant-message-body code{
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.assistant-tool-trace{
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.assistant-tool-chip{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.035);
  color: rgba(206,223,240,0.82);
  font-size: 11px;
  line-height: 1.25;
}

.assistant-tool-chip b{
  color: rgba(238,245,255,0.94);
  font-weight: 700;
}

.assistant-compose{
  padding-top: 2px;
  border-top: 1px solid rgba(255,255,255,0.07);
}

.assistant-footer{
  margin-top: auto;
}

#assistantInput{
  min-height: 88px;
  max-height: 168px;
  padding: 14px 15px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.11);
  background: linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.03));
  color: rgba(244,248,255,0.95);
  font-size: 13px;
  line-height: 1.5;
  box-shadow: 0 14px 30px rgba(0,0,0,0.18);
  resize: vertical;
}

.assistant-empty{
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  padding: 18px;
  border-radius: 16px;
  border: 1px dashed rgba(255,255,255,0.12);
  color: rgba(204,220,236,0.68);
  text-align: center;
  font-size: 13px;
  line-height: 1.45;
}

.assistant-loading{
  opacity: 0.82;
}

@media (max-width: 980px){
  .assistant-launcher{
    right: 14px;
    bottom: 18px;
    top: auto;
    transform: none;
  }

  .assistant-launcher:hover{
    transform: scale(1.03);
  }

  .assistant-drawer{
    top: 10px;
    right: 10px;
    width: calc(100vw - 20px);
    height: calc(100vh - 20px);
  }
}
