#ecl-chat-root {
    --ecl-ink: #302b2d;
    --ecl-ink-2: #4a3f44;
    --ecl-gold: #d0a900;
    --ecl-gold-dark: #a98800;
    --ecl-blush: #fbedf3;
    --ecl-cream: #faf6f8;
    --ecl-line: #ece2e7;
    --ecl-muted: #8a7f84;
    --ecl-caramel: #c27a2c;
    --ecl-caramel-dark: #8e5519;
    --ecl-green: #06a64a;
    --ecl-green-dark: #04793a;
    font-family: var(--ecs-sans, "Noto Sans JP", "Hiragino Sans", sans-serif);
    font-size: 15px;
    line-height: 1.6;
    color: var(--ecl-ink);
    text-align: left;
    letter-spacing: normal;
    box-sizing: border-box;
}
#ecl-chat-root *, #ecl-chat-root *::before, #ecl-chat-root *::after { box-sizing: border-box; }
#ecl-chat-root button, #ecl-chat-root textarea, #ecl-chat-root a {
    font-family: inherit; font-size: 15px; line-height: 1.6; letter-spacing: normal; margin: 0; text-transform: none;
}
#ecl-chat-root button { cursor: pointer; appearance: none; }
#ecl-chat-root button:disabled { cursor: default; }
#ecl-chat-root :focus-visible { outline: 3px solid #2475bd; outline-offset: 2px; }
#ecl-chat-root [hidden] { display: none !important; }
#ecl-chat-root svg { display: block; }

/* 起動ボタン（ピル型） */
#ecl-chat-root .ecl-chat-launch {
    position: fixed; right: 20px; bottom: 24px; z-index: 995;
    display: inline-flex; align-items: center; gap: 10px;
    height: 56px; padding: 0 22px 0 10px; border: 0; border-radius: 999px;
    background: var(--ecl-ink); color: #fff;
    font-size: 15px; font-weight: 700; letter-spacing: .02em; white-space: nowrap;
    box-shadow: 0 10px 28px rgba(33, 26, 30, .32), inset 0 0 0 1px rgba(255,255,255,.06);
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
#ecl-chat-root .ecl-chat-launch:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(33, 26, 30, .36); background: var(--ecl-ink-2); }
#ecl-chat-root .ecl-chat-launch:active { transform: translateY(0); }
#ecl-chat-root .ecl-chat-launch svg { width: 22px; height: 22px; }
#ecl-chat-root .ecl-chat-launch .ecl-chat-launch-face { display: block; width: 36px; height: 36px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px rgba(208, 169, 0, .95); background: #fbedf3; }
#ecl-chat-root .ecl-chat-launch .ecl-chat-launch-dot {
    position: absolute; top: 9px; right: 11px; width: 9px; height: 9px; border-radius: 50%;
    background: var(--ecl-gold); box-shadow: 0 0 0 2px var(--ecl-ink);
}
#ecl-chat-root.is-open .ecl-chat-launch { display: none; }

/* パネル */
#ecl-chat-root .ecl-chat-panel {
    position: fixed; right: 20px; bottom: 24px; z-index: 1000;
    display: flex; flex-direction: column; width: 392px; max-width: calc(100vw - 32px);
    height: min(680px, calc(100vh - 48px)); margin: 0; padding: 0; overflow: hidden;
    border: 1px solid var(--ecl-line); border-radius: 22px;
    background: #fff; box-shadow: 0 24px 64px rgba(33, 26, 30, .24), 0 2px 8px rgba(33, 26, 30, .08);
    animation: ecl-chat-in .2s ease-out;
}
@keyframes ecl-chat-in { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }

/* ヘッダー */
#ecl-chat-root .ecl-chat-header {
    display: flex; align-items: center; gap: 12px; flex: 0 0 auto;
    padding: 14px 14px 14px 16px; color: #fff;
    background: linear-gradient(135deg, #2a2427 0%, #3d3338 60%, #4a3d43 100%);
}
#ecl-chat-root .ecl-chat-avatar {
    flex: 0 0 auto; display: flex; align-items: center; justify-content: center; overflow: hidden;
    width: 42px; height: 42px; border-radius: 50%; background: var(--ecl-blush); color: var(--ecl-ink);
    font-family: var(--ecs-latin, "Libre Baskerville", "Noto Serif JP", serif); font-size: 21px; font-weight: 700; line-height: 1;
    box-shadow: 0 0 0 2px rgba(208, 169, 0, .9);
}
#ecl-chat-root .ecl-chat-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
#ecl-chat-root .ecl-chat-title { flex: 1 1 auto; min-width: 0; }
#ecl-chat-root .ecl-chat-title strong {
    display: block; font-family: var(--ecs-serif, "Noto Serif JP", serif); font-size: 16.5px; font-weight: 700; letter-spacing: .04em; color: #fff; line-height: 1.3;
}
#ecl-chat-root .ecl-chat-title small { display: flex; align-items: center; gap: 6px; margin-top: 3px; color: rgba(255,255,255,.78); font-size: 11.5px; line-height: 1.3; }
#ecl-chat-root .ecl-chat-title small::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #3dd68c; box-shadow: 0 0 0 3px rgba(61, 214, 140, .22); }
#ecl-chat-root .ecl-chat-close {
    flex: 0 0 auto; display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%;
    background: rgba(255,255,255,.12); color: #fff; transition: background .15s ease;
}
#ecl-chat-root .ecl-chat-close:hover { background: rgba(255,255,255,.22); }
#ecl-chat-root .ecl-chat-close svg { width: 16px; height: 16px; }

