/* ===================== */
/* フローティングウィジェット */
/* ===================== */
#wp7-chatbot-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
#wp7-chatbot-toggle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--wp7cb-primary, #3858e9);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    transition: transform 0.2s, background 0.2s;
}
#wp7-chatbot-toggle:hover {
    transform: scale(1.08);
    background: var(--wp7cb-primary-hover, #2745d4);
}
#wp7-chatbot-panel {
    position: absolute;
    bottom: 72px;
    right: 0;
    width: 360px;
    max-height: 500px;
    background: #fff;
    border-radius: var(--wp7cb-radius, 16px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.18);
    display: flex;
    flex-direction: column;
    overflow: visible;
    transition: opacity 0.25s, transform 0.25s;
}
#wp7-chatbot-panel.wp7-chatbot-hidden {
    opacity: 0;
    transform: translateY(16px) scale(0.95);
    pointer-events: none;
}
#wp7-chatbot-header {
    background: var(--wp7cb-primary, #3858e9);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 15px;
    border-radius: var(--wp7cb-radius, 16px) var(--wp7cb-radius, 16px) 0 0;
}
#wp7-chatbot-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
}
#wp7-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    max-height: 340px;
    min-height: 120px;
}

/* ===================== */
/* 吹き出し共通 */
/* ===================== */
.wp7-msg {
    margin-bottom: 12px;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    max-width: 85%;
    word-wrap: break-word;
}
.wp7-msg-bot {
    background: var(--wp7cb-bot-bg, #f0f2f5);
    color: var(--wp7cb-bot-text, #1a1a1a);
    border-bottom-left-radius: 4px;
}
.wp7-msg-user {
    background: var(--wp7cb-primary, #3858e9);
    color: #fff;
    margin-left: auto;
    border-bottom-right-radius: 4px;
    text-align: right;
}
.wp7-msg-loading {
    background: var(--wp7cb-bot-bg, #f0f2f5);
    color: #888;
    font-style: italic;
}

/* ===================== */
/* 入力エリア */
/* ===================== */
#wp7-chatbot-input-area {
    display: flex;
    padding: 12px;
    border-top: 1px solid #e5e7eb;
    gap: 8px;
}
#wp7-chatbot-input {
    flex: 1;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    outline: none;
}
#wp7-chatbot-input:focus {
    border-color: var(--wp7cb-primary, #3858e9);
}
#wp7-chatbot-send {
    background: var(--wp7cb-primary, #3858e9);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
}
#wp7-chatbot-send:hover {
    background: var(--wp7cb-primary-hover, #2745d4);
}
#wp7-chatbot-send:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

/* ===================== */
/* サジェストバー */
/* ===================== */
.wp7-suggest-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 12px;
    border-top: 1px solid #f0f0f0;
    background: #fafbfc;
    max-height: 80px;
    overflow-y: auto;
}
.wp7-suggest-bar:empty {
    display: none;
}
.wp7-suggest-btn {
    background: #fff;
    border: 1px solid var(--wp7cb-primary, #3858e9);
    color: var(--wp7cb-primary, #3858e9);
    border-radius: 16px;
    padding: 5px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    text-align: left;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.wp7-suggest-btn:hover {
    background: var(--wp7cb-primary, #3858e9);
    color: #fff;
}

/* ===================== */
/* 免責表示 */
/* ===================== */
.wp7-disclaimer {
    text-align: center;
    font-size: 10px;
    color: #b0b0b0;
    padding: 3px 12px 6px;
    line-height: 1.3;
}

/* ===================== */
/* リサイズハンドル */
/* ===================== */
.wp7-resize-handle {
    position: absolute;
    z-index: 10;
}
.wp7-resize-top {
    top: -3px;
    left: 20px;
    right: 20px;
    height: 6px;
    cursor: ns-resize;
}
.wp7-resize-left {
    top: 20px;
    bottom: 20px;
    left: -3px;
    width: 6px;
    cursor: ew-resize;
}
.wp7-resize-tl {
    top: -3px;
    left: -3px;
    width: 14px;
    height: 14px;
    cursor: nwse-resize;
}

/* ===================================================== */
/* テンプレート: チャット (chat) — LINE/メッセンジャー風   */
/* ===================================================== */
[data-theme="chat"] #wp7-chatbot-panel {
    border-radius: 24px;
}
[data-theme="chat"] #wp7-chatbot-header {
    border-radius: 24px 24px 0 0;
    padding: 12px 16px;
}
[data-theme="chat"] .wp7-msg {
    border-radius: 18px;
}
[data-theme="chat"] .wp7-msg-bot {
    border-bottom-left-radius: 4px;
}
[data-theme="chat"] .wp7-msg-user {
    border-bottom-right-radius: 4px;
}
[data-theme="chat"] .wp7-suggest-btn {
    border-radius: 20px;
}

/* ===================================================== */
/* テンプレート: ミニマル (minimal) — フラット             */
/* ===================================================== */
[data-theme="minimal"] #wp7-chatbot-panel {
    box-shadow: none;
    border: 1px solid #e0e0e0;
}
[data-theme="minimal"] #wp7-chatbot-header {
    background: transparent;
    color: var(--wp7cb-primary, #3858e9);
    border-bottom: 1px solid #e0e0e0;
    padding: 10px 16px;
    font-size: 14px;
}
[data-theme="minimal"] #wp7-chatbot-close {
    color: #888;
}
[data-theme="minimal"] .wp7-msg {
    border-radius: 8px;
    font-size: 13px;
}
[data-theme="minimal"] #wp7-chatbot-toggle {
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    width: 48px;
    height: 48px;
}
[data-theme="minimal"] .wp7-suggest-btn {
    border-radius: 6px;
    font-size: 12px;
    padding: 4px 10px;
}

