/* The chat slide-over. */
.scrim {
  position: fixed;
  inset: 0;
  background: rgba(28, 46, 74, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 30;
}
.scrim.is-on { opacity: 1; pointer-events: auto; }

.panel {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(460px, 100%);
  background: var(--cream);
  color: var(--navy);
  z-index: 31;
  transform: translateX(102%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  box-shadow: -20px 0 60px -30px rgba(0, 0, 0, 0.5);
}
.panel.is-open { transform: none; }

.panel__cast { display: flex; gap: 6px; padding: 14px 14px 0; overflow-x: auto; scrollbar-width: none; }
.panel__cast::-webkit-scrollbar { display: none; }

.cast-chip {
  flex: 0 0 auto;
  width: var(--tap);
  height: var(--tap);
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  opacity: 0.55;
  border: 2px solid transparent;
  background: var(--sand);
  transition: opacity 0.2s ease;
}
.cast-chip[aria-current='true'] { opacity: 1; border-color: var(--rust); }
.cast-chip:hover { opacity: 1; }
.cast-chip img { width: 100%; height: 100%; object-fit: cover; }
.cast-chip__initial { font-family: var(--serif); font-size: 20px; color: var(--navy); }

.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px 10px;
  border-bottom: 1px solid var(--line);
}
.panel__head b { font-family: var(--serif); font-size: 24px; font-weight: 600; display: block; }
.panel__head small { font-size: 14px; opacity: 0.7; }
.panel__close { width: var(--tap); height: var(--tap); border-radius: 50%; font-size: 24px; display: grid; place-items: center; }

.panel__log { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 12px; }

.msg {
  max-width: 88%;
  padding: 12px 16px;
  border-radius: 18px;
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.4;
}
.msg--them { background: #fff; border-bottom-left-radius: 4px; align-self: flex-start; }
.msg--me {
  background: var(--navy);
  color: var(--cream);
  border-bottom-right-radius: 4px;
  align-self: flex-end;
  font-family: var(--sans);
  font-size: 17px;
}
.msg--problem { background: var(--sand); font-family: var(--sans); font-size: 16px; }

.msg.is-typing { min-width: 62px; min-height: 46px; position: relative; }
.msg.is-typing::after {
  content: '';
  position: absolute;
  left: 16px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--navy);
  box-shadow: 12px 0 var(--navy), 24px 0 var(--navy);
  animation: blink 1.2s infinite;
}
@keyframes blink { 0%, 100% { opacity: 0.25; } 50% { opacity: 0.9; } }

.taps { display: flex; flex-wrap: wrap; gap: 8px; }
.taps__button {
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--navy);
  font-size: 15px;
  background: transparent;
}
.taps__button:hover { background: var(--navy); color: var(--cream); }

.bookcard {
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  display: grid;
  gap: 6px;
  justify-items: start;
  font-size: 15px;
}
.bookcard b { font-family: var(--serif); font-size: 19px; }
.bookcard__meta { opacity: 0.75; }
.bookcard .btn { margin-top: 8px; }

.compose {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  background: var(--cream);
}
.compose__input {
  flex: 1;
  font: inherit;
  padding: 12px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: #fff;
  font-size: 16px;
  min-width: 0;
}
.compose .btn { min-height: 44px; padding: 0 18px; }
