.assistant-layout{display:grid;grid-template-columns:minmax(0,1fr) 310px;gap:16px;min-height:calc(100vh - 128px)}.chat-panel{display:flex;flex-direction:column;min-height:680px}.chat-empty{display:grid;place-items:center;text-align:center;flex:1;padding:48px 20px}.orb{width:66px;height:66px;border-radius:22px;display:grid;place-items:center;background:linear-gradient(145deg,rgba(210,175,103,.25),rgba(255,255,255,.34));border:1px solid var(--glassBorder);box-shadow:inset 0 1px 0 rgba(255,255,255,.4),0 18px 40px rgba(197,161,90,.14);margin:0 auto 16px}.quick-prompts{display:flex;gap:7px;flex-wrap:wrap;justify-content:center;margin-top:18px}.prompt-chip{border:1px solid var(--hair);background:rgba(255,255,255,.2);border-radius:999px;padding:8px 11px;font-size:.71rem;color:var(--text2)}.chat-messages{display:grid;gap:16px;padding:20px;overflow:auto;flex:1;max-height:calc(100vh - 270px)}.message{display:flex;gap:10px;max-width:82%}.message.user{justify-self:end;flex-direction:row-reverse}.message-avatar{width:30px;height:30px;border-radius:10px;display:grid;place-items:center;background:rgba(197,161,90,.15);font-size:.66rem;font-weight:700;flex:0 0 auto}.message-bubble{padding:11px 13px;border-radius:16px;background:rgba(255,255,255,.33);border:1px solid var(--glassBorder);font-size:.81rem;line-height:1.52}.message.user .message-bubble{background:rgba(197,161,90,.13);border-color:rgba(197,161,90,.22)}.answer-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-top:10px}.answer-card{padding:11px;border:1px solid var(--hair);border-radius:12px;background:rgba(255,255,255,.18)}.answer-card b{display:block;font-size:1.05rem}.answer-card span{font-size:.67rem;color:var(--muted)}.composer{padding:14px;border-top:1px solid var(--hair)}.composer-box{border:1px solid var(--glassBorder);border-radius:18px;background:rgba(255,255,255,.28);padding:10px}.composer textarea{width:100%;min-height:54px;max-height:160px;resize:none;border:0;outline:0;background:transparent;padding:4px 6px;font-size:.83rem}.composer-actions{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:4px}.composer-tools{display:flex;gap:4px}.context-card{padding:16px}.context-row{padding:10px 0;border-bottom:1px solid var(--hair)}.context-row:last-child{border-bottom:0}.context-row b{display:block;font-size:.73rem}.context-row span{font-size:.69rem;color:var(--muted);margin-top:2px;display:block}.typing{display:flex;gap:4px;align-items:center;height:20px}.typing i{width:5px;height:5px;background:var(--muted);border-radius:50%;animation:pulseSoft .9s ease-in-out infinite}.typing i:nth-child(2){animation-delay:.15s}.typing i:nth-child(3){animation-delay:.3s}@media(max-width:1050px){.assistant-layout{grid-template-columns:1fr}.assistant-context{display:none}}@media(max-width:760px){.chat-panel{min-height:calc(100vh - 116px)}.chat-messages{max-height:none}.answer-cards{grid-template-columns:1fr}.message{max-width:94%}}


/* v2 */
.chat-panel{overflow:hidden}
.composer-box{box-shadow:inset 0 1px 0 rgba(255,255,255,.26)}
.composer-actions>*{min-width:0}
.composer-tools{flex:0 0 auto}
#contextSelect{max-width:190px}
@media(max-width:520px){
  .composer-actions{align-items:flex-end}
  #contextSelect{max-width:130px}
  .composer-tools .icon-btn:nth-child(2){display:none}
}

/* v4 - Chat history */
.assistant-layout{
  grid-template-columns:
    230px
    minmax(0,1fr)
    280px;
}

.assistant-history{
  min-width:0;
}

.history-card{
  padding:12px;
  height:100%;
  min-height:680px;
  display:flex;
  flex-direction:column;
  overflow:hidden;
}

.history-new{
  width:100%;
  justify-content:center;
}

.history-search{
  margin-top:10px;
}

