/**
 * イチ円動画 — AI接客コンシェルジュ ウィジェット
 * .iev-concierge-* 接頭辞。FAB は .iev-kids-mode-bar と重ならない右下 fixed。
 */

.iev-concierge {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 9980;
    font-family: inherit;
}

/* ---------- FAB ---------- */

.iev-concierge-fab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: 999px;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.35);
    transition: transform 0.18s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.18s;
}

.iev-concierge-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(79, 70, 229, 0.45);
}

.iev-concierge-fab__icon {
    font-size: 18px;
    line-height: 1;
}

.iev-concierge.is-open .iev-concierge-fab {
    display: none;
}

/* ---------- パネル ---------- */

.iev-concierge-panel {
    width: min(360px, calc(100vw - 24px));
    height: min(540px, calc(100vh - 90px));
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 18px 48px rgba(16, 24, 40, 0.22);
    overflow: hidden;
}

.iev-concierge-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    border-bottom: 1px solid #e5e7eb;
}

.iev-concierge-head__title {
    font-size: 15px;
    font-weight: 700;
    color: #3730a3;
}

.iev-concierge-close {
    appearance: none;
    border: none;
    background: transparent;
    font-size: 22px;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 8px;
}

.iev-concierge-close:hover {
    background: rgba(99, 102, 241, 0.12);
    color: #4f46e5;
}

/* ---------- ログ ---------- */

.iev-concierge-log {
    flex: 1;
    overflow-y: auto;
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f8fafc;
}

.iev-concierge-msg {
    max-width: 86%;
    padding: 9px 13px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.55;
    word-break: break-word;
    white-space: pre-wrap;
}

.iev-concierge-msg--assistant {
    align-self: flex-start;
    background: #fff;
    border: 1px solid #e5e7eb;
    color: #1f2937;
    border-bottom-left-radius: 4px;
}

.iev-concierge-msg--user {
    align-self: flex-end;
    background: #6366f1;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.iev-concierge-typing {
    color: #9ca3af;
    font-size: 13px;
}

/* ---------- クイックチップ ---------- */

.iev-concierge-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 12px 0;
    background: #f8fafc;
}

.iev-concierge-chip {
    appearance: none;
    border: 1px solid #c7d2fe;
    background: #eef2ff;
    color: #3730a3;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.iev-concierge-chip:hover {
    background: #e0e7ff;
}

/* ---------- 動画おすすめカード ---------- */

.iev-concierge-recs {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-self: stretch;
}

.iev-concierge-rec {
    display: flex;
    gap: 10px;
    align-items: center;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 8px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.iev-concierge-rec:hover {
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 4px 12px rgba(16, 24, 40, 0.08);
}

.iev-concierge-rec__thumb {
    width: 96px;
    height: 54px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
    background: #e5e7eb;
}

.iev-concierge-rec__body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.iev-concierge-rec__title {
    font-size: 13px;
    font-weight: 700;
    color: #1f2937;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.iev-concierge-rec__reason {
    font-size: 12px;
    color: #6b7280;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---------- ジャンルリンク ---------- */

.iev-concierge-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-self: flex-start;
}

.iev-concierge-genre-chip {
    display: inline-block;
    border: 1px solid #c7d2fe;
    background: #eef2ff;
    color: #3730a3;
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 12.5px;
    text-decoration: none;
}

.iev-concierge-genre-chip:hover {
    background: #e0e7ff;
}

/* ---------- 登録 CTA / 確認カード / OTP ---------- */

.iev-concierge-cta,
.iev-concierge-confirm,
.iev-concierge-otp {
    align-self: stretch;
    background: #fff;
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: 12px;
    padding: 12px;
}

.iev-concierge-cta__lead {
    margin: 0 0 8px;
    font-size: 13px;
    color: #374151;
    line-height: 1.55;
}

.iev-concierge-cta__btn {
    display: inline-block;
    background: #6366f1;
    color: #fff;
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 13.5px;
    font-weight: 700;
    text-decoration: none;
}

.iev-concierge-cta__btn:hover {
    background: #4f46e5;
}

.iev-concierge-confirm__text {
    margin: 0 0 10px;
    font-size: 13.5px;
    color: #1f2937;
    line-height: 1.55;
}

.iev-concierge-confirm__text small {
    color: #6b7280;
}

.iev-concierge-confirm__actions {
    display: flex;
    gap: 8px;
}

.iev-concierge-confirm__ok,
.iev-concierge-confirm__no {
    appearance: none;
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 13.5px;
    cursor: pointer;
    border: 1px solid transparent;
}

.iev-concierge-confirm__ok {
    background: #6366f1;
    color: #fff;
    font-weight: 700;
}

.iev-concierge-confirm__ok:hover {
    background: #4f46e5;
}

.iev-concierge-confirm__no {
    background: #fff;
    color: #6b7280;
    border-color: #e5e7eb;
}

.iev-concierge-confirm__no:hover {
    background: #f3f4f6;
}

.iev-concierge-otp__label {
    display: block;
    font-size: 12.5px;
    color: #6b7280;
    margin-bottom: 6px;
}

.iev-concierge-otp__row {
    display: flex;
    gap: 8px;
}

.iev-concierge-otp__input {
    flex: 1;
    min-width: 0;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 18px;
    letter-spacing: 4px;
    text-align: center;
}

.iev-concierge-otp__input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

.iev-concierge-otp__btn {
    appearance: none;
    border: none;
    background: #6366f1;
    color: #fff;
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.iev-concierge-otp__btn:hover {
    background: #4f46e5;
}

.iev-concierge-otp__btn:disabled {
    opacity: 0.6;
    cursor: default;
}

/* ---------- 入力フォーム ---------- */

.iev-concierge-form {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid #e5e7eb;
    background: #fff;
}

.iev-concierge-input {
    flex: 1;
    min-width: 0;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 14px;
}

.iev-concierge-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

.iev-concierge-send {
    appearance: none;
    border: none;
    background: #6366f1;
    color: #fff;
    border-radius: 10px;
    padding: 9px 16px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.iev-concierge-send:hover {
    background: #4f46e5;
}

.iev-concierge-send:disabled {
    opacity: 0.6;
    cursor: default;
}

/* ---------- モバイル ---------- */

@media (max-width: 640px) {
    .iev-concierge {
        right: 10px;
        bottom: 10px;
    }

    .iev-concierge-panel {
        width: calc(100vw - 20px);
        height: min(70vh, 520px);
    }

    .iev-concierge-fab__label {
        font-size: 14px;
    }
}
