/* ===== 株式会社CROSS LINK — AIカスタマーサポート =====
   Palette: warm charcoal × lime green（公式ブランドより）
   --------------------------------------------------- */
:root {
  --ink:        #393331;  /* ブランドのダークチャコール */
  --ink-2:      #2b2624;  /* さらに濃い影 */
  --ink-soft:   #4f4843;
  --lime:       #a6c61e;  /* ブランドのライムグリーン */
  --lime-bright:#bedc36;
  --lime-deep:  #8aa813;
  --lime-tint:  #eef4d4;  /* ユーザー発話の淡いライム */
  --paper:      #f4f3ee;  /* 温かみのあるオフホワイト */
  --card:       #ffffff;
  --line:       #e6e4dd;
  --muted:      #8f8a80;
  --text:       #2b2622;
  --on-dark:    #f4f2ec;
  --on-dark-soft:#c8c4ba;
  --radius:     16px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN",
               "Noto Sans JP", "Segoe UI", Meiryo, sans-serif;
  background: var(--paper);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ブランドの帯：画面最上部のライムのライン */
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 5px;
  background: var(--lime);
  z-index: 100;
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 72vh;
  display: grid;
  place-items: center;
  padding: 96px 24px 88px;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 88% -10%, rgba(166,198,30,.20), transparent 46%),
    linear-gradient(160deg, var(--ink) 0%, var(--ink-2) 100%);
  color: var(--on-dark);
}

