/* ── LiveInBooks — Chat UI ────────────────────────────────────── */

.win {
  width: 900px; max-width: calc(100vw - 2rem); height: 92vh;
  background: var(--chat-bg); border-radius: 12px; overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 0 0 1px rgba(45,90,61,.2), 0 32px 100px rgba(0,0,0,.6);
  animation: winIn .5s cubic-bezier(.16,1,.3,1) both;
}

/* ── Header ──────────────────────────────────────────────────── */
.hdr {
  background: #fff; border-bottom: 1px solid var(--border);
  padding: 1rem 2rem; display: flex; align-items: center; gap: 1rem; flex-shrink: 0;
}
.av-wrap { position: relative; flex-shrink: 0; }
.av {
  width: 100px; height: 100px; border-radius: 50%; overflow: hidden;
  border: 2.5px solid rgba(45,90,61,.25);
  box-shadow: 0 2px 12px rgba(45,90,61,.15);
}
.av img { width: 100%; height: 100%; object-fit: cover; object-position: center 8%; }
.av-dot {
  position: absolute; bottom: 3px; right: 3px;
  width: 12px; height: 12px; background: #5cb87a;
  border-radius: 50%; border: 2px solid #fff;
}
.hdr-info { flex: 1; }
.hdr-name { font-family: var(--display); font-size: 1.05rem; font-weight: 500; color: var(--text); }
.hdr-role { font-size: .7rem; color: var(--faint); margin-top: 2px; font-style: italic; }

/* ── Message feed ────────────────────────────────────────────── */
.msgs {
  flex: 1; overflow-y: auto; padding: 2rem 3rem 1.5rem;
  display: flex; flex-direction: column; gap: .6rem;
  position: relative;
}
.msgs-bg {
  position: sticky; top: 0; left: 0; width: 100%; height: 0; pointer-events: none; z-index: 0;
  overflow: visible;
}
.msgs-bg::after {
  content: ""; position: absolute; top: -2rem; left: -3rem; right: -3rem; height: 100vh;
  background-image: var(--chat-bg-img, none);
  background-position: center -200px;
  background-size: 100% auto;
  background-repeat: no-repeat;
  opacity: .25;
}
.msgs > *:not(.msgs-bg) { position: relative; z-index: 1; }
.msgs::-webkit-scrollbar { width: 3px; }
.msgs::-webkit-scrollbar-thumb { background: rgba(45,90,61,.18); border-radius: 2px; }
.day {
  text-align: center; font-size: .6rem; color: var(--faint);
  padding: .2rem 0 .5rem; font-family: var(--sans);
}

/* ── Agent bubbles ───────────────────────────────────────────── */
.row-v { display: flex; align-items: flex-end; gap: .4rem; animation: msgIn .3s ease both; }
.mini {
  width: 28px; height: 28px; border-radius: 50%; overflow: hidden;
  flex-shrink: 0; border: 1.5px solid rgba(45,90,61,.18);
}
.mini img { width: 100%; height: 100%; object-fit: cover; object-position: center 8%; }
.mini.ghost { visibility: hidden; }
.bub-v {
  background: #fff; border-radius: 16px 16px 16px 3px;
  padding: .85rem 1.2rem; max-width: 72%;
  box-shadow: 0 1px 6px rgba(0,0,0,.1); border: 1px solid rgba(0,0,0,.09);
}
.bub-v p { font-family: var(--body); font-size: 1.2rem; line-height: 1.55; color: #0a0f08; font-weight: 400; }
.bub-v p + p { margin-top: .4em; }
.bub-time { font-size: .56rem; color: var(--faint); margin-top: .3rem; font-family: var(--sans); }

/* ── User bubbles ────────────────────────────────────────────── */
.row-u { display: flex; justify-content: flex-end; animation: msgIn .25s ease both; }
.bub-u {
  background: var(--me); border-radius: 16px 16px 3px 16px;
  padding: .85rem 1.2rem; max-width: 60%;
}
.bub-u p { font-family: var(--body); font-size: 1.2rem; line-height: 1.55; color: rgba(220,240,220,.95); }
.bub-time-u { font-size: .56rem; color: rgba(220,240,220,.3); margin-top: .28rem; text-align: right; font-family: var(--sans); }

/* ── Typing indicator ────────────────────────────────────────── */
.row-t { display: flex; align-items: flex-end; gap: .4rem; }
.typing {
  background: #fff; border-radius: 16px 16px 16px 3px;
  padding: .62rem .8rem; box-shadow: 0 1px 3px rgba(0,0,0,.06);
  border: 1px solid rgba(0,0,0,.05); display: flex; gap: 3px; align-items: center;
}
.typing span {
  width: 5px; height: 5px; background: var(--faint); border-radius: 50%;
  animation: dot 1.1s ease-in-out infinite;
}
.typing span:nth-child(2) { animation-delay: .14s; }
.typing span:nth-child(3) { animation-delay: .28s; }

/* ── Input bar ───────────────────────────────────────────────── */
.input-wrap {
  background: #fff; border-top: 1px solid var(--border);
  padding: 1rem 3rem; display: flex; align-items: flex-end; gap: .75rem; flex-shrink: 0;
}
.chat-inp {
  flex: 1; background: var(--green-lt); border: 1px solid rgba(45,90,61,.2);
  border-radius: 18px; padding: .7rem 1.1rem; font-family: var(--body);
  font-size: 1.15rem; color: var(--text); outline: none; resize: none;
  min-height: 42px; max-height: 120px; line-height: 1.5; transition: border-color .2s;
}
.chat-inp:focus { border-color: var(--green); }
.chat-inp::placeholder { color: var(--faint); font-style: italic; }
.chat-inp:disabled { opacity: .4; }
.chat-btn {
  height: 30px; padding: 0 .85rem; background: var(--me); border: none; border-radius: 8px;
  color: rgba(184,146,74,.9); cursor: pointer; transition: all .2s;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  font-family: var(--sans); font-size: .72rem; font-weight: 500; letter-spacing: .04em;
}
.chat-btn:hover { background: var(--green-dk); color: #fff; }
.chat-btn:disabled { opacity: .28; cursor: not-allowed; }

/* ── Suggestions ─────────────────────────────────────────────── */
.suggestions {
  display: flex; flex-wrap: wrap; gap: .5rem;
  padding: .25rem 0 .5rem 36px;
  animation: msgIn .3s ease both;
}
.sug-btn {
  font-family: var(--sans); font-size: .8rem; font-weight: 400;
  color: var(--green); background: #fff;
  border: 1.5px solid rgba(45,90,61,.3); border-radius: 20px;
  padding: .4rem 1rem; cursor: pointer;
  transition: all .18s; white-space: nowrap;
}
.sug-btn:hover {
  background: var(--green); color: #fff;
  border-color: var(--green);
}
.sug-confirm {
  background: var(--me); color: rgba(240,235,215,.92);
  border-color: var(--me); font-weight: 500;
}
.sug-confirm:hover {
  background: var(--green-dk); border-color: var(--green-dk);
}