/* ===================================================== */
/* テンプレート: ビジネス (business) — フォーマル          */
/* ===================================================== */
[data-theme="business"] #wp7-chatbot-panel {
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
[data-theme="business"] #wp7-chatbot-header {
    border-radius: 4px 4px 0 0;
    padding: 16px 20px;
    font-size: 16px;
}
[data-theme="business"] .wp7-msg {
    border-radius: 4px;
    font-size: 14px;
}
[data-theme="business"] .wp7-msg-bot {
    border-bottom-left-radius: 0;
    border-left: 3px solid var(--wp7cb-primary, #3858e9);
}
[data-theme="business"] .wp7-msg-user {
    border-bottom-right-radius: 0;
}
[data-theme="business"] #wp7-chatbot-toggle {
    border-radius: 8px;
    width: 52px;
    height: 52px;
}
[data-theme="business"] #wp7-chatbot-send {
    border-radius: 4px;
}
[data-theme="business"] #wp7-chatbot-input {
    border-radius: 4px;
}
[data-theme="business"] .wp7-suggest-btn {
    border-radius: 4px;
}

/* ===================================================== */
/* テンプレート: ポップ (pop) — グラデーション・弾む       */
/* ===================================================== */
[data-theme="pop"] #wp7-chatbot-panel {
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
[data-theme="pop"] #wp7-chatbot-header {
    background: linear-gradient(135deg, var(--wp7cb-primary, #3858e9), var(--wp7cb-secondary, #6c5ce7));
    border-radius: 20px 20px 0 0;
    padding: 16px 18px;
    font-size: 16px;
}
[data-theme="pop"] .wp7-msg {
    border-radius: 20px;
}
[data-theme="pop"] .wp7-msg-user {
    background: linear-gradient(135deg, var(--wp7cb-primary, #3858e9), var(--wp7cb-secondary, #6c5ce7));
    border-bottom-right-radius: 6px;
}
[data-theme="pop"] .wp7-msg-bot {
    border-bottom-left-radius: 6px;
}
[data-theme="pop"] #wp7-chatbot-toggle {
    background: linear-gradient(135deg, var(--wp7cb-primary, #3858e9), var(--wp7cb-secondary, #6c5ce7));
    width: 60px;
    height: 60px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
    animation: wp7cb-pop-bounce 2s ease-in-out infinite;
}
[data-theme="pop"] #wp7-chatbot-toggle:hover {
    animation: none;
    transform: scale(1.1);
}
@keyframes wp7cb-pop-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}
[data-theme="pop"] #wp7-chatbot-send {
    background: linear-gradient(135deg, var(--wp7cb-primary, #3858e9), var(--wp7cb-secondary, #6c5ce7));
    border-radius: 12px;
}
[data-theme="pop"] .wp7-suggest-btn {
    border-radius: 20px;
    border-width: 2px;
    font-weight: 600;
}

/* ===================================================== */
/* テンプレート: ダーク (dark) — ダークモード              */
/* ===================================================== */
[data-theme="dark"] #wp7-chatbot-panel {
    background: #1e1e2e;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
[data-theme="dark"] #wp7-chatbot-header {
    background: #11111b;
    border-bottom: 1px solid #313244;
}
[data-theme="dark"] #wp7-chatbot-messages {
    background: #1e1e2e;
}
[data-theme="dark"] .wp7-msg-bot {
    background: #313244;
    color: #cdd6f4;
}
[data-theme="dark"] .wp7-msg-user {
    background: var(--wp7cb-primary, #3858e9);
    color: #fff;
}
[data-theme="dark"] .wp7-msg-loading {
    background: #313244;
    color: #6c7086;
}
[data-theme="dark"] #wp7-chatbot-input-area {
    background: #1e1e2e;
    border-top-color: #313244;
}
[data-theme="dark"] #wp7-chatbot-input {
    background: #313244;
    border-color: #45475a;
    color: #cdd6f4;
}
[data-theme="dark"] #wp7-chatbot-input:focus {
    border-color: var(--wp7cb-primary, #3858e9);
}
[data-theme="dark"] #wp7-chatbot-input::placeholder {
    color: #6c7086;
}
[data-theme="dark"] .wp7-suggest-bar {
    background: #181825;
    border-top-color: #313244;
}
[data-theme="dark"] .wp7-suggest-btn {
    background: #313244;
    border-color: #45475a;
    color: #cdd6f4;
}
[data-theme="dark"] .wp7-suggest-btn:hover {
    background: var(--wp7cb-primary, #3858e9);
    border-color: var(--wp7cb-primary, #3858e9);
    color: #fff;
}
[data-theme="dark"] .wp7-disclaimer {
    color: #585b70;
}
[data-theme="dark"] #wp7-chatbot-toggle {
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}

/* ===================================================== */
/* テンプレート: グラス (glass) — 半透明・ブラー           */
/* ===================================================== */
[data-theme="glass"] #wp7-chatbot-panel {
    background: rgba(255,255,255,0.72);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255,255,255,0.4);
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    border-radius: 20px;
}
[data-theme="glass"] #wp7-chatbot-header {
    background: rgba(255,255,255,0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--wp7cb-primary, #3858e9);
    border-bottom: 1px solid rgba(255,255,255,0.5);
    border-radius: 20px 20px 0 0;
    font-weight: 700;
}
[data-theme="glass"] #wp7-chatbot-close {
    color: var(--wp7cb-primary, #3858e9);
    opacity: 0.7;
}
[data-theme="glass"] #wp7-chatbot-close:hover {
    opacity: 1;
}
[data-theme="glass"] .wp7-msg-bot {
    background: rgba(255,255,255,0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.5);
    color: #333;
}
[data-theme="glass"] .wp7-msg-user {
    background: var(--wp7cb-primary, #3858e9);
    box-shadow: 0 2px 8px rgba(56,88,233,0.3);
}
[data-theme="glass"] .wp7-msg {
    border-radius: 16px;
}
[data-theme="glass"] #wp7-chatbot-input-area {
    background: rgba(255,255,255,0.4);
    border-top: 1px solid rgba(255,255,255,0.5);
}
[data-theme="glass"] #wp7-chatbot-input {
    background: rgba(255,255,255,0.6);
    border-color: rgba(255,255,255,0.5);
    border-radius: 12px;
}
[data-theme="glass"] #wp7-chatbot-input:focus {
    border-color: var(--wp7cb-primary, #3858e9);
    background: rgba(255,255,255,0.8);
}
[data-theme="glass"] #wp7-chatbot-send {
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(56,88,233,0.3);
}
[data-theme="glass"] .wp7-suggest-bar {
    background: rgba(255,255,255,0.3);
    border-top: 1px solid rgba(255,255,255,0.4);
}
[data-theme="glass"] .wp7-suggest-btn {
    background: rgba(255,255,255,0.5);
    border-color: rgba(56,88,233,0.3);
    border-radius: 12px;
}
[data-theme="glass"] .wp7-suggest-btn:hover {
    background: var(--wp7cb-primary, #3858e9);
    color: #fff;
    border-color: var(--wp7cb-primary, #3858e9);
}
[data-theme="glass"] #wp7-chatbot-toggle {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 16px rgba(56,88,233,0.35);
}
[data-theme="glass"] .wp7-disclaimer {
    color: rgba(0,0,0,0.35);
}

/* ===================================================== */
/* テンプレート: ネオ (neo) — ネオモーフィズム             */
/* ===================================================== */
[data-theme="neo"] #wp7-chatbot-panel {
    background: #e8ecf1;
    border-radius: 24px;
    box-shadow: 8px 8px 16px #c8ccd1, -8px -8px 16px #ffffff;
    border: none;
}
[data-theme="neo"] #wp7-chatbot-header {
    background: #e8ecf1;
    color: #444;
    border-bottom: none;
    border-radius: 24px 24px 0 0;
    padding: 16px 18px;
    font-size: 15px;
    box-shadow: inset 0 -1px 0 #d0d4d9;
}
[data-theme="neo"] #wp7-chatbot-close {
    color: #888;
    font-weight: 300;
}
[data-theme="neo"] #wp7-chatbot-messages {
    background: #e8ecf1;
}
[data-theme="neo"] .wp7-msg {
    border-radius: 16px;
}
[data-theme="neo"] .wp7-msg-bot {
    background: #e8ecf1;
    color: #333;
    box-shadow: 4px 4px 8px #c8ccd1, -4px -4px 8px #ffffff;
    border: none;
}
[data-theme="neo"] .wp7-msg-user {
    background: var(--wp7cb-primary, #3858e9);
    color: #fff;
    box-shadow: 4px 4px 8px #c8ccd1;
}
[data-theme="neo"] .wp7-msg-loading {
    background: #e8ecf1;
    color: #999;
    box-shadow: 4px 4px 8px #c8ccd1, -4px -4px 8px #ffffff;
}
[data-theme="neo"] #wp7-chatbot-input-area {
    background: #e8ecf1;
    border-top: none;
    box-shadow: inset 0 1px 0 #d0d4d9;
}
[data-theme="neo"] #wp7-chatbot-input {
    background: #e8ecf1;
    border: none;
    border-radius: 12px;
    box-shadow: inset 3px 3px 6px #c8ccd1, inset -3px -3px 6px #ffffff;
    color: #333;
}
[data-theme="neo"] #wp7-chatbot-input:focus {
    box-shadow: inset 3px 3px 6px #b8bcc1, inset -3px -3px 6px #ffffff;
}
[data-theme="neo"] #wp7-chatbot-send {
    border-radius: 12px;
    box-shadow: 4px 4px 8px #c8ccd1, -4px -4px 8px #ffffff;
    transition: box-shadow 0.15s;
}
[data-theme="neo"] #wp7-chatbot-send:hover {
    box-shadow: 2px 2px 4px #c8ccd1, -2px -2px 4px #ffffff;
}
[data-theme="neo"] #wp7-chatbot-send:active {
    box-shadow: inset 2px 2px 4px rgba(0,0,0,0.15);
}
[data-theme="neo"] .wp7-suggest-bar {
    background: #e8ecf1;
    border-top: none;
    box-shadow: inset 0 1px 0 #d0d4d9;
}
[data-theme="neo"] .wp7-suggest-btn {
    background: #e8ecf1;
    border: none;
    border-radius: 12px;
    box-shadow: 3px 3px 6px #c8ccd1, -3px -3px 6px #ffffff;
    color: #555;
    font-weight: 500;
    transition: box-shadow 0.15s, color 0.15s;
}
[data-theme="neo"] .wp7-suggest-btn:hover {
    box-shadow: inset 2px 2px 4px #c8ccd1, inset -2px -2px 4px #ffffff;
    color: var(--wp7cb-primary, #3858e9);
    background: #e8ecf1;
}
[data-theme="neo"] #wp7-chatbot-toggle {
    box-shadow: 6px 6px 12px #c8ccd1, -6px -6px 12px #ffffff;
    border: none;
}
[data-theme="neo"] #wp7-chatbot-toggle:hover {
    box-shadow: 3px 3px 6px #c8ccd1, -3px -3px 6px #ffffff;
}
[data-theme="neo"] .wp7-disclaimer {
    color: #a0a4a9;
}