.history-search input{
  width:100%;
  border:1px solid var(--glassBorder);
  background:rgba(255,255,255,.18);
  color:var(--text);
  border-radius:12px;
  outline:none;
  padding:9px 10px;
  font-size:.74rem;
}

.history-search input:focus{
  border-color:rgba(197,161,90,.48);
  box-shadow:0 0 0 3px rgba(197,161,90,.08);
}

.history-heading{
  margin:15px 4px 7px;
  color:var(--muted);
  font-size:.64rem;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.08em;
}

.conversation-list{
  min-height:0;
  flex:1;
  overflow:auto;
  display:flex;
  flex-direction:column;
  gap:3px;
  padding-right:2px;
}

.history-group{
  padding:10px 7px 4px;
  color:var(--muted);
  font-size:.61rem;
  font-weight:700;
}

.conversation-item{
  width:100%;
  border:1px solid transparent;
  background:transparent;
  color:var(--text2);
  border-radius:11px;
  padding:9px 9px;
  cursor:pointer;
  text-align:left;
  display:block;
  transition:
    background .15s ease,
    border-color .15s ease,
    color .15s ease;
}

.conversation-item:hover{
  background:rgba(255,255,255,.16);
  border-color:var(--hair);
  color:var(--text);
}

.conversation-item.active{
  background:rgba(197,161,90,.12);
  border-color:rgba(197,161,90,.24);
  color:var(--text);
}

.conversation-title{
  display:block;
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
  font-size:.72rem;
  font-weight:600;
}

.conversation-date{
  display:block;
  margin-top:3px;
  color:var(--muted);
  font-size:.59rem;
}

.history-empty{
  padding:18px 8px;
  text-align:center;
  color:var(--muted);
  font-size:.69rem;
}

@media(max-width:1250px){
  .assistant-layout{
    grid-template-columns:
      220px
      minmax(0,1fr);
  }

  .assistant-context{
    display:none;
  }
}

@media(max-width:850px){
  .assistant-layout{
    grid-template-columns:1fr;
  }

  .assistant-history{
    display:none;
  }
}

/* v5 - Message sizing fix */

.chat-messages{
  display:flex !important;
  flex-direction:column !important;
  justify-content:flex-start !important;
  align-items:stretch !important;
  align-content:flex-start !important;
  gap:16px;
}

.message{
  display:flex !important;
  flex:0 0 auto !important;
  height:auto !important;
  min-height:0 !important;
  max-height:none !important;
  align-items:flex-start !important;
  align-self:flex-start;
  width:auto !important;
  max-width:82%;
}

.message.user{
  align-self:flex-end !important;
  flex-direction:row-reverse;
}

.message-avatar{
  flex:0 0 30px !important;
}

.message-bubble{
  display:block !important;
  flex:0 1 auto !important;
  width:auto !important;
  height:auto !important;
  min-height:0 !important;
  max-height:none !important;
  align-self:flex-start !important;
  padding:11px 13px;
  overflow-wrap:anywhere;
}

.message.user .message-bubble{
  width:auto !important;
}

.typing{
  min-height:20px;
}

@media(max-width:760px){
  .message{
    max-width:94%;
  }
}

/* v6 - Markdown rendering */

.message-bubble p{
  margin:0 0 8px;
}

.message-bubble p:last-child{
  margin-bottom:0;
}

.message-bubble strong{
  font-weight:750;
  color:var(--text);
}

.message-bubble em{
  font-style:italic;
}

.message-bubble ul{
  margin:7px 0;
  padding-left:20px;
}

.message-bubble li{
  margin:3px 0;
}

.message-bubble h2,
.message-bubble h3,
.message-bubble h4{
  margin:9px 0 5px;
  line-height:1.3;
}

.message-bubble pre{
  margin:9px 0;
  padding:10px 12px;
  border-radius:10px;
  overflow:auto;
  background:rgba(0,0,0,.22);
  border:1px solid var(--hair);
}

.message-bubble code{
  font-family:
    ui-monospace,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    monospace;
}

.message-bubble pre code{
  padding:0;
  background:transparent;
}

/* v7 - Markdown polish */

.message-bubble h2{
  font-size:1.28rem;
  margin:4px 0 10px;
}

.message-bubble h3{
  font-size:1.08rem;
  margin:8px 0 6px;
}

.message-bubble h4{
  font-size:.96rem;
  margin:8px 0 5px;
}

