/* BuildAne v1.4.4 — Chat UX Polish
   Polishes the Simple Project Room conversation without changing backend workflow. */

/* Chat window surface */
.creator-v140 .simple-chat-card{
  border-color:#d9e5ee;
  border-radius:22px;
  box-shadow:0 16px 46px rgba(18,55,85,.08);
  background:#fff;
}
.creator-v140 .simple-chat-head{
  min-height:66px;
  padding:11px 13px 10px;
  background:linear-gradient(180deg,#fbfdff 0%,#f6faff 100%);
  border-bottom:1px solid #e5edf4;
  justify-content:space-between;
  gap:10px;
}
.creator-v140 .ane-compact{display:flex;align-items:center;gap:10px;min-width:0}
.creator-v140 .ane-avatar-frame{
  position:relative;display:block;width:46px;height:46px;flex:0 0 46px;
  border-radius:50%;overflow:visible;
  box-shadow:0 0 0 3px #fff,0 4px 13px rgba(17,62,96,.16);
}
.creator-v140 .simple-chat-head .ane-compact img{
  width:46px;height:46px;border-radius:50%;display:block;object-fit:cover;
  object-position:50% 10%;
  background:#dcecf9;
}
.creator-v140 .ane-presence-dot{
  position:absolute;right:-1px;bottom:2px;width:11px;height:11px;border-radius:50%;
  background:#28c985;border:2px solid #fff;box-shadow:0 1px 4px rgba(13,111,72,.26);
}
.creator-v140 .ane-compact-copy{min-width:0;display:grid;gap:1px}
.creator-v140 .ane-compact-copy small{font-size:8px;letter-spacing:.14em;color:#7790a4;font-weight:800}
.creator-v140 .ane-compact-copy strong{font-size:12px;line-height:1.25;color:#183852;white-space:normal}

/* Window controls must never be pushed out by the channel selector. */
.creator-v140 .desktop-chat-window-controls{margin-left:auto;flex:0 0 auto}
.creator-v140 .desktop-chat-window-btn{
  width:34px;height:34px;border-radius:10px;background:#fff;border:1px solid #d5e2ec;
  color:#46677f;box-shadow:0 2px 8px rgba(20,63,96,.06);font-weight:800;
}
.creator-v140 .desktop-chat-window-btn:hover{background:#eef7ff;border-color:#9fc9e7;color:#0874c9}
.creator-v140 .desktop-chat-window-btn>span{font-size:22px;line-height:1;transform:translateY(-2px)}
.creator-v140 .desktop-chat-window-btn svg{width:16px;height:16px}

/* Channel selector gets its own row so controls stay visible at any window width. */
.creator-v140 .simple-chat-channelbar{
  padding:8px 11px;border-bottom:1px solid #e8eef4;background:#fbfdff;
}
.creator-v140 .simple-channel-switch{
  width:100%;display:grid;grid-template-columns:repeat(3,1fr);gap:4px;
  padding:4px;border:1px solid #dce6ee;border-radius:13px;background:#edf3f7;
}
.creator-v140 .simple-channel-switch button{
  min-width:0;border-radius:9px;padding:7px 9px;display:flex;align-items:center;justify-content:center;gap:6px;
  font-weight:750;color:#60798d;white-space:nowrap;
}
.creator-v140 .simple-channel-switch button.active{
  background:#fff;color:#0875d1;box-shadow:0 3px 10px rgba(18,72,113,.11);
}
.creator-v140 .simple-channel-switch .channel-glyph{font-size:12px;opacity:.9}

/* Conversation area */
.creator-v140 .v140-messages{padding:17px 16px 13px;background:linear-gradient(180deg,#fff 0%,#fbfdff 100%)}
.creator-v140 .v140-messages .message{display:flex;align-items:flex-end;gap:9px;margin-bottom:15px}
.creator-v140 .v140-messages .message.user{justify-content:flex-end}
.creator-v140 .v140-messages .message-bubble{
  max-width:84%;border-radius:18px;padding:11px 13px;box-shadow:0 4px 14px rgba(17,55,85,.045);
}
.creator-v140 .v140-messages .message.ane .message-bubble{
  background:#eef5fb;border:1px solid #e1ecf4;border-bottom-left-radius:7px;color:#153b58;
}
.creator-v140 .v140-messages .message.user .message-bubble{
  background:linear-gradient(145deg,#1789ef,#0878dc);border:1px solid #0873d0;border-bottom-right-radius:7px;color:#fff;
  box-shadow:0 8px 19px rgba(10,118,216,.16);
}
.creator-v140 .v140-messages .message-bubble strong{display:block;font-size:10px;margin-bottom:4px;color:#173c58}
.creator-v140 .v140-messages .message-bubble p{margin:0;font-size:12px;line-height:1.55}
.creator-v140 .v140-messages .message.user .message-bubble p{color:#fff}
.creator-v140 .message-ane-avatar{
  width:31px!important;height:31px!important;min-width:31px!important;border-radius:50%;overflow:hidden;background:#dcecf9!important;
  padding:0!important;display:block!important;border:2px solid #fff;box-shadow:0 2px 8px rgba(17,58,90,.12)
}
.creator-v140 .message-ane-avatar img{width:100%;height:100%;display:block;object-fit:cover;object-position:50% 9%}

/* Composer */
.creator-v140 .v140-composer{padding:12px 13px 13px;background:#f8fbfe;border-top:1px solid #e3ebf2}
.creator-v140 .v140-composer textarea{
  min-height:78px;max-height:180px;border-radius:15px;border:1px solid #cbd9e4;background:#fff;
  padding:12px 13px;font-size:12px;line-height:1.45;box-shadow:inset 0 1px 2px rgba(14,53,81,.025);
}
.creator-v140 .v140-composer textarea:focus{border-color:#70afe0;box-shadow:0 0 0 3px rgba(15,128,224,.09)}
.creator-v140 .v140-composer .composer-row{display:flex;align-items:center;gap:8px;margin-top:9px}
.creator-v140 .composer-tools{display:flex;align-items:center;gap:6px;flex:0 0 auto}
.creator-v140 .tool-button{
  min-height:34px;padding:7px 9px!important;border:1px solid #d6e2eb!important;border-radius:10px!important;background:#fff!important;
  color:#56748a!important;display:inline-flex!important;align-items:center!important;gap:6px!important;font-size:10px!important;font-weight:700!important;
  cursor:pointer;transition:.15s ease;box-shadow:0 2px 7px rgba(19,60,92,.035)
}
.creator-v140 .tool-button:hover{background:#eef7ff!important;border-color:#a8cfe9!important;color:#0875c9!important}
.creator-v140 .tool-icon{width:15px;height:15px;display:block;flex:0 0 auto}
.creator-v140 .composer-send{min-width:76px;min-height:38px;border-radius:11px!important;margin-left:auto}
.creator-v140 #composerHint{font-size:9px;line-height:1.35;color:#71889c;min-width:0;flex:1}

/* Robust resizing: right edge, bottom edge and a visible corner grip. */
.creator-v140 .desktop-chat-resize-edge{display:none}
@media (min-width:1000px){
  .creator-v140 .simple-stage.device-desktop .simple-chat-card{
    grid-template-rows:auto auto minmax(110px,1fr) auto;
    min-width:360px;min-height:390px;
    overflow:hidden;
  }
  .creator-v140 .simple-stage.device-desktop .simple-chat-head{cursor:move;touch-action:none}
  .creator-v140 .simple-stage.device-desktop .simple-chat-channelbar{display:block}
  .creator-v140 .simple-stage.device-desktop .desktop-chat-window-controls{display:flex;gap:6px}
  .creator-v140 .simple-stage.device-desktop .desktop-chat-resize-edge{display:block;position:absolute;z-index:9;touch-action:none}
  .creator-v140 .simple-stage.device-desktop .desktop-chat-resize-right{top:72px;right:-3px;bottom:22px;width:9px;cursor:ew-resize}
  .creator-v140 .simple-stage.device-desktop .desktop-chat-resize-bottom{left:12px;right:22px;bottom:-3px;height:9px;cursor:ns-resize}
  .creator-v140 .simple-stage.device-desktop .desktop-chat-resize-handle{
    display:grid;place-items:center;position:absolute;right:0;bottom:0;width:28px;height:28px;z-index:12;
    cursor:nwse-resize;touch-action:none;border-radius:9px 0 18px 0;background:linear-gradient(135deg,transparent 0 45%,#eef5fa 46% 100%);
  }
  .creator-v140 .simple-stage.device-desktop .desktop-chat-resize-handle span{
    width:13px;height:13px;display:block;opacity:.75;
    background:repeating-linear-gradient(135deg,transparent 0 3px,#6f93ad 3px 4px);
    clip-path:polygon(100% 0,100% 100%,0 100%);
  }
  .creator-v140 .simple-stage.device-desktop .desktop-chat-resize-handle:hover span{opacity:1;background:repeating-linear-gradient(135deg,transparent 0 3px,#0876cb 3px 4px)}
  .creator-v140 .simple-stage.device-desktop .simple-chat-card.desktop-chat-collapsed{grid-template-rows:auto!important}
  .creator-v140 .simple-stage.device-desktop .simple-chat-card.desktop-chat-collapsed .simple-chat-channelbar,
  .creator-v140 .simple-stage.device-desktop .simple-chat-card.desktop-chat-collapsed .desktop-chat-resize-edge{display:none!important}
  .creator-v140 .simple-stage.device-desktop .simple-chat-card.desktop-chat-maximized .desktop-chat-resize-edge{display:none!important}
  body.desktop-chat-is-resizing,body.desktop-chat-is-resizing *{user-select:none!important}
}

@media (max-width:999px){
  .creator-v140 .simple-chat-head{align-items:center!important;flex-direction:row!important}
  .creator-v140 .simple-chat-channelbar{padding:7px 9px}
  .creator-v140 .desktop-chat-window-controls,.creator-v140 .desktop-chat-resize-edge,.creator-v140 .desktop-chat-resize-handle{display:none!important}
}