/* ===================================================== */
/* テンプレート: ラウンド (round) — まるっこい・やさしい   */
/* ===================================================== */
[data-theme="round"] #wp7-chatbot-panel {
    border-radius: 28px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.1);
}
[data-theme="round"] #wp7-chatbot-header {
    border-radius: 28px 28px 0 0;
    padding: 16px 20px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.3px;
}
[data-theme="round"] #wp7-chatbot-close {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: background 0.15s;
}
[data-theme="round"] #wp7-chatbot-close:hover {
    background: rgba(255,255,255,0.4);
}
[data-theme="round"] .wp7-msg {
    border-radius: 20px;
    padding: 12px 16px;
}
[data-theme="round"] .wp7-msg-bot {
    border-bottom-left-radius: 6px;
    background: #f3f5f9;
}
[data-theme="round"] .wp7-msg-user {
    border-bottom-right-radius: 6px;
}
[data-theme="round"] #wp7-chatbot-input-area {
    padding: 14px 16px;
}
[data-theme="round"] #wp7-chatbot-input {
    border-radius: 20px;
    padding: 10px 16px;
    border-color: #e0e4ea;
    background: #f8f9fb;
}
[data-theme="round"] #wp7-chatbot-input:focus {
    background: #fff;
}
[data-theme="round"] #wp7-chatbot-send {
    border-radius: 20px;
    padding: 10px 20px;
    font-weight: 600;
}
[data-theme="round"] .wp7-suggest-bar {
    padding: 10px 14px;
    gap: 8px;
    background: #fafbfd;
}
[data-theme="round"] .wp7-suggest-btn {
    border-radius: 20px;
    padding: 7px 16px;
    font-size: 12px;
    font-weight: 500;
    border-width: 1.5px;
    transition: all 0.2s;
}
[data-theme="round"] .wp7-suggest-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(56,88,233,0.2);
}
[data-theme="round"] #wp7-chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
}
[data-theme="round"] .wp7-disclaimer {
    padding: 4px 12px 8px;
}
