/* Edyt guide chat mockup — local preview widget */

.edyt-chat-launcher {
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  z-index: 9990;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 0;
  border-radius: 999px;
  padding: 0.7rem 1rem;
  background: #1a1a1a;
  color: #fff;
  font: 600 0.85rem/1.2 system-ui, -apple-system, sans-serif;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

/* Desktop: Ask Edyt sits on the TOC rail’s right edge.
   The open panel stays in the right page gutter (wider). */
@media (min-width: 960px) {
  .edyt-chat-launcher {
    right: max(
      1.1rem,
      calc((100vw - min(100vw, var(--max, 1120px))) / 2 + var(--shell-pad, 1.25rem))
    );
  }

  .edyt-chat-panel {
    right: 1.1rem;
    width: min(400px, calc(100vw - 2rem));
  }
}

.edyt-chat-launcher:hover {
  background: #000;
}

.edyt-chat-launcher[hidden] {
  display: none !important;
}

.edyt-chat-panel {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 9991;
  width: min(380px, calc(100vw - 1.5rem));
  height: min(640px, calc(100vh - 2rem));
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e6e2dc;
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  font-family: system-ui, -apple-system, sans-serif;
}

.edyt-chat-panel[hidden] {
  display: none !important;
}

.edyt-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #eeeae4;
  background: #faf9f7;
}

.edyt-chat-brand {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1a1a1a;
}

.edyt-chat-brand span {
  font-weight: 500;
  color: #6b6560;
}

.edyt-chat-close {
  border: 0;
  background: transparent;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  color: #444;
  padding: 0.15rem 0.35rem;
}

.edyt-chat-body {
  flex: 1;
  overflow: auto;
  padding: 1rem;
  background: #fff;
}

.edyt-chat-intro h2 {
  margin: 0 0 0.65rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.edyt-chat-intro p {
  margin: 0 0 0.85rem;
  font-size: 0.88rem;
  line-height: 1.45;
  color: #4a453f;
}

.edyt-chat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.edyt-chat-pill {
  border: 1px solid #d9d2c8;
  background: #f3f0eb;
  color: #1a1a1a;
  border-radius: 999px;
  padding: 0.4rem 0.7rem;
  font-size: 0.78rem;
  line-height: 1.25;
  cursor: pointer;
  text-align: left;
}

.edyt-chat-pill:hover {
  background: #eae5dd;
}

.edyt-chat-msg--bot .edyt-chat-pills--followup {
  margin: 0.15rem 0 0.65rem;
}

.edyt-chat-email-again {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
}

.edyt-chat-email-link {
  background: none;
  border: 0;
  padding: 0;
  color: #5a554f;
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
}

.edyt-chat-msg {
  margin: 0 0 0.75rem;
  max-width: 88%;
  font-size: 0.88rem;
  line-height: 1.45;
}

.edyt-chat-msg--user {
  margin-left: auto;
  background: #f0eeea;
  border-radius: 14px 14px 4px 14px;
  padding: 0.65rem 0.8rem;
}

.edyt-chat-msg--bot {
  margin-right: auto;
  max-width: 92%;
  color: #1a1a1a;
}

.edyt-chat-msg--bot .edyt-chat-text {
  margin: 0 0 0.55rem;
  max-width: 34ch;
}

.edyt-chat-msg--bot .edyt-chat-text p {
  margin: 0 0 0.45rem;
}

.edyt-chat-table-wrap,
.edyt-chat-cards,
.edyt-chat-disclosure,
.edyt-chat-email {
  max-width: 100%;
}

.edyt-chat-table-wrap {
  overflow: auto;
  border: 1px solid #e6e2dc;
  border-radius: 10px;
  margin: 0.4rem 0 0.7rem;
}

.edyt-chat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
}

.edyt-chat-table th,
.edyt-chat-table td {
  padding: 0.45rem 0.55rem;
  border-bottom: 1px solid #eeeae4;
  text-align: left;
  vertical-align: top;
  word-break: break-word;
}

