/* ==========================================================================
   Good Rhythm Consulting - Journey ガイド  スタイル
   - すべて .grc-jg 配下にスコープ（SWELL本体のCSSと干渉しない）
   - カラーは CSS 変数で一括変更可能（サイトのキーカラーに合わせて調整）
   ========================================================================== */
.grc-jg {
  --grc-primary: #dd8500;        /* SWELLキーカラーに合わせて変更可 */
  --grc-primary-dark: #a66400;
  --grc-accent: #e8f0fa;
  --grc-text: #1f2937;
  --grc-muted: #6b7280;
  --grc-border: #e5e7eb;
  --grc-bg: #f7f8fa;
  --grc-user: #dd8500;
  --grc-radius: 18px;
  --grc-shadow: 0 18px 48px rgba(17, 24, 39, 0.20), 0 2px 8px rgba(0,0,0,.08);
  --grc-z: 9990;
  --grc-font: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, system-ui, sans-serif;

  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: var(--grc-z);
  font-family: var(--grc-font);
  font-size: 14px;
  line-height: 1.6;
  color: var(--grc-text);
}
.grc-jg *, .grc-jg *::before, .grc-jg *::after { box-sizing: border-box; }
.grc-jg.grc-hidden { display: none; }
.grc-jg svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.grc-ic { display: inline-flex; width: 1.15em; height: 1.15em; font-size: 1.1em; flex: 0 0 auto; }
.grc-ic svg { display: block; width: 100%; height: 100%; }

