/* ================================================
   OUTER LAYOUT — chat + sidebar side by side
================================================ */

.ac-aiwrap{
  display:flex;
  align-items:flex-start;
  gap:22px;
}

.ac-aibox{
  flex:1 1 58%;
  min-width:0;
  border-radius:18px;
  border:1px solid #e6eef4;
  background:#ffffff;
  box-shadow:0 10px 30px rgba(0,0,0,0.06);
  overflow:hidden;
}

.ac-aiheader{
  padding:14px 18px;
  background:#ffffff;
  border-bottom:1px solid #eef3f7;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.ac-reset-btn{
  display:inline-flex;
  align-items:center;
  gap:5px;
  padding:5px 11px;
  border-radius:999px;
  border:1px solid #dce8f0;
  background:#f4f9fc;
  color:#5a7a8c;
  font-size:12px;
  font-weight:600;
  cursor:pointer;
  line-height:1;
  transition:background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  white-space:nowrap;
  flex-shrink:0;
}

.ac-reset-btn:hover{
  background:#e8f4fb;
  color:#2a6a8a;
  border-color:#b8d8ec;
}

.ac-reset-btn:active{
  background:#d8ecf7;
}

.ac-aibadge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:6px 10px;
  border-radius:999px;
  background:#f2fbfe;
  border:1px solid #cfeff7;
  color:#1f3a46;
  font-size:12px;
  font-weight:600;
  letter-spacing:0.2px;
}

.ac-aibadge-dot{
  width:8px;
  height:8px;
  border-radius:50%;
  background:#33c1dd;
  box-shadow:0 0 0 3px rgba(51,193,221,0.18);
}

.ac-aimessages{
  padding:24px;
  height:380px;
  overflow:auto;
  background:#f8fbfd;
}

/* Message bubble styling */

.ac-msg{
  max-width:85%;
  padding:14px 16px;
  margin:12px 0;
  border-radius:16px;
  font-size:15px;
  line-height:1.5;
  white-space:normal;
  word-break:break-word;
  overflow-wrap:anywhere;
  display:flex;
  gap:10px;
  align-items:flex-start;
}

.ac-msgtext{
  display:block;
  min-width:0;
}

.ac-msg-bot .ac-msgtext p{
  margin:0 0 10px 0;
}

.ac-msg-bot .ac-msgtext p:last-child{
  margin-bottom:0;
}

.ac-msg-bot .ac-msgtext ul,
.ac-msg-bot .ac-msgtext ol{
  margin:8px 0 10px 18px;
  padding:0;
}

.ac-msg-bot .ac-msgtext li{
  margin:0 0 6px 0;
}

.ac-msg-bot .ac-msgtext li:last-child{
  margin-bottom:0;
}

.ac-boticon{
  width:26px;
  height:26px;
  border-radius:10px;
  background:#ffffff;
  border:1px solid #e2edf3;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:14px;
  flex:0 0 26px;
  margin-top:1px;
}

.ac-msg-bot{
  background:#ffffff;
  border:1px solid #e2edf3;
  color:#243746;
}

.ac-msg-user{
  margin-left:auto;
  background:#e8f7fb;
  border:1px solid #c8eef7;
  color:#1f3a46;
  justify-content:flex-end;
}

.ac-msg-user .ac-boticon{
  display:none;
}

/* Resize handle — bottom-right corner grip */

.ac-aibox{
  position:relative;
}

.ac-resize-handle{
  position:absolute;
  bottom:0;
  right:0;
  width:20px;
  height:20px;
  cursor:nwse-resize;
  border-radius:0 0 18px 0;
  overflow:hidden;
  z-index:10;
  opacity:0.45;
  transition:opacity 0.15s ease;
}

.ac-aibox:hover .ac-resize-handle,
.ac-resize-handle:focus{
  opacity:1;
  outline:none;
}

/* Diagonal grip lines */
.ac-resize-handle::before,
.ac-resize-handle::after{
  content:'';
  position:absolute;
  background:#7a9db5;
  border-radius:1px;
  transform-origin:bottom right;
  transform:rotate(-45deg);
  right:3px;
  bottom:3px;
}

.ac-resize-handle::before{
  width:10px;
  height:1.5px;
  bottom:8px;
  right:3px;
}

.ac-resize-handle::after{
  width:16px;
  height:1.5px;
  bottom:4px;
  right:3px;
}

/* Composer */

.ac-aicomposer{
  display:flex;
  gap:12px;
  padding:18px;
  border-top:1px solid #eef3f7;
  background:#ffffff;
  align-items:flex-end;
}

#acAiinput{
  flex:1;
  resize:none;
  border-radius:14px;
  border:1px solid #dbe6ee;
  background:#ffffff;
  color:#243746;
  padding:14px;
  font-size:15px;
  outline:none;
  transition:all 0.2s ease;
  min-height:48px;
  max-height:160px;
  overflow:auto;
}

#acAiinput:focus{
  border-color:#33c1dd;
  box-shadow:0 0 0 3px rgba(51,193,221,0.15);
}