.edyt-chat-table th {
  background: #faf9f7;
  font-weight: 600;
  font-size: 0.72rem;
  line-height: 1.25;
  max-width: 9.5rem;
}

.edyt-chat-cards {
  display: grid;
  gap: 0.55rem;
  margin: 0.35rem 0 0.55rem;
}

.edyt-chat-card {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 0.55rem;
  border: 1px solid #e6e2dc;
  border-radius: 10px;
  padding: 0.55rem;
  background: #fff;
}

.edyt-chat-card img,
.edyt-chat-card-ph {
  width: 56px;
  height: 56px;
  object-fit: contain;
  background: #f6f4f0;
  border-radius: 8px;
}

.edyt-chat-card-ph {
  border: 1px dashed #e0dbd4;
}

.edyt-chat-card strong {
  display: block;
  font-size: 0.8rem;
  line-height: 1.3;
  margin-bottom: 0.2rem;
}

.edyt-chat-card p {
  margin: 0 0 0.4rem;
  font-size: 0.72rem;
  color: #5a554f;
  line-height: 1.35;
}

.edyt-chat-card a {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  color: #fff;
  background: #e87722;
  text-decoration: none;
  border-radius: 6px;
  padding: 0.35rem 0.55rem;
}

.edyt-chat-disclosure {
  margin: 0.35rem 0 0.55rem;
  font-size: 0.7rem;
  color: #6b6560;
  line-height: 1.35;
}

.edyt-chat-email {
  margin-top: 0.55rem;
  padding: 0.65rem;
  border: 1px dashed #d5cfc6;
  border-radius: 10px;
  background: #faf9f7;
}

.edyt-chat-email p {
  margin: 0 0 0.45rem;
  font-size: 0.78rem;
  color: #4a453f;
}

.edyt-chat-email form {
  display: flex;
  gap: 0.35rem;
}

.edyt-chat-email input {
  flex: 1;
  border: 1px solid #d5cfc6;
  border-radius: 8px;
  padding: 0.4rem 0.5rem;
  font-size: 0.78rem;
}

.edyt-chat-email button {
  border: 0;
  border-radius: 8px;
  background: #1a1a1a;
  color: #fff;
  padding: 0.4rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.edyt-chat-email .edyt-chat-skip {
  display: inline-block;
  margin-top: 0.35rem;
  border: 0;
  background: none;
  color: #6b6560;
  font-size: 0.72rem;
  cursor: pointer;
  text-decoration: underline;
}

.edyt-chat-typing {
  font-size: 0.8rem;
  color: #6b6560;
  margin: 0 0 0.75rem;
}

.edyt-chat-foot {
  border-top: 1px solid #eeeae4;
  padding: 0.65rem;
  background: #fff;
  display: flex;
  gap: 0.4rem;
  align-items: flex-end;
}

.edyt-chat-foot textarea {
  flex: 1;
  border: 1px solid #d9d2c8;
  border-radius: 14px;
  padding: 0.55rem 0.85rem;
  font-size: 0.85rem;
  font-family: inherit;
  line-height: 1.35;
  resize: none;
  overflow-y: auto;
  min-height: 2.35rem;
  max-height: 140px;
  field-sizing: content;
  box-sizing: border-box;
  outline: none;
}

.edyt-chat-foot textarea:focus {
  border-color: #c45c26;
}

.edyt-chat-foot button {
  border: 0;
  border-radius: 999px;
  width: 2.35rem;
  height: 2.35rem;
  flex: 0 0 2.35rem;
  background: #1a1a1a;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
}

.edyt-chat-foot button:disabled {
  opacity: 0.45;
  cursor: default;
}

@media (max-width: 520px) {
  .edyt-chat-panel {
    right: 0.5rem;
    bottom: 0.5rem;
    width: calc(100vw - 1rem);
    height: calc(100vh - 1rem);
    border-radius: 12px;
  }
}