/* シャッター（絞り）モチーフのウォーターマーク */
.hero::after {
  content: "";
  position: absolute;
  right: -120px;
  bottom: -140px;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  background: conic-gradient(
    from 12deg,
    rgba(166,198,30,.16) 0 30deg, transparent 0 60deg,
    rgba(166,198,30,.16) 0 90deg, transparent 0 120deg,
    rgba(166,198,30,.16) 0 150deg, transparent 0 180deg,
    rgba(166,198,30,.16) 0 210deg, transparent 0 240deg,
    rgba(166,198,30,.16) 0 270deg, transparent 0 300deg,
    rgba(166,198,30,.16) 0 330deg, transparent 0 360deg);
  -webkit-mask: radial-gradient(circle, transparent 28%, #000 29%);
          mask: radial-gradient(circle, transparent 28%, #000 29%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 880px;
  animation: rise .7s cubic-bezier(.2,.7,.2,1) both;
}

/* アイブロウ：社名 + ライムのシャッタードット */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  font-size: 13px;
  letter-spacing: .22em;
  font-weight: 700;
  color: var(--lime);
  text-transform: none;
}
.eyebrow::before {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    var(--lime) 0 45deg, transparent 0 90deg,
    var(--lime) 0 135deg, transparent 0 180deg,
    var(--lime) 0 225deg, transparent 0 270deg,
    var(--lime) 0 315deg, transparent 0 360deg);
  -webkit-mask: radial-gradient(circle, transparent 22%, #000 23%);
          mask: radial-gradient(circle, transparent 22%, #000 23%);
}

h1 {
  font-size: clamp(40px, 7vw, 78px);
  line-height: 1.05;
  letter-spacing: -.01em;
  margin: 0 0 8px;
  font-weight: 800;
}
/* 見出しのライムの下線アクセント */
h1::after {
  content: "";
  display: block;
  width: 84px;
  height: 6px;
  margin-top: 22px;
  background: var(--lime);
  border-radius: 3px;
}

.hero p {
  font-size: clamp(15px, 1.6vw, 18px);
  line-height: 1.9;
  max-width: 720px;
  color: var(--on-dark-soft);
  margin: 22px 0 0;
}

/* ===== Quick chips ===== */
.chips { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 30px; }
.chips button {
  border: 1.5px solid rgba(166,198,30,.55);
  background: rgba(166,198,30,.06);
  color: var(--lime);
  border-radius: 999px;
  padding: 11px 18px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, transform .18s ease, border-color .18s ease;
}
.chips button:hover {
  background: var(--lime);
  color: var(--ink);
  border-color: var(--lime);
  transform: translateY(-2px);
}

/* ===== Chat widget ===== */
.chat-widget {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: min(420px, calc(100vw - 32px));
  height: 624px;
  max-height: calc(100vh - 48px);
  background: var(--card);
  border-radius: 20px;
  box-shadow: 0 26px 80px rgba(43,38,36,.32);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: rise .5s ease both;
}

.chat-header {
  background: var(--ink);
  color: #fff;
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 3px solid var(--lime);
}
.chat-header strong {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
}
/* ヘッダーのシャッタードット */
.chat-header strong::before {
  content: "";
  width: 13px; height: 13px; border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    var(--lime) 0 45deg, transparent 0 90deg,
    var(--lime) 0 135deg, transparent 0 180deg,
    var(--lime) 0 225deg, transparent 0 270deg,
    var(--lime) 0 315deg, transparent 0 360deg);
  -webkit-mask: radial-gradient(circle, transparent 22%, #000 23%);
          mask: radial-gradient(circle, transparent 22%, #000 23%);
}
.chat-header small { display: block; opacity: .7; margin-top: 4px; letter-spacing: .04em; }
.chat-header button {
  background: transparent;
  color: #fff;
  border: 0;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  opacity: .8;
  transition: opacity .15s ease;
}
.chat-header button:hover { opacity: 1; }

.chat-body { flex: 1; padding: 18px; overflow-y: auto; background: #faf9f5; }

.bot, .user {
  padding: 12px 15px;
  border-radius: 16px;
  margin: 10px 0;
  line-height: 1.7;
  white-space: pre-wrap;
  font-size: 14.5px;
  max-width: 88%;
  word-break: break-word;
}
.bot {
  background: var(--card);
  border: 1px solid var(--line);
  border-top-left-radius: 5px;
  color: var(--text);
}
.user {
  background: var(--lime-tint);
  border: 1px solid #dfeab4;
  border-top-right-radius: 5px;
  color: #3a4413;
  margin-left: auto;
}

.chat-input {
  display: flex;
  gap: 8px;
  padding: 14px;
  border-top: 1px solid var(--line);
  background: var(--card);
}
.chat-input input {
  flex: 1;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text);
  transition: border-color .15s ease;
}
.chat-input input:focus {
  outline: none;
  border-color: var(--lime);
  box-shadow: 0 0 0 3px rgba(166,198,30,.22);
}
.chat-input button {
  border: 0;
  border-radius: 999px;
  padding: 12px 20px;
  font-weight: 800;
  cursor: pointer;
  background: var(--lime);
  color: var(--ink);
  transition: background .15s ease, transform .15s ease;
}
.chat-input button:hover { background: var(--lime-bright); transform: translateY(-1px); }

/* フローティングの起動ボタン */
.chat-open {
  position: fixed;
  right: 24px;
  bottom: 24px;
  border: 0;
  border-radius: 999px;
  padding: 14px 22px;
  font-weight: 800;
  cursor: pointer;
  background: var(--lime);
  color: var(--ink);
  box-shadow: 0 14px 34px rgba(43,38,36,.3);
  transition: background .15s ease, transform .15s ease;
}
.chat-open:hover { background: var(--lime-bright); transform: translateY(-2px); }

.hidden { display: none; }

/* RAG出典の表示 */
.sources {
  font-size: 12px;
  color: var(--ink-soft);
  background: #f3f5e6;
  border: 1px solid #e3ebc3;
  border-left: 3px solid var(--lime);
  border-radius: 12px;
  padding: 10px 12px;
  margin: 8px 0 14px;
}
.sources small { display: block; color: var(--muted); margin: 2px 0 6px; }
.sources span { display: block; margin-top: 4px; }

/* チャット内のリンク */
.bot a, .user a {
  color: var(--lime-deep);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.bot a:hover, .user a:hover { color: var(--ink); }

/* CTA ボタン行（Bot回答の下に表示） */
.cta-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  border-radius: 999px;
  padding: 9px 15px;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.cta-btn:hover { transform: translateY(-1px); }
.cta-primary { background: var(--lime); color: var(--ink); }
.cta-primary:hover { background: var(--lime-bright); }
.cta-ghost { background: #fff; color: var(--ink); border: 1.5px solid var(--line); }
.cta-ghost:hover { border-color: var(--lime); }
.cta-ic { font-size: 13px; line-height: 1; }

/* 選択式メニュー */
.menu { margin: 6px 0 14px; }
.menu-title {
  font-size: 12.5px;
  color: var(--muted);
  margin: 0 0 9px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.menu-title .ic { font-size: 14px; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opts.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.opt {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  border-radius: 12px;
  padding: 11px 13px;
  background: #fff;
  color: var(--ink);
  border: 1.5px solid var(--line);
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.opt:hover { border-color: var(--lime); background: #fbfcf3; transform: translateY(-1px); }
.opt .ic { font-size: 15px; }
.opt-back {
  background: transparent;
  border: 0;
  color: var(--lime-deep);
  font-weight: 700;
  padding: 8px 4px;
}
.opt-back:hover { background: transparent; color: var(--ink); transform: none; }
.opts.grid .opt-back { grid-column: 1 / -1; }

/* 入力中のローディングドット */
.loading .dots { display: inline-flex; gap: 5px; padding: 2px 0; }
.loading .dots i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--lime-deep); opacity: .4;
  animation: blink 1.2s infinite ease-in-out;
}
.loading .dots i:nth-child(2) { animation-delay: .2s; }
.loading .dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink {
  0%, 80%, 100% { opacity: .3; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

/* スクロールバー */
.chat-body::-webkit-scrollbar { width: 8px; }
.chat-body::-webkit-scrollbar-thumb { background: #d8d6cd; border-radius: 8px; }

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* アクセシビリティ */
:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

@media (max-width: 560px) {
  .hero { min-height: 64vh; padding: 80px 20px 72px; }
  .chat-widget { height: calc(100vh - 32px); right: 16px; bottom: 16px; }
}