#acAisend{
  min-width:90px;
  height:46px;
  border-radius:14px;
  border:none;
  background:#33c1dd;
  color:#ffffff;
  cursor:pointer;
  font-size:14px;
  font-weight:600;
  line-height:1;
  transition:all 0.2s ease;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  gap:6px;
  padding:0 18px;
  align-self:flex-end;
  flex-shrink:0;
  text-align:center;
}

#acAisend:hover{
  background:#29a8c2;
}

#acAisend:disabled{
  opacity:0.6;
  cursor:not-allowed;
}

/* Disclaimer */

.ac-aidisclaimer{
  padding:14px 18px 18px 18px;
  font-size:12px;
  color:#6b7c8a;
  background:#ffffff;
}

/* Typing indicator */

.ac-typing{
  display:flex;
  gap:10px;
  align-items:flex-start;
}

.ac-typing .ac-typingdots{
  display:inline-flex;
  gap:5px;
  align-items:center;
  height:18px;
  margin-top:2px;
}

.ac-typing .ac-typingdots span{
  width:6px;
  height:6px;
  border-radius:50%;
  background:#7b8b97;
  opacity:0.55;
  animation: acDot 1.2s infinite ease-in-out;
}

.ac-typing .ac-typingdots span:nth-child(2){
  animation-delay:0.15s;
}

.ac-typing .ac-typingdots span:nth-child(3){
  animation-delay:0.3s;
}

@keyframes acDot{
  0%, 80%, 100% { transform: translateY(0); opacity:0.45; }
  40% { transform: translateY(-3px); opacity:0.9; }
}

/* CTA area */

.ac-cta-under{
  max-width:85%;
  margin:-6px 0 12px 0;
  padding-left:36px;
}

.acm-cta-wrap{
  margin-top:10px;
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  justify-content:flex-start;
  align-items:flex-start;
}

.acm-cta-label{
  font-size:13px;
  color:#4a5a68;
  margin:8px 0 6px 0;
  font-weight:500;
}

