/* ============================================
   花いち都屋 きもの相談チャット スタイル
   ブランド配色: 深紅(臙脂) #8b1a2f / 生成り #f7f3ee / 金茶アクセント
============================================ */

.mky-launcher {
    position: fixed;
    right: 20px;
    bottom: 20px;
    height: 56px;
    padding: 0 20px 0 16px;
    border-radius: 28px;
    background: #8b1a2f;
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(139, 26, 47, 0.32);
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 99998;
    transition: transform 0.2s ease, background 0.2s ease;
    font-family: "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
}
.mky-launcher:hover { transform: translateY(-2px); background: #74121f; }
.mky-launcher svg { width: 24px; height: 24px; fill: #fff; flex-shrink: 0; }
.mky-launcher-label { font-size: 14px; font-weight: 700; white-space: nowrap; letter-spacing: .02em; }
.mky-launcher.is-open { display: none; }

.mky-window {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 580px;
    max-height: calc(100vh - 40px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 99999;
    border: 1px solid #e7ddd4;
    font-family: "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
    color: #2b2320;
    line-height: 1.75;
}
.mky-window.is-open { display: flex; animation: mky-pop 0.2s ease-out; }
@keyframes mky-pop { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.mky-header {
    background: #8b1a2f;
    color: #fff;
    padding: 15px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.mky-header-info { display: flex; flex-direction: column; }
.mky-header-title { font-size: 15px; font-weight: 700; letter-spacing: .02em; }
.mky-header-sub { font-size: 11px; color: #f0d9c0; margin-top: 2px; }
.mky-close { background: transparent; border: none; color: #fff; cursor: pointer; padding: 4px; display: flex; opacity: .8; transition: opacity .2s; }
.mky-close:hover { opacity: 1; }
.mky-close svg { width: 18px; height: 18px; fill: #fff; }

.mky-messages {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
    background: #f7f3ee;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.mky-msg {
    max-width: 86%;
    padding: 12px 15px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.75;
    word-wrap: break-word;
}
.mky-msg-bot {
    background: #fff;
    color: #2b2320;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.mky-msg-user {
    background: #8b1a2f;
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}
.mky-msg-bot a { color: #8b1a2f; font-weight: 600; text-decoration: underline; word-break: break-all; }
.mky-msg-error { background: #fff5f5; color: #b32d2e; align-self: flex-start; border: 1px solid #f3d2d2; font-size: 13px; }

/* クイック質問 */
.mky-quick { display: flex; flex-direction: column; gap: 8px; margin-top: 2px; }
.mky-quick-btn {
    background: #fff;
    color: #8b1a2f;
    border: 1px solid #e0c9b3;
    border-radius: 12px;
    padding: 11px 14px;
    font-size: 13px;
    line-height: 1.5;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    transition: all .18s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.mky-quick-btn:hover { background: #8b1a2f; color: #fff; border-color: #8b1a2f; transform: translateX(2px); }
.mky-quick-note { font-size: 12px; color: #8a7a6e; margin-top: 8px; line-height: 1.6; }

/* タイピング */
.mky-typing { display: flex; gap: 4px; padding: 14px 16px; background: #fff; border-radius: 14px; border-bottom-left-radius: 4px; align-self: flex-start; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.mky-typing span { width: 7px; height: 7px; border-radius: 50%; background: #d8c3b2; animation: mky-bounce 1.2s infinite; }
.mky-typing span:nth-child(2) { animation-delay: .15s; }
.mky-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes mky-bounce { 0%,60%,100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-6px); opacity: 1; } }

.mky-input-area { border-top: 1px solid #ece2d8; padding: 11px; background: #fff; flex-shrink: 0; display: flex; gap: 8px; align-items: flex-end; }
.mky-input {
    flex: 1;
    border: 1px solid #ddcdbd;
    border-radius: 10px;
    padding: 10px 13px;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.6;
    color: #2b2320;
    resize: none;
    outline: none;
    max-height: 100px;
    transition: border-color .2s;
}
.mky-input:focus { border-color: #8b1a2f; }
.mky-send { background: #8b1a2f; color: #fff; border: none; border-radius: 10px; width: 42px; height: 42px; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background .2s; }
.mky-send:hover:not(:disabled) { background: #74121f; }
.mky-send:disabled { background: #d8c3b2; cursor: not-allowed; }
.mky-send svg { width: 18px; height: 18px; fill: #fff; }

.mky-footer { text-align: center; padding: 7px; font-size: 10px; color: #a99a8d; background: #fff; border-top: 1px solid #f2ebe3; }

@media (max-width: 480px) {
    .mky-window { right: 0; bottom: 0; width: 100%; max-width: 100%; height: 100%; max-height: 100%; border-radius: 0; }
    .mky-launcher { right: 14px; bottom: 14px; }
}