/* メッセージ */
#ecl-chat-root .ecl-chat-messages {
    flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
    padding: 18px 14px 10px; background: var(--ecl-cream);
}
#ecl-chat-root .ecl-chat-row { display: flex; align-items: flex-end; gap: 8px; margin: 0 0 12px; }
#ecl-chat-root .ecl-chat-row.ecl-chat-row-user { justify-content: flex-end; }
#ecl-chat-root .ecl-chat-row .ecl-chat-avatar { width: 28px; height: 28px; font-size: 14px; box-shadow: 0 0 0 1.5px rgba(208, 169, 0, .8); }
#ecl-chat-root .ecl-chat-bubble {
    max-width: 82%; padding: 11px 14px; border-radius: 18px; font-size: 14.5px; line-height: 1.65;
    white-space: pre-wrap; overflow-wrap: anywhere; word-break: normal;
}
#ecl-chat-root .ecl-chat-bot { border-bottom-left-radius: 6px; background: #fff; color: var(--ecl-ink); border: 1px solid var(--ecl-line); box-shadow: 0 1px 2px rgba(33, 26, 30, .04); }
#ecl-chat-root .ecl-chat-user { border-bottom-right-radius: 6px; background: var(--ecl-ink); color: #fff; }
#ecl-chat-root .ecl-chat-bubble a { color: var(--ecl-caramel-dark); text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
#ecl-chat-root .ecl-chat-gap { height: .6em; }
#ecl-chat-root .ecl-chat-list-item { position: relative; padding-left: 1.1em; }
#ecl-chat-root .ecl-chat-list-item::before { content: "•"; position: absolute; left: .1em; color: var(--ecl-gold-dark); }
#ecl-chat-root .ecl-chat-typing { display: inline-flex; gap: 5px; align-items: center; padding: 14px 16px; }
#ecl-chat-root .ecl-chat-typing i { width: 7px; height: 7px; border-radius: 50%; background: #b9adb3; animation: ecl-chat-bounce 1.1s infinite ease-in-out; }
#ecl-chat-root .ecl-chat-typing i:nth-child(2) { animation-delay: .15s; }
#ecl-chat-root .ecl-chat-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes ecl-chat-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .55; } 30% { transform: translateY(-5px); opacity: 1; } }

/* クイック返信 */
#ecl-chat-root .ecl-chat-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 14px 36px; }
#ecl-chat-root .ecl-chat-chips button {
    max-width: 100%; padding: 8px 14px; border: 1px solid var(--ecl-gold); border-radius: 999px;
    background: #fff; color: var(--ecl-ink); font-size: 13px; font-weight: 500; white-space: normal; line-height: 1.4;
    transition: background .15s ease, transform .15s ease;
}
#ecl-chat-root .ecl-chat-chips button:hover { background: var(--ecl-blush); transform: translateY(-1px); }
#ecl-chat-root .ecl-chat-chips button:disabled { opacity: .45; transform: none; }

/* 入力 */
#ecl-chat-root .ecl-chat-turnstile { flex: 0 0 auto; max-width: 100%; overflow: hidden; }
#ecl-chat-root .ecl-chat-form {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 2px 10px; flex: 0 0 auto;
    margin: 0; padding: 10px 12px 4px; border-top: 1px solid var(--ecl-line); background: #fff;
}
#ecl-chat-root textarea {
    display: block; width: 100%; min-width: 0; min-height: 46px; max-height: 98px; padding: 10px 14px; resize: none;
    border: 1px solid transparent; border-radius: 22px; background: #f5eff2; color: var(--ecl-ink); overflow-y: auto;
    font-size: 16px; line-height: 24px; transition: background .15s ease, border-color .15s ease;
}
#ecl-chat-root textarea:focus { background: #fff; border-color: var(--ecl-gold); outline: none; box-shadow: 0 0 0 3px rgba(208, 169, 0, .18); }
#ecl-chat-root textarea::placeholder { color: #a399a0; }
#ecl-chat-root .ecl-chat-send {
    display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%;
    background: var(--ecl-caramel); color: #fff; font-size: 0; transition: background .15s ease, transform .15s ease;
}
#ecl-chat-root .ecl-chat-send svg { width: 20px; height: 20px; }
#ecl-chat-root .ecl-chat-send:hover:not(:disabled) { background: #d38a3c; transform: scale(1.04); }
#ecl-chat-root .ecl-chat-send:disabled { background: #dcd3d7; }
#ecl-chat-root .ecl-chat-count { grid-column: 1 / -1; text-align: right; color: var(--ecl-muted); font-size: 11px; }
#ecl-chat-root .ecl-chat-count.ecl-chat-over { color: #bb102e; font-weight: 700; }

