/* =========================================================
   OchiAI総務 常駐チャットウィジェット
   ========================================================= */

.och {
  --och-ink: #14181D;
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  font-family: 'M PLUS 1p', 'Noto Sans JP', sans-serif;
}

.och__sronly {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- ランチャー ---------- */

.och__launch {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--och-ink);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 13px 22px 13px 16px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(16, 20, 24, .28);
  transition: transform .25s ease, opacity .25s ease;
}
.och__launch:hover { transform: translateY(-2px); }
.och.is-open .och__launch { opacity: 0; pointer-events: none; }

.och__launch-icon { display: flex; align-items: flex-end; gap: 3px; height: 14px; }
.och__launch-icon span {
  width: 3px; background: #fff; border-radius: 2px;
  animation: ochWave 1.1s ease-in-out infinite;
}
.och__launch-icon span:nth-child(1) { height: 7px; }
.och__launch-icon span:nth-child(2) { height: 13px; animation-delay: .15s; }
.och__launch-icon span:nth-child(3) { height: 9px; animation-delay: .3s; }

@keyframes ochWave { 0%,100% { transform: scaleY(.6); } 50% { transform: scaleY(1); } }

/* ---------- パネル ---------- */

.och__panel {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 370px;
  height: 540px;
  max-height: calc(100vh - 40px);
  background: #fff;
  border: 1px solid rgba(16, 20, 24, .14);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(16, 20, 24, .28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px) scale(.98);
  transition: opacity .22s ease, transform .22s ease;
}
.och.is-open .och__panel { opacity: 1; transform: none; }

/* hidden 属性を display:flex が上書きしてしまうため明示的に消す。
   閉じている間はクリックも透過させ、ランチャーを塞がないようにする。 */
.och__panel[hidden] { display: none; }
.och__panel { pointer-events: none; }
.och.is-open .och__panel { pointer-events: auto; }

.och__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--och-ink);
  color: #fff;
  padding: 14px 14px 14px 18px;
  flex: none;
}
.och__head-name b { display: block; font-size: 14.5px; font-weight: 700; }
.och__head-name span { display: block; font-size: 10.5px; letter-spacing: .1em; color: rgba(255,255,255,.6); margin-top: 2px; }

.och__close {
  background: none; border: none; color: #fff;
  font-size: 24px; line-height: 1; cursor: pointer; padding: 4px 6px;
}
.och__close:hover { opacity: .7; }

/* ---------- ログ ---------- */

.och__log {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px 6px;
  background: #F5F7FA;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.och__msg {
  max-width: 84%;
  font-size: 13.5px;
  line-height: 1.85;
  padding: 11px 14px;
  border-radius: 14px;
  word-break: break-word;
}
.och__msg--bot { align-self: flex-start; background: #fff; border: 1px solid rgba(16,20,24,.1); border-bottom-left-radius: 4px; }
.och__msg--user { align-self: flex-end; background: var(--och-ink); color: #fff; border-bottom-right-radius: 4px; }
.och__msg.is-sys { color: #8A5A00; background: #FFF8E8; border-color: #F0DFB8; }
.och__msg.is-typing { letter-spacing: .2em; opacity: .55; }

/* ---------- サジェスト ---------- */

.och__sugg { padding: 6px 14px 0; background: #F5F7FA; display: flex; flex-wrap: wrap; gap: 6px; }
.och__chip {
  font-family: inherit;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--och-ink);
  background: #fff;
  border: 1px solid rgba(16,20,24,.22);
  border-radius: 999px;
  padding: 7px 12px;
  cursor: pointer;
  text-align: left;
}
.och__chip:hover { background: var(--och-ink); color: #fff; border-color: var(--och-ink); }

/* ---------- 入力 ---------- */

.och__form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px 14px 6px;
  background: #F5F7FA;
}
.och__form textarea {
  flex: 1;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--och-ink);
  background: #fff;
  border: 1px solid rgba(16,20,24,.18);
  border-radius: 10px;
  padding: 10px 12px;
  resize: none;
  max-height: 120px;
}
.och__form textarea:focus { outline: 2px solid var(--och-ink); outline-offset: 1px; }

.och__send {
  flex: none;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  background: var(--och-ink);
  color: #fff;
  border: none; border-radius: 10px; cursor: pointer;
}
.och__send:hover { opacity: .85; }
.och__send:disabled { opacity: .4; cursor: default; }

.och__note {
  margin: 0;
  padding: 6px 14px 12px;
  background: #F5F7FA;
  font-size: 10px;
  line-height: 1.6;
  color: rgba(16,20,24,.5);
}

/* ---------- SP ---------- */

@media (max-width: 767px) {
  .och { right: 14px; bottom: 14px; }
  .och__launch { padding: 12px 18px 12px 14px; font-size: 12.5px; }
  .och__panel {
    position: fixed;
    right: 0; left: 0; bottom: 0; top: 0;
    width: auto; height: auto; max-height: none;
    border-radius: 0;
    border: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .och__launch-icon span { animation: none; }
  .och__panel { transition: none; }
}