.acm-cta-btn{
  display:inline-flex !important;
  align-items:center;
  gap:5px;
  padding:7px 12px;
  border-radius:8px;
  background:#4790CD;
  color:#ffffff !important;
  text-decoration:none !important;
  font-weight:600;
  font-size:11.5px;
  line-height:1.2;
  white-space:normal;
  width:auto !important;
  max-width:100%;
  flex:0 0 auto;
  border:1.5px solid #3a7ab8;
  box-shadow:0 2px 5px rgba(71,144,205,0.22);
  cursor:pointer;
  transition:background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.acm-cta-icon{
  font-style:normal;
  font-size:12px;
  flex-shrink:0;
}

.acm-cta-wrap a,
.acm-cta-wrap a:visited,
.acm-cta-wrap a:hover,
.acm-cta-wrap a:active{
  text-decoration:none !important;
}

.acm-cta-btn:hover{
  background:#3a7ab8;
  box-shadow:0 4px 12px rgba(71,144,205,0.40);
  transform:translateY(-1px);
}

.acm-cta-btn:active{
  transform:translateY(0);
  box-shadow:0 2px 5px rgba(71,144,205,0.25);
}

.acm-cta-badge{
  display:inline-block;
  background:#ffffff;
  color:#2f6ea3;
  border-radius:10px;
  padding:1px 6px;
  font-size:9.5px;
  font-weight:700;
  line-height:1.1;
  border:1px solid rgba(0,0,0,0.08);
}

/* ================================================
   ESTIMATE SIDEBAR
================================================ */

.ac-aisidebar{
  flex:0 0 36%;
  min-width:240px;
  max-width:380px;
  border-radius:18px;
  background:linear-gradient(155deg,#5fa3d8 0%,#4790CD 40%,#3a7ab8 100%);
  color:#ffffff;
  position:sticky;
  top:20px;
  overflow:hidden;
}

/* Placeholder state */

.ac-sidebar-placeholder{
  padding:36px 24px;
  text-align:center;
}

.ac-sidebar-placeholder-icon{
  font-size:36px;
  display:block;
  margin-bottom:14px;
  opacity:0.55;
}

.ac-sidebar-placeholder-text{
  font-size:14px;
  line-height:1.55;
  color:rgba(255,255,255,0.7);
  margin:0;
}

/* Live estimate content */

.ac-sidebar-content{
  padding:24px 22px;
}

[hidden]{
  display:none !important;
}

/* Total section */

.ac-sidebar-total-section{
  margin-bottom:20px;
}

.ac-sidebar-total-label{
  font-size:12px;
  font-weight:600;
  letter-spacing:0.6px;
  text-transform:uppercase;
  color:rgba(255,255,255,0.7);
  margin-bottom:6px;
}

.ac-sidebar-total-price{
  font-size:42px;
  font-weight:800;
  line-height:1;
  letter-spacing:-1px;
  color:#ffffff;
  margin-bottom:6px;
}

.ac-sidebar-breakdown{
  margin:10px 0 4px;
  display:flex;
  flex-direction:column;
  gap:3px;
}

.ac-breakdown-row{
  display:flex;
  justify-content:space-between;
  align-items:baseline;
  gap:8px;
  font-size:12px;
  color:rgba(255,255,255,0.72);
}

.ac-breakdown-row--last{
  border-top:1px solid rgba(255,255,255,0.2);
  margin-top:4px;
  padding-top:4px;
  color:rgba(255,255,255,0.85);
  font-weight:600;
}

.ac-breakdown-label{ flex:1; }

.ac-breakdown-value{
  white-space:nowrap;
  font-variant-numeric:tabular-nums;
}

.ac-sidebar-total-meta{
  font-size:12px;
  color:rgba(255,255,255,0.5);
  margin-top:6px;
}

/* Jobs list */

.ac-sidebar-jobs-list{
  list-style:none;
  margin:14px 0 0 0;
  padding:0;
  display:flex;
  flex-direction:column;
  gap:6px;
}

.ac-sidebar-job-row{
  display:flex;
  justify-content:space-between;
  align-items:baseline;
  gap:8px;
  padding:6px 0;
  border-bottom:1px solid rgba(255,255,255,0.12);
}

.ac-sidebar-job-row:last-child{
  border-bottom:none;
}

.ac-sidebar-job-name{
  font-size:13px;
  color:rgba(255,255,255,0.9);
  flex:1;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.ac-sidebar-job-time{
  font-size:12px;
  color:rgba(255,255,255,0.6);
  white-space:nowrap;
  flex-shrink:0;
}

.ac-sidebar-job-remove{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:20px;
  height:20px;
  border-radius:50%;
  border:none;
  background:rgba(255,80,80,0.18);
  color:rgba(255,140,140,0.95);
  cursor:pointer;
  flex-shrink:0;
  padding:0;
  margin-left:2px;
  transition:background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.ac-sidebar-job-remove:hover{
  background:rgba(255,60,60,0.45);
  color:#ffffff;
  transform:scale(1.15);
}

.ac-sidebar-job-remove:disabled{
  opacity:0.4;
  cursor:not-allowed;
  transform:none;
}

/* Divider */

.ac-sidebar-divider{
  height:1px;
  background:rgba(255,255,255,0.18);
  margin:18px 0;
}

/* Plans section */

.ac-sidebar-plans-heading{
  font-size:12px;
  font-weight:700;
  letter-spacing:0.5px;
  text-transform:uppercase;
  color:rgba(255,255,255,0.7);
  margin-bottom:12px;
}

.ac-sidebar-plans-desc{
  font-size:11px;
  line-height:1.5;
  color:rgba(255,255,255,0.6);
  margin:0 0 12px 0;
}

.ac-sidebar-plans-list{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.ac-sidebar-plan-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  background:rgba(255,255,255,0.10);
  border:1px solid rgba(255,255,255,0.14);
  border-radius:8px;
  padding:8px 10px;
  gap:6px;
}

.ac-sidebar-plan-left{
  display:flex;
  flex-direction:column;
  gap:3px;
  min-width:0;
}

.ac-sidebar-plan-name{
  font-size:13px;
  font-weight:700;
  color:#ffffff;
  white-space:nowrap;
}

.ac-sidebar-plan-badge{
  display:inline-block;
  background:rgba(255,255,255,0.22);
  color:#ffffff;
  border-radius:8px;
  padding:1px 7px;
  font-size:10px;
  font-weight:700;
  letter-spacing:0.3px;
  width:fit-content;
}

.ac-sidebar-plan-monthly{
  font-size:11px;
  color:rgba(255,255,255,0.6);
}

.ac-sidebar-plan-right{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:4px;
  flex-shrink:0;
}

.ac-sidebar-plan-price{
  font-size:13px;
  font-weight:700;
  color:#ffffff;
  white-space:nowrap;
}

.ac-sidebar-plan-cta{
  font-size:10px;
  font-weight:600;
  color:rgba(255,255,255,0.85);
  text-decoration:none;
  white-space:nowrap;
  transition:background 0.15s, color 0.15s;
  background:rgba(255,255,255,0.15);
  border:1px solid rgba(255,255,255,0.25);
  border-radius:6px;
  padding:4px 10px;
  cursor:pointer;
}

.ac-sidebar-plan-cta:hover{
  color:#ffffff;
  background:rgba(255,255,255,0.28);
}

/* Entrance animation when sidebar goes active */

.ac-aisidebar--active .ac-sidebar-content{
  animation:acSidebarIn 0.35s ease both;
}

@keyframes acSidebarIn{
  from{ opacity:0; transform:translateY(8px); }
  to{   opacity:1; transform:translateY(0);   }
}

/* ================================================
   RESPONSIVE — stack on narrow screens
================================================ */

@media (max-width:860px){
  .ac-aiwrap{
    flex-direction:column;
  }
  .ac-aisidebar{
    flex:none;
    width:100%;
    max-width:none;
    min-width:0;
    position:static;
  }
  .ac-sidebar-total-price{
    font-size:34px;
  }
}