/*
 * アクトちゃん（actenter.com 用）。act-recruit-lp の chat.module.css と同じ見た目。
 * スマホの下の固定バー（.an-bbar、z-index 60）の上に置き、年齢確認（z-index 100）より下にする。
 */
.act-chat-launcher[hidden],
.act-chat-panel[hidden] {
  display: none !important;
}
.act-chat-launcher,
.act-chat-panel,
.act-chat-panel * {
  box-sizing: border-box;
  font-family: "Roboto", "Zen Kaku Gothic New", "Hiragino Sans", system-ui, sans-serif;
}
.act-chat-panel p {
  margin: 0;
}

.act-chat-launcher {
  position: fixed;
  right: 16px;
  bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 6px;
  border-radius: 999px;
  background: #fff;
  color: #111;
  border: 1px solid #dedede;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.16);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
}

@media (min-width: 900px) {
  .act-chat-launcher {
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    right: 24px;
  }
}

.act-chat-launcher img,
.act-chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: #f4efe9;
}

.act-chat-panel {
  position: fixed;
  z-index: 90; /* 年齢確認（z-index 100）より下 */
  left: 0;
  right: 0;
  bottom: 0;
  height: 86vh;
  height: 86dvh;
  display: flex;
  flex-direction: column;
  background: #fff;
  color: #111;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.2);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  letter-spacing: 0.02em;
}

@media (min-width: 900px) {
  .act-chat-panel {
    left: auto;
    right: 24px;
    bottom: 24px;
    width: 380px;
    height: min(600px, calc(100vh - 48px));
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
  }
}

.act-chat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px 10px 14px;
  border-bottom: 1px solid #eee;
}

.act-chat-who {
  flex: 1;
  min-width: 0;
  line-height: 1.35;
}

.act-chat-who b {
  display: block;
  font-size: 15px;
}

.act-chat-who span {
  font-size: 12px;
  color: #666;
}

.act-chat-line {
  flex: none;
  padding: 7px 10px;
  border-radius: 8px;
  background: #06c755;
  color: #fff !important;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
}

.act-chat-close {
  flex: none;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  cursor: pointer;
  color: #333;
}

.act-chat-close:hover {
  background: #f2f2f2;
}

.act-chat-disclaimer {
  padding: 8px 14px;
  font-size: 12px;
  line-height: 1.6;
  color: #555;
  background: #f7f7f7;
  border-bottom: 1px solid #eee;
}

.act-chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: grid;
  align-content: start;
  gap: 10px;
  overscroll-behavior: contain;
}

.act-chat-msg {
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14.5px;
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.act-chat-bot {
  justify-self: start;
  background: #f4efe9;
  border-top-left-radius: 4px;
}

.act-chat-me {
  justify-self: end;
  background: #111;
  color: #fff;
  border-top-right-radius: 4px;
}

.act-chat-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.act-chat-links a,
.act-chat-links .act-chat-line-small {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid #c5322c;
  color: #c5322c !important;
  font-size: 12.5px;
  font-weight: 700;
  background: #fff;
}

.act-chat-links .act-chat-line-small {
  border-color: #06c755;
  background: #06c755;
  color: #fff !important;
}

.act-chat-typing {
  justify-self: start;
  padding: 10px 14px;
  border-radius: 12px;
  background: #f4efe9;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.act-chat-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 14px 0;
}

.act-chat-quick button {
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid #111;
  background: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.act-chat-quick button:disabled {
  opacity: 0.5;
  cursor: default;
}

.act-chat-form {
  display: flex;
  gap: 8px;
  padding: 10px 14px 14px;
}

.act-chat-input {
  flex: 1;
  min-width: 0;
  font-size: 16px; /* iPhone の自動拡大を防ぐため16px以上 */
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 10px;
  background: #fff;
  color: #111;
}

.act-chat-send {
  flex: none;
  padding: 0 14px;
  border-radius: 10px;
  background: #c5322c;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

.act-chat-send:disabled {
  opacity: 0.5;
  cursor: default;
}

.act-chat-count {
  padding: 0 14px 4px;
  font-size: 11.5px;
  color: #888;
  text-align: right;
}

/* テーマの button / input / a の見た目を受けないように戻す */
.act-chat-launcher,
.act-chat-panel button,
.act-chat-panel input {
  font-size: inherit;
  line-height: 1.4;
  text-transform: none;
  letter-spacing: 0.02em;
  margin: 0;
  min-height: 0;
  box-shadow: none;
}
.act-chat-launcher {
  font-size: 14px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.16);
}
.act-chat-close {
  background: transparent;
  border: 0;
  font-size: 22px;
  line-height: 1;
}
.act-chat-panel .act-chat-input {
  font-size: 16px;
  height: auto;
}
.act-chat-panel a {
  text-decoration: none;
}
.act-chat-launcher img,
.act-chat-avatar {
  max-width: none;
}