/* ---------- ランチャー ---------- */
.grc-launcher {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding: 0 22px 0 12px;
  border: 0;
  border-radius: 28px;
  background: linear-gradient(135deg, #f2a12b 0%, var(--grc-primary) 55%, var(--grc-primary-dark) 100%);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .02em;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(221, 133, 0, 0.35), 0 2px 6px rgba(0, 0, 0, 0.12);
  transition: transform .2s ease, box-shadow .2s ease;
}
.grc-launcher .grc-ic {
  position: relative; width: 36px; height: 36px; font-size: 18px; padding: 8px;
  border-radius: 50%; background: rgba(255,255,255,.2); box-sizing: border-box;
}
.grc-launcher .grc-ic::after {
  content: ""; position: absolute; width: 10px; height: 10px; border-radius: 50%;
  background: #22c55e; border: 2px solid #fff; right: -1px; bottom: -1px;
}
.grc-launcher:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 14px 32px rgba(221, 133, 0, 0.42), 0 2px 6px rgba(0,0,0,.12); }
.grc-launcher:focus-visible { outline: 3px solid #93c5fd; outline-offset: 2px; }
.grc-launcher-badge {
  display: none;
  position: absolute; top: -3px; right: -3px;
  width: 12px; height: 12px; border-radius: 50%;
  background: #f59e0b; border: 2px solid #fff;
}

.grc-dismiss {
  position: absolute; top: -7px; right: -7px;
  width: 20px; height: 20px; padding: 0;
  border: 1px solid var(--grc-border); border-radius: 50%;
  background: #fff; color: var(--grc-muted); font-size: 10px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .2s;
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
}
.grc-jg:hover .grc-dismiss, .grc-dismiss:focus-visible { opacity: 1; }
.grc-restore {
  display: none;
  position: fixed; right: 0; bottom: 140px;
  width: 38px; padding: 14px 0 12px; border: 0;
  border-radius: 12px 0 0 12px;
  background: var(--grc-primary); color: #fff;
  flex-direction: column; align-items: center; gap: 10px;
  box-shadow: -4px 0 14px rgba(0,0,0,.14);
  opacity: .82; cursor: pointer; font: inherit;
  transition: opacity .2s ease, transform .2s ease;
}
.grc-restore:hover { opacity: 1; transform: translateX(-2px); }
.grc-restore .grc-ic { font-size: 18px; width: 18px; height: 18px; }
.grc-restore-text { writing-mode: vertical-rl; font-size: 12px; font-weight: 700; letter-spacing: .18em; line-height: 1; }
.grc-restore:focus-visible { outline: 3px solid #93c5fd; outline-offset: 2px; }
.grc-jg.grc-min .grc-launcher, .grc-jg.grc-min .grc-panel { display: none !important; }
.grc-jg.grc-min .grc-restore { display: flex; }

/* ---------- パネル ---------- */
.grc-panel {
  position: absolute;
  right: 0; bottom: 64px;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 600px;
  max-height: calc(100vh - 110px);
  display: flex; flex-direction: column;
  background: #fff;
  border-radius: var(--grc-radius);
  box-shadow: var(--grc-shadow);
  overflow: hidden;
  opacity: 0; transform: translateY(12px) scale(.98);
  transition: opacity .22s ease, transform .22s ease;
  pointer-events: none;
}
.grc-panel[hidden] { display: flex; }
.grc-jg.grc-open .grc-panel { opacity: 1; transform: none; pointer-events: auto; }

.grc-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 12px 14px 16px;
  background: linear-gradient(135deg, #f2a12b 0%, var(--grc-primary) 60%, var(--grc-primary-dark) 100%); color: #fff;
}
.grc-head-id { display: flex; align-items: center; gap: 10px; min-width: 0; }
.grc-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,.18);
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.grc-title { margin: 0; font-size: 14px; font-weight: 700; line-height: 1.2; }
.grc-sub { margin: 2px 0 0; font-size: 12px; opacity: .85; line-height: 1.2; }
.grc-head-actions { display: flex; gap: 4px; }
.grc-iconbtn {
  width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px;
  background: transparent; color: #fff; font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.grc-iconbtn:hover { background: rgba(255,255,255,.16); }
.grc-iconbtn:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }

.grc-body { flex: 1; overflow-y: auto; padding: 16px 14px; background: var(--grc-bg); scroll-behavior: smooth; }
.grc-messages { display: flex; flex-direction: column; gap: 12px; }

/* ---------- メッセージ ---------- */
.grc-msg { display: flex; flex-direction: column; max-width: 92%; animation: grcIn .22s ease-out; }
.grc-msg-user { align-self: flex-end; align-items: flex-end; max-width: 85%; }
.grc-msg-who { font-size: 11px; color: var(--grc-muted); margin: 0 4px 3px; }
.grc-bubble {
  padding: 10px 13px; border-radius: 12px; font-size: 14px;
  background: #fff; border: 1px solid var(--grc-border);
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
  word-break: break-word;
}
.grc-msg-user .grc-bubble { background: linear-gradient(135deg, #f2a12b, var(--grc-primary)); color: #fff; border-color: transparent; border-bottom-right-radius: 4px; box-shadow: 0 2px 8px rgba(221,133,0,.25); }
.grc-msg-bot .grc-bubble { border-bottom-left-radius: 4px; }
.grc-bubble strong { font-weight: 700; color: var(--grc-primary-dark); }
.grc-msg-user .grc-bubble strong { color: #fff; }
.grc-bubble p { margin: 0; }
.grc-note { margin-top: 8px !important; font-size: 12px; color: var(--grc-muted); }
.grc-table { width: 100%; border-collapse: collapse; font-size: 12px; margin: 2px 0 4px; }
.grc-table th, .grc-table td { border: 1px solid var(--grc-border); padding: 5px 6px; text-align: left; vertical-align: top; }
.grc-table th { background: var(--grc-accent); font-weight: 700; white-space: nowrap; }
.grc-table td:first-child { background: #fafafa; font-weight: 600; white-space: nowrap; }
@keyframes grcIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* タイピング */
.grc-typing .grc-bubble { display: inline-flex; gap: 5px; padding: 12px 14px; }
.grc-typing i { width: 7px; height: 7px; border-radius: 50%; background: #9ca3af; animation: grcDot 1.2s infinite ease-in-out; }
.grc-typing i:nth-child(2) { animation-delay: .15s; }
.grc-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes grcDot { 0%, 80%, 100% { transform: scale(.6); opacity: .5; } 40% { transform: scale(1); opacity: 1; } }

/* ---------- CTA ---------- */
.grc-msg-ctas { max-width: 100%; }
.grc-ctas { display: flex; flex-direction: column; gap: 6px; }
.grc-cta {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: 10px;
  background: #fff; border: 1px solid var(--grc-border);
  color: var(--grc-text) !important; text-decoration: none !important;
  font-size: 13px; font-weight: 500; line-height: 1.4;
  transition: border-color .15s, background .15s, transform .15s;
}
.grc-cta:hover { border-color: var(--grc-primary); background: var(--grc-accent); transform: translateX(2px); }
.grc-cta .grc-ic { color: var(--grc-primary); }
.grc-cta-contact {
  background: var(--grc-primary); border-color: var(--grc-primary);
  color: #fff !important; font-weight: 700;
}
.grc-cta-contact .grc-ic { color: #fff; }
.grc-cta-contact:hover { background: var(--grc-primary-dark); border-color: var(--grc-primary-dark); color: #fff !important; }
.grc-cta-resource { border-color: #c7d2fe; background: #eef2ff; }
.grc-cta-external::after { content: ""; }

/* ---------- 入力エリア（選択肢） ---------- */
.grc-foot { border-top: 1px solid var(--grc-border); background: #fff; padding: 10px 12px 8px; }
.grc-input { display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow-y: auto; }
.grc-input-empty { display: block; height: 4px; }
.grc-choice {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 9px 12px;
  border: 1.5px solid var(--grc-primary); border-radius: 10px;
  background: #fff; color: var(--grc-primary);
  font: inherit; font-size: 13px; font-weight: 500; text-align: left; line-height: 1.4;
  cursor: pointer; transition: background .15s, color .15s;
}
.grc-choice:hover, .grc-choice:focus-visible { background: var(--grc-primary); color: #fff; outline: none; }
.grc-powered { margin: 8px 0 0; font-size: 10.5px; color: var(--grc-muted); text-align: center; line-height: 1.4; }

/* ---------- スクロールバー ---------- */
.grc-body::-webkit-scrollbar, .grc-input::-webkit-scrollbar { width: 6px; }
.grc-body::-webkit-scrollbar-thumb, .grc-input::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }

/* ---------- モバイル ---------- */
@media (max-width: 640px) {
  .grc-jg { right: 12px; bottom: 12px; }
  .grc-launcher { height: 48px; padding: 0 14px 0 12px; }
  .grc-launcher-text { display: none; }
  .grc-launcher { width: 48px; justify-content: center; padding: 0; border-radius: 50%; }
  .grc-panel {
    position: fixed; inset: 0; width: 100%; max-width: none; height: 100%; max-height: none;
    border-radius: 0; bottom: 0;
  }
  .grc-head { padding-top: calc(12px + env(safe-area-inset-top)); }
  .grc-foot { padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
  .grc-jg.grc-open .grc-launcher { display: none; }
}

/* ---------- アクセシビリティ ---------- */
@media (prefers-reduced-motion: reduce) {
  .grc-jg * { animation: none !important; transition: none !important; }
}
