/* DiscountHub AI Finder — chat-first polish v2 (2026-10-01) */

.ai-page .nav{
  gap:28px;
}

.ai-page .nav-links{
  margin-left:auto;
}

.ai-page .ai-shell{
  padding:28px 0 56px;
}

.ai-page .ai-page-title{
  max-width:1040px;
  margin:0 auto 14px;
}

.ai-page .ai-page-title h1{
  margin:0;
  color:#f7fbff;
  font-size:clamp(32px,2.7vw,42px);
  line-height:1;
  letter-spacing:-.025em;
  font-weight:760;
}

/* This page is the tool itself, not a landing page about the tool. */
.ai-page .ai-intro,
.ai-page .ai-guide,
.ai-page .ai-suggestions,
.ai-page .ai-fine-print,
.ai-page .ai-manual-fallback{
  display:none !important;
}

.ai-page .ai-workspace{
  display:block;
  max-width:1040px;
  margin:0 auto;
}

.ai-page .ai-chat-card{
  height:min(650px,calc(100svh - 220px));
  min-height:520px;
  overflow:hidden;
  border-radius:24px;
  border:1px solid rgba(255,255,255,.095);
  background:
    radial-gradient(circle at 100% 0%,rgba(66,234,255,.055),transparent 27%),
    linear-gradient(145deg,rgba(6,17,43,.84),rgba(4,11,29,.91));
  box-shadow:0 18px 58px rgba(0,0,0,.20),inset 0 1px 0 rgba(255,255,255,.045);
  backdrop-filter:blur(18px);
  display:grid;
  grid-template-rows:auto minmax(0,1fr) auto;
}

.ai-page .ai-chat-head{
  min-height:66px;
  padding:11px 14px;
  gap:11px;
  background:rgba(3,9,24,.28);
  border-bottom:1px solid rgba(255,255,255,.065);
}

.ai-page .ai-avatar{
  width:40px;
  height:40px;
  flex:0 0 40px;
  overflow:hidden;
  border-radius:12px;
  background:#07152f;
  box-shadow:0 7px 20px rgba(35,116,255,.18);
}

.ai-page .ai-avatar img{
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
}

.ai-page .ai-chat-head > div:nth-child(2){
  display:flex;
  align-items:center;
  min-width:0;
}

.ai-page .ai-chat-head strong{
  display:block;
  font-size:14px;
  font-weight:800;
}

.ai-page .ai-reset{
  min-height:36px;
  margin-left:auto;
  padding:0 12px;
  border-radius:11px;
  color:#b9c7df;
  background:rgba(255,255,255,.035);
  border:1px solid rgba(255,255,255,.08);
  font-size:11px;
  font-weight:800;
}

.ai-page .ai-reset:hover{
  color:#fff;
  border-color:rgba(66,234,255,.22);
  background:rgba(66,234,255,.05);
}

/* Keep the conversation centered instead of stretching bubbles over the panel. */
.ai-page .ai-messages{
  min-height:0;
  padding:24px 24px 16px;
  overflow-y:auto;
  gap:16px;
  scrollbar-width:thin;
  scrollbar-color:rgba(66,234,255,.25) transparent;
}

.ai-page .ai-message{
  width:100%;
}

.ai-page .ai-message.assistant{
  align-items:flex-start;
  gap:10px;
}

.ai-page .ai-message.assistant::before{
  content:"";
  width:30px;
  height:30px;
  flex:0 0 30px;
  margin-top:2px;
  border-radius:9px;
  background:url("../assets/icon-180.png") center/cover no-repeat;
  box-shadow:0 6px 18px rgba(35,116,255,.16);
}

.ai-page .ai-message.assistant .ai-bubble{
  max-width:min(760px,82%);
  padding:5px 0;
  border:0;
  border-radius:0;
  background:transparent;
  box-shadow:none;
}

.ai-page .ai-message.user{
  justify-content:flex-end;
}