/* フッター（予約ボタン＋注意書き） */
#ecl-chat-root .ecl-chat-footer { flex: 0 0 auto; padding: 6px 12px 12px; background: #fff; }
#ecl-chat-root .ecl-chat-bookings { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
#ecl-chat-root .ecl-chat-bookings a {
    display: flex; justify-content: center; align-items: center; min-width: 0; height: 44px; padding: 0 4px; border: 0; border-radius: 999px;
    color: #fff; font-size: 15px; font-weight: 700; text-decoration: none; white-space: nowrap; transition: transform .12s ease, box-shadow .12s ease;
}
#ecl-chat-root .ecl-chat-bookings a:hover { transform: translateY(-1px); }
#ecl-chat-root .ecl-chat-bookings a:active { transform: translateY(2px); box-shadow: 0 1px 0 transparent; }
#ecl-chat-root .ecl-chat-line { background: var(--ecl-green); box-shadow: 0 3px 0 var(--ecl-green-dark); }
#ecl-chat-root .ecl-chat-web { background: var(--ecl-caramel); box-shadow: 0 3px 0 var(--ecl-caramel-dark); }
#ecl-chat-root .ecl-chat-footer p { margin: 8px 0 0; padding: 0; color: var(--ecl-muted); font-size: 10.5px; line-height: 1.5; text-align: center; }
#ecl-chat-root .ecl-chat-sr { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

@media (max-width: 720px) {
    #ecl-chat-root .ecl-chat-launch { right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); height: 50px; padding: 0 18px 0 8px; font-size: 14px; }
    #ecl-chat-root .ecl-chat-launch .ecl-chat-launch-face { width: 34px; height: 34px; }
    #ecl-chat-root .ecl-chat-panel { inset: 0; width: 100%; max-width: 100%; height: 100%; height: 100dvh; border: 0; border-radius: 0; animation-name: ecl-chat-up; }
    #ecl-chat-root .ecl-chat-header { padding-top: max(14px, env(safe-area-inset-top)); }
    #ecl-chat-root .ecl-chat-footer { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
    #ecl-chat-root .ecl-chat-bubble { max-width: 86%; }
}
@keyframes ecl-chat-up { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
/* キーボード表示中（見える高さが小さい）: 予約ボタンと注意書きを畳み、入力欄の余白を詰める */
#ecl-chat-root.is-compact .ecl-chat-footer { display: none; }
#ecl-chat-root.is-compact .ecl-chat-form { padding-bottom: max(8px, env(safe-area-inset-bottom)); }
#ecl-chat-root.is-compact .ecl-chat-count { display: none; }
#ecl-chat-root.is-compact .ecl-chat-messages { padding-top: 10px; }
@media (max-width: 359px) {
    #ecl-chat-root .ecl-chat-bookings a { font-size: 13px; }
    #ecl-chat-root .ecl-chat-launch span { display: none; }
    #ecl-chat-root .ecl-chat-launch { padding: 0 8px; }
}
@media (prefers-reduced-motion: reduce) {
    #ecl-chat-root *, #ecl-chat-root *::before, #ecl-chat-root *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
/* イースターエッグ: 合言葉・顔を5回タップでキラキラとハートが舞う */
#ecl-chat-root .ecl-chat-burst { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 5; }
#ecl-chat-root .ecl-chat-burst span { position: absolute; bottom: 110px; line-height: 1; opacity: 0; animation: ecl-chat-float 2s ease-out forwards; }
@keyframes ecl-chat-float { 0% { transform: translateY(0) scale(.6); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(-320px) scale(1.15) rotate(25deg); opacity: 0; } }
#ecl-chat-root .ecl-chat-avatar.is-hop { animation: ecl-chat-hop .7s ease; }
@keyframes ecl-chat-hop { 0%, 100% { transform: translateY(0) rotate(0); } 30% { transform: translateY(-10px) rotate(-12deg); } 60% { transform: translateY(0) rotate(10deg); } 80% { transform: translateY(-4px) rotate(-4deg); } }
#ecl-chat-root .ecl-chat-egg .ecl-chat-bubble { background: linear-gradient(135deg, #fff7fb, #fff4d6); border-color: #f0c9da; }
#ecl-chat-root .ecl-chat-panel .ecl-chat-avatar { cursor: pointer; -webkit-tap-highlight-color: transparent; }
