/* AI店長の窓。サイトのデザインとぶつからないように、すべて #ait-root の中だけに効かせる */
#ait-root {
  --ait-grad: linear-gradient(120deg, #2b5cff 0%, #6d3cf5 40%, #c42bbf 72%, #f0365a 100%);
  --ait-ink: #222;
  --ait-sub: #666;
  --ait-line: #06c755;
  position: fixed;
  bottom: var(--ait-bottom, 90px);
  z-index: 99990;
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ait-ink);
}
#ait-root.ait-right { right: 16px; }
#ait-root.ait-left { left: 16px; }
#ait-root *, #ait-root *::before, #ait-root *::after { box-sizing: border-box; }
#ait-root button { font-family: inherit; cursor: pointer; }

#ait-root .ait-fab {
  display: flex; align-items: center; gap: 6px;
  border: 0; border-radius: 999px; padding: 12px 18px;
  background: var(--ait-grad); color: #fff; font-size: 15px; font-weight: bold;
  box-shadow: 0 6px 18px rgba(140, 50, 220, .35);
}
#ait-root .ait-fab:hover { filter: brightness(1.06); }
#ait-root.ait-open .ait-fab { display: none; }
#ait-root .ait-spark { font-size: 1.1em; }

#ait-root .ait-panel {
  position: absolute; bottom: 0;
  width: 370px; max-width: calc(100vw - 32px);
  height: 600px; max-height: calc(100vh - var(--ait-bottom, 90px) - 24px);
  display: flex; flex-direction: column;
  background: #fff; border-radius: 16px; overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .22);
}
#ait-root.ait-right .ait-panel { right: 0; }
#ait-root.ait-left .ait-panel { left: 0; }
#ait-root .ait-panel[hidden] { display: none; }

#ait-root .ait-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px 10px 16px; background: var(--ait-grad); color: #fff;
}
#ait-root .ait-title { display: flex; align-items: center; gap: 6px; font-weight: bold; flex-wrap: wrap; }
#ait-root .ait-badge { font-size: 11px; font-weight: normal; background: rgba(255,255,255,.25); border-radius: 999px; padding: 1px 8px; }
#ait-root .ait-close { border: 0; background: transparent; color: #fff; font-size: 24px; line-height: 1; padding: 2px 6px; }

#ait-root .ait-note { font-size: 12px; color: var(--ait-sub); background: #f5f6ff; padding: 8px 14px; }

#ait-root .ait-log { flex: 1; overflow-y: auto; padding: 12px; background: #fafafa; }
#ait-root .ait-msg { display: flex; margin: 0 0 10px; flex-direction: column; }
#ait-root .ait-user { align-items: flex-end; }
#ait-root .ait-bot { align-items: flex-start; }
#ait-root .ait-bubble {
  max-width: 88%; padding: 9px 12px; border-radius: 14px; white-space: pre-wrap; word-break: break-word;
}
#ait-root .ait-user .ait-bubble { background: #5a3cf0; color: #fff; border-bottom-right-radius: 4px; }
#ait-root .ait-bot .ait-bubble { background: #fff; border: 1px solid #e3e5f0; border-bottom-left-radius: 4px; }
#ait-root .ait-bot-row { display: flex; align-items: flex-start; gap: 6px; width: 100%; }
#ait-root .ait-bot-row .ait-bubble { flex: 1 1 auto; min-width: 0; max-width: none; }
#ait-root .ait-jump { flex: 0 0 auto; width: 64px; border: 0; border-radius: 12px; padding: 8px 4px; background: var(--ait-grad); color: #fff; font-size: 12px; font-weight: bold; line-height: 1.35; white-space: pre-line; text-align: center; cursor: pointer; box-shadow: 0 2px 8px rgba(140, 50, 220, .3); }
#ait-root .ait-contact.ait-flash { animation: ait-flash 1.2s ease-out; }
@keyframes ait-flash { 0% { box-shadow: 0 0 0 4px rgba(122, 60, 240, .55); } 100% { box-shadow: 0 0 0 0 rgba(122, 60, 240, 0); } }
#ait-root .ait-sources { font-size: 12px; margin-top: 4px; max-width: 88%; color: var(--ait-sub); }
#ait-root .ait-sources a { display: block; color: #3550d6; text-decoration: underline; }

