@charset "UTF-8";

    :root {
      --cb-primary: #2563eb;
      --cb-primary-dark: #1d4ed8;
      --cb-bg: #f8fafc;
      --cb-white: #ffffff;
      --cb-border: #dbe3ee;
      --cb-text: #1e293b;
      --cb-subtext: #64748b;
      --cb-user-bg: #2563eb;
      --cb-user-text: #ffffff;
      --cb-bot-bg: #f1f5f9;
      --cb-shadow: 0 10px 30px rgba(15, 23, 42, 0.14);
      --cb-radius: 18px;
      --cb-z: 9999;
    }


    /* .cb-widget {
      margin: 0;
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
        Arial, "Noto Sans JP", sans-serif;
      background: #f3f4f6;
      color: var(--cb-text);
      padding: 0;
    } */

    /* ===== トリガーボタン ===== */
    .cb-launcher {
      position: fixed;
      right: 20px;
      bottom: 20px;
      z-index: var(--cb-z);
      border: none;
      outline: none;
      cursor: pointer;
      background: var(--cb-primary);
      color: #fff;
      border-radius: 999px;
      padding: 14px 18px;
      font-size: 14px;
      box-shadow: var(--cb-shadow);
      display: inline-flex;
      align-items: center;
      gap: 8px;
      transition: transform 0.18s ease, background 0.18s ease;
    }

    .cb-launcher:hover {
      transform: translateY(-1px);
    }

    .cb-launcher:focus-visible {
      outline: 3px solid rgba(37, 99, 235, 0.25);
      outline-offset: 2px;
    }

    /* ===== オーバーレイ ===== */
    .cb-overlay {
      position: fixed;
      inset: 0;
      background: rgba(15, 23, 42, 0.35);
      backdrop-filter: blur(2px);
      z-index: calc(var(--cb-z) - 1);
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.22s ease;
    }

    .cb-overlay.active {
      opacity: 1;
      pointer-events: auto;
    }

    /* ===== チャット本体 ===== */
    .cb-widget {
      position: fixed;
      right: 20px;
      bottom: 96px;
      width: 380px;
      max-width: calc(100vw - 24px);
      height: 640px;
      max-height: calc(100vh - 120px);
      background: var(--cb-white);
      border: 1px solid var(--cb-border);
      border-radius: 22px;
      box-shadow: var(--cb-shadow);
      display: flex;
      flex-direction: column;
      overflow: hidden;
      z-index: var(--cb-z);
      opacity: 0;
      transform: translateY(16px) scale(0.98);
      pointer-events: none;
      transition: opacity 0.25s ease, transform 0.25s ease;
      padding: 0;
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
        Arial, "Noto Sans JP", sans-serif;
    }
    .cb-widget button{
        box-shadow: none;
        text-shadow: none;
    }

    .cb-widget.active {
      opacity: 1;
      transform: translateY(0) scale(1);
      pointer-events: auto;
    }

    /* ===== ヘッダー ===== */
    .cb-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 14px 16px;
      background: linear-gradient(135deg, var(--cb-primary), var(--cb-primary-dark));
      color: #fff;
    }

    .cb-header-left {
      display: flex;
      align-items: center;
      gap: 10px;
      min-width: 0;
    }

    .cb-avatar {
      width: 40px;
      height: 40px;
      border-radius: 50%;
      background: rgba(255,255,255,0.18);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 20px;
      flex-shrink: 0;
    }

    .cb-title-wrap {
      min-width: 0;
    }

    .cb-title {
      font-size: 15px;
      font-weight: 700;
      line-height: 1.2;
    }

    .cb-subtitle {
      font-size: 12px;
      opacity: 0.9;
      margin-top: 2px;
    }

    .cb-close {
      width: 36px;
      height: 36px;
      border: none;
      border-radius: 10px;
      background: rgba(255,255,255,0.12);
      color: #fff;
      font-size: 20px;
      cursor: pointer;
      transition: background 0.2s ease;
      flex-shrink: 0;
      padding: 0;
    }

    .cb-close:hover {
      background: rgba(255,255,255,0.2);
    }

    /* ===== メッセージエリア ===== */
    .cb-body {
      flex: 1;
      background: var(--cb-bg);
      overflow-y: auto;
      padding: 14px;
      scroll-behavior: smooth;
    }

    .cb-body::-webkit-scrollbar {
      width: 8px;
    }

    .cb-body::-webkit-scrollbar-thumb {
      background: #cbd5e1;
      border-radius: 999px;
    }

    .cb-body::-webkit-scrollbar-track {
      background: transparent;
    }

    .cb-message {
      margin-bottom: 12px;
      display: flex;
      animation: cbFadeSlideIn 0.35s ease;
    }

    .cb-message.user {
      justify-content: flex-end;
    }

    .cb-message.bot {
      justify-content: flex-start;
    }

    .cb-bubble {
      max-width: 86%;
      padding: 12px 14px;
      border-radius: 16px;
      font-size: 14px;
      line-height: 1.7;
      word-break: break-word;
      white-space: pre-wrap;
    }

    .cb-message.user .cb-bubble {
      background: var(--cb-user-bg);
      color: var(--cb-user-text);
      border-bottom-right-radius: 0px;
    }

    .cb-message.bot .cb-bubble {
      background: var(--cb-bot-bg);
      color: var(--cb-text);
      border-bottom-left-radius: 6px;
      border: 1px solid #e2e8f0;
    }

    @keyframes cbFadeSlideIn {
      from {
        opacity: 0;
        transform: translateY(8px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    /* ===== セクション表示 ===== */
    .cb-block {
      margin-bottom: 14px;
      animation: cbFadeSlideIn 0.35s ease;
    }

    .cb-section-label {
      font-size: 12px;
      color: var(--cb-subtext);
      margin: 6px 0 8px;
      padding-left: 2px;
      animation: cbFadeSlideIn 0.35s ease;
    }

    /* ===== 選択肢 ===== */
    .cb-options {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-bottom: 14px;
      animation: cbFadeSlideIn 0.35s ease;
    }

    .cb-option-btn {
      border: 1px solid #bfdbfe;
      background: #eff6ff;
      color: #1d4ed8;
      border-radius: 999px;
      padding: 8px 12px;
      font-size: 13px;
      cursor: pointer;
      transition: all 0.2s ease;
      line-height: 1.6;
      text-align: left;
    }

    .cb-option-btn:hover {
      background: #dbeafe;
      transform: translateY(-1px);
    }

    .cb-option-btn:active {
      transform: translateY(0);
    }

    /* ===== CTA ===== */
    .cb-cta-wrap {
      display: flex;
      flex-direction: column;
      gap: 8px;
      margin: 8px 0 14px;
      animation: cbFadeSlideIn 0.35s ease;
    }

    .cb-cta-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      width: 100%;
      min-height: 42px;
      padding: 10px 12px;
      border-radius: 12px;
      text-decoration: none;
      font-size: 13px;
      font-weight: 700;
      transition: all 0.2s ease;
      border: 1px solid transparent;
    }

    .cb-cta-btn.primary {
      background: var(--cb-primary);
      color: #fff;
    }

    .cb-cta-btn.primary:hover {
      background: var(--cb-primary-dark);
      transform: translateY(-1px);
    }

    .cb-cta-btn.secondary {
      background: #fff;
      color: var(--cb-primary);
      border-color: #bfdbfe;
    }

    .cb-cta-btn.secondary:hover {
      background: #eff6ff;
      transform: translateY(-1px);
    }

    /* ===== 入力欄 ===== */
    .cb-footer {
      border-top: 1px solid var(--cb-border);
      background: var(--cb-white);
      padding: 12px;
    }

    .cb-input-row {
      display: flex;
      gap: 8px;
      align-items: flex-end;
    }

    .cb-input {
      flex: 1;
      min-height: 44px;
      max-height: 120px;
      resize: none;
      border: 1px solid #cbd5e1;
      border-radius: 14px;
      padding: 10px 12px;
      font-size: 14px;
      line-height: 1.5;
      outline: none;
      font-family: inherit;
      transition: border-color 0.2s ease, box-shadow 0.2s ease;
    }

    .cb-input:focus {
      border-color: #93c5fd;
      box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
    }

    .cb-send {
      height: 44px;
      min-width: 52px;
      padding: 0 14px;
      border: none;
      border-radius: 14px;
      background: var(--cb-primary);
      color: #fff;
      font-size: 14px;
      font-weight: 700;
      cursor: pointer;
      transition: background 0.2s ease, transform 0.2s ease;
    }

    .cb-send:hover {
      background: var(--cb-primary-dark);
    }

    .cb-send:active {
      transform: scale(0.98);
    }

    .cb-help {
      margin-top: 8px;
      font-size: 11px;
      color: var(--cb-subtext);
      text-align: center;
    }

    /* ===== モバイル ===== */
    @media (max-width: 640px) {
      .cb-launcher {
        right: 12px;
        bottom: 12px;
      }

      .cb-widget {
        right: 8px;
        left: 8px;
        bottom: 82px;
        width: auto;
        height: 78vh;
        max-height: 78vh;
        border-radius: 18px;
      }

      .cb-bubble {
        max-width: 92%;
      }
    }
    .cb-back-wrap {
      display: flex;
      justify-content: flex-start;
      margin-top: 12px;
    }

    .cb-back-btn {
      appearance: none;
      border: 1px solid #d1d5db;
      background: #fff;
      color: #374151;
      border-radius: 999px;
      padding: 10px 16px;
      font-size: 13px;
      line-height: 1.4;
      cursor: pointer;
      transition: all 0.2s ease;
    }

    .cb-back-btn:hover {
      background: #f9fafb;
      border-color: #9ca3af;
    }