.cl-ai-ask {
  margin: 2.5em 0 1.5em;
  padding: 1.4em 1.4em 1.2em;
  background: #eef5f0;
  border: 1px solid #c9d4ce;
  border-radius: 10px;
}
.cl-ai-ask__title {
  font-weight: 700;
  color: #123f32;
  margin-bottom: 0.8em;
  font-size: 1.05em;
}
.cl-ai-ask__form { display: flex; flex-direction: column; gap: 0.6em; }
.cl-ai-ask__input {
  width: 100%;
  border: 1px solid #c9d4ce;
  border-radius: 8px;
  padding: 0.7em 0.9em;
  font-size: 1em;
  background: #ffffff;
  resize: vertical;
}
.cl-ai-ask__input:focus { outline: 2px solid #1f5a46; border-color: #1f5a46; }
.cl-ai-ask__hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.cl-ai-ask__submit {
  align-self: flex-start;
  background: #1f5a46;
  color: #ffffff;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  padding: 0.75em 2.2em;
  font-size: 1em;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(18, 63, 50, 0.25);
}
.cl-ai-ask__submit:hover { background: #123f32; }
.cl-ai-ask__submit:disabled { background: #9aa5a0; cursor: wait; box-shadow: none; }
.cl-ai-ask__result:not(:empty) {
  margin-top: 1em;
  padding: 1em 1.1em;
  background: #ffffff;
  border: 1px solid #c9d4ce;
  border-radius: 8px;
}
.cl-ai-ask__answer p { margin: 0 0 0.7em; line-height: 1.8; }
.cl-ai-ask__answer p:last-child { margin-bottom: 0; }
.cl-ai-ask__error { color: #b91c1c; margin: 0; }
.cl-ai-ask__sources-label { font-weight: 700; color: #123f32; margin: 0.9em 0 0.3em; font-size: 0.92em; }
.cl-ai-ask__sources { margin: 0; padding-left: 1.4em; }
.cl-ai-ask__sources li { margin: 0.2em 0; font-size: 0.95em; }
.cl-ai-ask__sources a { color: #1f5a46; text-decoration: underline; }
.cl-ai-ask__footer { margin-top: 1em; display: flex; flex-direction: column; gap: 0.6em; }
.cl-ai-ask__disclaimer { font-size: 0.82em; color: #555f5a; }
.cl-ai-ask__cta {
  align-self: flex-start;
  background: #d97706;
  color: #ffffff !important;
  font-weight: 700;
  text-decoration: none !important;
  border-radius: 8px;
  padding: 0.7em 1.6em;
  font-size: 0.95em;
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.3);
}
.cl-ai-ask__cta:hover { opacity: 0.9; }
@media print { .cl-ai-ask { display: none; } }

/* ==== PCフローティングウィジェット（960px未満は非表示＝スマホは記事下ボックスのみ） ==== */
.cl-ai-ask-widget { display: none; }
@media screen and (min-width: 960px) {
  /* z-index は SWELL のモーダル(.c-modal 1000)・ライトボックス(.lum-lightbox 999)より下、
     「トップへ戻る」(.p-fixBtnWrap 99)より上。上に置くと暗幕の上にボタンが浮いてしまう。 */
  .cl-ai-ask-widget { display: block; position: fixed; right: 24px; bottom: 24px; z-index: 990; }
  /* SWELLの「トップへ戻る」ボタン（既定 right/bottom 2.5em）をランチャーの真上へ退避 */
  body .p-fixBtnWrap { bottom: 96px !important; right: 30px !important; }

  .cl-ai-ask-widget__launcher {
    display: flex; align-items: center; justify-content: center;
    width: 56px; height: 56px; padding: 0;
    border: none; border-radius: 50%; cursor: pointer;
    background: #1f5a46; color: #ffffff;
    box-shadow: 0 4px 16px rgba(18, 63, 50, 0.35);
    transition: background 0.15s, transform 0.15s;
  }
  .cl-ai-ask-widget__launcher:hover { background: #123f32; transform: scale(1.05); }
  .cl-ai-ask-widget__launcher svg { width: 26px; height: 26px; display: block; }
  .cl-ai-ask-widget__icon-close { display: none; }
  .cl-ai-ask-widget.is-open .cl-ai-ask-widget__icon-chat { display: none; }
  .cl-ai-ask-widget.is-open .cl-ai-ask-widget__icon-close { display: block; }

  .cl-ai-ask-widget__panel {
    position: absolute; right: 0; bottom: 72px;
    width: 384px; max-height: min(72vh, 640px);
    display: flex; flex-direction: column;
    background: #ffffff; border: 1px solid #c9d4ce; border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.24);
  }
  .cl-ai-ask-widget__panel[hidden] { display: none; }
  .cl-ai-ask-widget__header {
    display: flex; align-items: center; justify-content: space-between; gap: 0.6em;
    background: #1f5a46; color: #ffffff;
    padding: 0.85em 1.1em;
    font-weight: 700; font-size: 0.95em;
  }
  .cl-ai-ask-widget__close {
    flex: none; display: flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; padding: 0;
    background: transparent; border: none; border-radius: 6px;
    color: #ffffff; cursor: pointer;
  }
  .cl-ai-ask-widget__close:hover { background: rgba(255, 255, 255, 0.18); }
  .cl-ai-ask-widget__close svg { width: 18px; height: 18px; display: block; }
  .cl-ai-ask-widget__body { overflow-y: auto; }
  /* パネル内は記事下ボックスの器を外して密着させる（タイトルはヘッダーと重複するため非表示） */
  .cl-ai-ask-widget .cl-ai-ask { margin: 0; border: none; border-radius: 0; padding: 1em 1.1em 1.1em; }
  .cl-ai-ask-widget .cl-ai-ask__title { display: none; }
  /* 本文幅前提のCTAは384pxパネル内で2行に折り返すため、パネル内だけ詰める */
  .cl-ai-ask-widget .cl-ai-ask__cta { align-self: stretch; text-align: center; font-size: 0.88em; padding: 0.65em 0.9em; }
}
@media print { .cl-ai-ask-widget { display: none; } }