#ait-root .ait-dot { display: inline-block; width: 7px; height: 7px; margin: 0 2px; border-radius: 50%; background: #9aa3c7; animation: ait-blink 1.2s infinite; }
#ait-root .ait-dot:nth-child(2) { animation-delay: .2s; }
#ait-root .ait-dot:nth-child(3) { animation-delay: .4s; }
@keyframes ait-blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

#ait-root .ait-contact { background: #fff; border: 2px solid #7a3cf0; border-radius: 12px; padding: 10px 12px; margin: 0 0 12px; }
#ait-root .ait-contact-title { font-weight: bold; margin-bottom: 6px; }
#ait-root .ait-memo { background: #f5f6ff; border-radius: 8px; padding: 6px 10px; margin-bottom: 8px; font-size: 13px; }
#ait-root .ait-memo-label { font-size: 11px; color: var(--ait-sub); }
#ait-root .ait-memo-label { display: block; margin-bottom: 4px; }
#ait-root textarea.ait-memo-text { display: block; width: 100%; box-sizing: border-box; margin: 0; padding: 6px 8px; border: 1px solid #c9cdf5; border-radius: 6px; background: #fff; color: var(--ait-ink); font: inherit; font-size: 14px; line-height: 1.5; resize: vertical; min-height: 60px; }
#ait-root textarea.ait-memo-text:focus { outline: 2px solid #7b4dff; outline-offset: 0; border-color: #7b4dff; }
#ait-root .ait-contact-row { display: flex; gap: 6px; flex-wrap: wrap; }
#ait-root .ait-btn {
  flex: 1 1 30%; text-align: center; padding: 9px 6px; border-radius: 8px;
  font-weight: bold; font-size: 14px; text-decoration: none; color: #fff; white-space: nowrap;
}
#ait-root .ait-line { background: var(--ait-line); }
#ait-root .ait-tel { background: #e8573a; }
#ait-root .ait-form-btn { background: #555; }
#ait-root .ait-hours { font-size: 12px; color: var(--ait-sub); margin-top: 6px; }
#ait-root .ait-copy { margin-top: 6px; border: 1px solid #c8cbe0; background: #fff; border-radius: 6px; font-size: 12px; padding: 3px 10px; }

#ait-root .ait-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px 0; background: #fff; }
#ait-root .ait-chip { border: 1px solid #b9c3ff; background: #f3f5ff; color: #3550d6; border-radius: 999px; padding: 4px 10px; font-size: 13px; }

#ait-root .ait-form { display: flex; gap: 6px; padding: 8px 12px; background: #fff; border-top: 1px solid #eee; }
#ait-root .ait-input {
  flex: 1; resize: none; border: 1px solid #cfd3e6; border-radius: 10px; padding: 8px 10px;
  font: inherit; font-size: 16px; /* 16px 未満だと iPhone で拡大されてしまう */
}
#ait-root .ait-send { border: 0; border-radius: 10px; padding: 0 14px; background: var(--ait-grad); color: #fff; font-weight: bold; }
#ait-root .ait-send:disabled { opacity: .5; cursor: default; }

#ait-root .ait-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 0 12px 10px; background: #fff; flex-wrap: wrap; }
#ait-root .ait-direct { border: 0; background: transparent; color: #3550d6; text-decoration: underline; font-size: 13px; padding: 0; }
#ait-root .ait-privacy { font-size: 11px; color: #999; }

/* ショートコードのボタン（ページの中） */
.ait-inline-btn {
  border: 0; border-radius: 999px; padding: 12px 22px; cursor: pointer;
  background: linear-gradient(120deg, #2b5cff 0%, #6d3cf5 40%, #c42bbf 72%, #f0365a 100%);
  color: #fff; font-weight: bold; font-size: 16px;
}

/* スマホ：画面の下半分以上を使う */
@media (max-width: 600px) {
  #ait-root textarea.ait-memo-text { font-size: 16px; }
  #ait-root.ait-open { left: 0 !important; right: 0 !important; bottom: 0 !important; }
  #ait-root.ait-open .ait-panel { position: fixed; left: 0; right: 0; bottom: 0; width: 100%; max-width: 100%; height: 85vh; max-height: 85vh; height: 85dvh; max-height: 85dvh; border-radius: 16px 16px 0 0; }
  #ait-root .ait-fab { padding: 10px 14px; font-size: 14px; }
}