.ai-page .ai-message.user .ai-bubble{
  max-width:min(620px,72%);
  padding:11px 14px;
  border-radius:16px 16px 6px 16px;
  color:#fff;
  background:linear-gradient(135deg,rgba(35,116,255,.92),rgba(50,101,215,.84));
  border:1px solid rgba(116,174,255,.30);
  box-shadow:none;
}

.ai-page .ai-bubble p{
  margin:0;
  color:#edf4ff;
  font-size:14px;
  line-height:1.55;
}

.ai-page .ai-message.assistant .ai-bubble p{
  color:#e5edfb;
}

.ai-page .ai-message.loading::before{
  margin-top:8px;
}

.ai-page .ai-message.loading .ai-bubble{
  padding:10px 0;
}

.ai-page .ai-result-grid{
  max-width:890px;
  margin-left:40px;
  grid-template-columns:repeat(2,minmax(0,1fr));
}

/* The composer should read as one control, not another full-width panel. */
.ai-page .ai-form{
  grid-template-columns:minmax(0,1fr) auto;
  gap:8px;
  margin:0 14px 14px;
  padding:7px;
  border:1px solid rgba(255,255,255,.095);
  border-radius:18px;
  background:rgba(255,255,255,.04);
  box-shadow:0 10px 30px rgba(0,0,0,.13);
}

.ai-page .ai-form textarea{
  min-height:46px;
  max-height:130px;
  padding:12px 13px;
  border:0;
  border-radius:12px;
  color:#fff;
  background:transparent;
  box-shadow:none;
  font-size:14px;
  line-height:1.45;
}

.ai-page .ai-form textarea::placeholder{
  color:#6f82a8;
}

.ai-page .ai-form textarea:focus{
  border:0;
  background:transparent;
  box-shadow:none;
}

.ai-page .ai-form button{
  width:46px;
  min-width:46px;
  min-height:46px;
  padding:0;
  border-radius:13px;
  box-shadow:none;
}

.ai-page .ai-form button span{
  display:none;
}

.ai-page .ai-form button svg{
  width:19px;
  height:19px;
}

/* Result cards remain useful, but slightly calmer inside the new chat layout. */
.ai-page .ai-result-card{
  border-radius:17px;
  background:rgba(4,11,29,.58);
  border-color:rgba(255,255,255,.09);
  box-shadow:none;
}

@media(max-width:1100px){
  .ai-page .nav-links{
    gap:22px;
  }

  .ai-page .ai-page-title,
  .ai-page .ai-workspace{
    max-width:920px;
  }
}

@media(max-width:760px){
  .ai-page .ai-shell{
    padding:18px 0 36px;
  }

  .ai-page .ai-page-title{
    margin-bottom:10px;
  }

  .ai-page .ai-page-title h1{
    font-size:32px;
  }

  .ai-page .ai-chat-card{
    height:calc(100svh - 145px);
    min-height:500px;
    border-radius:20px;
  }

  .ai-page .ai-chat-head{
    min-height:60px;
    padding:9px 10px;
  }

  .ai-page .ai-avatar{
    width:38px;
    height:38px;
    flex-basis:38px;
  }

  .ai-page .ai-messages{
    padding:16px 13px 12px;
  }

  .ai-page .ai-message.assistant::before{
    width:27px;
    height:27px;
    flex-basis:27px;
  }

  .ai-page .ai-message.assistant .ai-bubble{
    max-width:calc(100% - 40px);
  }

  .ai-page .ai-message.user .ai-bubble{
    max-width:86%;
  }

  .ai-page .ai-result-grid{
    grid-template-columns:1fr;
    margin-left:37px;
  }

  .ai-page .ai-form{
    margin:0 9px 9px;
    padding:6px;
  }

  .ai-page .ai-form button{
    width:44px;
    min-width:44px;
    min-height:44px;
  }
}