.message-bubble ul{
  margin:8px 0;
  padding-left:20px;
}

.message-bubble li{
  margin:4px 0;
}

.message-bubble pre{
  font-size:.82rem;
  line-height:1.5;
}

/* v8 - Code block containment */

.message-bubble{
  min-width:0;
  max-width:100%;
  overflow:hidden;
}

.message-bubble pre{
  display:block;
  width:100%;
  max-width:100%;
  box-sizing:border-box;
  overflow-x:auto;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  word-break:break-word;
}

.message-bubble pre code{
  display:block;
  max-width:100%;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  word-break:break-word;
}

.message-bubble code{
  max-width:100%;
}

/* v9 - Conversation menu */

.conversation-row{
  position:relative;
  display:flex;
  align-items:stretch;
  gap:2px;
  min-width:0;
}

.conversation-row .conversation-item{
  flex:1;
  min-width:0;
}

.conversation-menu{
  position:relative;
  flex:0 0 auto;
}

.conversation-menu summary{
  list-style:none;
  width:30px;
  height:100%;
  min-height:45px;
  display:grid;
  place-items:center;
  border-radius:10px;
  cursor:pointer;
  color:var(--muted);
  font-size:1rem;
  user-select:none;
}

.conversation-menu summary::-webkit-details-marker{
  display:none;
}

.conversation-menu summary:hover,
.conversation-menu[open] summary{
  background:rgba(255,255,255,.16);
  color:var(--text);
}

.conversation-menu-box{
  position:absolute;
  z-index:40;
  top:calc(100% + 4px);
  right:0;
  width:130px;
  padding:5px;
  border:1px solid var(--glassBorder);
  border-radius:12px;
  background:var(--panel);
  backdrop-filter:blur(18px);
  box-shadow:0 14px 34px rgba(0,0,0,.18);
}

.conversation-menu-box button{
  width:100%;
  border:0;
  background:transparent;
  color:var(--text2);
  text-align:left;
  border-radius:8px;
  padding:8px 9px;
  font-size:.7rem;
  cursor:pointer;
}

.conversation-menu-box button:hover{
  background:rgba(255,255,255,.14);
  color:var(--text);
}

.conversation-menu-box .archive-action{
  color:var(--muted);
}

/* v10 - Archived conversations */

.history-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-top:8px;
}

.history-toolbar .history-heading{
  margin:7px 4px;
}

.history-archive-toggle{
  border:1px solid transparent;
  background:transparent;
  color:var(--muted);
  border-radius:8px;
  padding:5px 7px;
  font-size:.62rem;
  cursor:pointer;
}

.history-archive-toggle:hover{
  color:var(--text);
  background:rgba(255,255,255,.12);
}

.history-archive-toggle.active{
  color:var(--gold3);
  border-color:rgba(197,161,90,.22);
  background:rgba(197,161,90,.09);
}


/* Assistant attachments v1 */

.assistant-attachment-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px 0;
}

.assistant-attachment-tray[hidden] {
  display: none;
}

.assistant-attachment-chip,
.message-attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 280px;
  padding: 6px 10px;
  border: 1px solid rgba(212, 169, 85, .28);
  border-radius: 999px;
  background: rgba(212, 169, 85, .08);
  font-size: 12px;
}

.assistant-attachment-chip > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assistant-attachment-remove {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0;
  font-size: 17px;
  line-height: 1;
}

.message-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}


/* Assistant drag & drop */

.composer-box.assistant-dragover {
  outline: 2px dashed
    rgba(212, 169, 85, .75);
  outline-offset: -5px;
  background:
    rgba(212, 169, 85, .08);
}


/* Persistent message attachments */

.message-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.message-attachment-preview {
  width: min(360px, 100%);
  overflow: hidden;
  border: 1px solid
    rgba(212, 169, 85, .32);
  border-radius: 14px;
  background:
    rgba(0, 0, 0, .18);
}

.message-attachment-image {
  display: block;
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  background: #111;
}

.message-attachment-name {
  padding: 7px 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  opacity: .86;
}


/* Delete conversation */

.conversation-menu-box
.conversation-delete-action {
  color: #ff8d8d;
}

.conversation-menu-box
.conversation-delete-action:hover {
  color: #ffc0c0;
  background:
    rgba(220, 65, 65, .14);
}
