/* ===== Base ===== */
*{ box-sizing:border-box; }
:root{
  --bg:#fff;
  --panel:#f6f8ff;
  --ink:#1f2330;
  --muted:#667085;
  --stroke:rgba(0,0,0,.12);
  --shadow:0 10px 24px rgba(0,0,0,.10);

  --xs:12px;
  --sm:13px;
  --md:15px;
  --lg:17px;
  --xl:20px;
  --r:16px;
  --rb:14px;
}

body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Noto Sans", sans-serif;
  background:var(--bg);
  color:var(--ink);
}

.app{ height:100vh; display:flex; flex-direction:column; }

/* ===== Header ===== */
.top{
  padding:14px 16px;
  display:flex;
  justify-content:space-between;
  align-items:center;
}
.brand{ display:flex; align-items:center; gap:10px; }
.bubble-orb{
  width:34px;height:34px;border-radius:50%;
  background:linear-gradient(135deg,#c4cfff,#f0d9ff);
  box-shadow:0 8px 20px rgba(111,74,255,.18);
}
.title-pill{
  padding:8px 18px;border-radius:999px;
  background:#eef2ff;border:1px solid var(--stroke);
}
.title-pill h1{ margin:0; font-size:var(--xl); letter-spacing:.2px; }

.header-actions{ display:flex; gap:8px; align-items:center; }
.mode{
  padding:8px 10px;
  border-radius:12px;
  border:1px solid var(--stroke);
  background:#fff;
  font-size:var(--sm);
}

/* ===== Main ===== */
.main{ flex:1; display:flex; justify-content:center; padding:0 12px 10px; }
.canvas{ width:100%; max-width:900px; display:flex; flex-direction:column; gap:8px; }
.chat-area{
  flex:1; overflow-y:auto;
  padding:14px;
  background:var(--panel);
  border-radius:var(--r);
  border:1px solid var(--stroke);
}
.chat{ display:flex; flex-direction:column; gap:12px; }

/* ===== Messages ===== */
.msg{ display:flex; gap:8px; align-items:flex-end; }
.msg.user{ flex-direction:row-reverse; }

.avatar{
  width:28px;height:28px;border-radius:50%;
  overflow:hidden; flex-shrink:0;
  border:1px solid var(--stroke);
  background:#e7eaff;
  display:flex; align-items:center; justify-content:center;
  font-size:var(--xs); cursor:pointer;
}
.avatar img{ width:100%; height:100%; object-fit:cover; }

.bubble{
  max-width:78%;
  padding:11px 12px;
  border-radius:var(--rb);
  box-shadow:var(--shadow);
  border:1px solid rgba(0,0,0,.06);
  background:#fff;
}
.msg.user .bubble{ background:#dfe6ff; border-bottom-right-radius:7px; }
.msg.ai .bubble{ background:#fff; border-bottom-left-radius:7px; }

/* ===== Rich text inside bubble ===== */
.bubble .rt{ font-size:var(--md); line-height:1.55; }
.bubble .rt h2{ margin:0 0 6px 0; font-size:var(--lg); letter-spacing:.2px; }
.bubble .rt h3{ margin:10px 0 6px 0; font-size:var(--md); color:var(--ink); }
.bubble .rt p{ margin:0 0 8px 0; }
.bubble .rt ul{ margin:6px 0 8px 18px; padding:0; }
.bubble .rt li{ margin:4px 0; }
.bubble .rt code{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size:.92em;
  background:rgba(0,0,0,.06);
  padding:1px 6px;
  border-radius:8px;
}
.bubble .rt .quote{
  border-left:3px solid rgba(120,84,255,.55);
  padding-left:10px;
  color:var(--muted);
  margin:8px 0;
  font-size:var(--sm);
}

/* ===== Feedback ===== */
.feedback-row{ margin-top:6px; display:flex; gap:8px; align-items:center; }
.fb-btn{
  border:1px solid var(--stroke);
  background:#fff;
  border-radius:999px;
  padding:4px 10px;
  cursor:pointer;
  font-size:var(--sm);
}
.fb-mini{ font-size:var(--xs); color:var(--muted); }

.fb-panel{
  margin-top:6px;
  padding:8px;
  border:1px solid var(--stroke);
  border-radius:12px;
  background:#fff;
}
.fb-panel textarea{
  width:100%;
  min-height:70px;
  resize:vertical;
  border:1px solid var(--stroke);
  border-radius:10px;
  padding:8px;
  font-family:inherit;
}
.fb-actions{ display:flex; justify-content:flex-end; gap:8px; margin-top:8px; }
.fb-save,.fb-cancel{
  border:1px solid var(--stroke);
  background:#fff;
  border-radius:10px;
  padding:6px 10px;
  cursor:pointer;
  font-size:var(--sm);
}

/* ===== Composer ===== */
.composer{
  display:flex;
  gap:10px;
  padding:12px;
  max-width:900px;
  width:100%;
  margin:0 auto;
}
.input-wrap{
  flex:1;
  background:#eef2ff;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--stroke);
}
#textInput{
  width:100%;
  border:none;
  outline:none;
  background:transparent;
  font-size:var(--md);
}
.icon-btn{
  width:44px;height:44px;
  border-radius:14px;
  border:1px solid var(--stroke);
  background:#fff;
  cursor:pointer;
}

.disclaimer{ font-size:var(--xs); color:var(--muted); padding:0 6px; }

@media (max-width:520px){
  .title-pill h1{ font-size:var(--lg); }
  .bubble{ max-width:86%; }
  .composer{ padding:10px; gap:8px; }
  .icon-btn{ width:42px; height:42px; }
}

/* AI avatar uses the same orb style as header bubble-orb */
.avatar.ai-orb{
  border: none;
  background: transparent;
  overflow: visible;
  box-shadow: none;
  cursor: default;
  display:flex;
  align-items:center;
  justify-content:center;
  width:28px;
  height:28px;
}

/* orb inside avatar should match .bubble-orb style */
.avatar.ai-orb .bubble-orb{
  width:28px;
  height:28px;
  border-radius:50%;
  background: linear-gradient(135deg,#c4cfff,#f0d9ff);
  box-shadow: 0 8px 20px rgba(111, 74, 255, .18);
}

.contact-btn{
  margin-top: 2rem; margin-right: 1rem;
  padding: 0.5rem 1.8rem;
  font-size: 1rem;
  background-color: radial-gradient(circle, rgba(247, 205, 224, 1) 0%, rgba(148, 187, 233, 1) 100%);
  border: 1px solid rgb(94, 92, 94);
  border-radius: 50px;
  color: black;
  transition: 0.3s;
}

.contact-btn:hover{
  background: #f7cde0;
  background: radial-gradient(circle, rgba(247, 205, 224, 1) 0%, rgba(148, 187, 233, 1) 100%);
  }
