        /* Ko-fi round button, bottom right (replaces the Buy Me a Coffee widget) */
        .kofi-fab {
            position: fixed;
            right: 18px;
            bottom: 18px;
            z-index: 9999;
            width: 60px;
            height: 60px;
            border-radius: 50%;
            background: #5bc0de;
            display: grid;
            place-items: center;
            box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
            transition: transform 0.15s ease, box-shadow 0.15s ease;
        }
        .kofi-fab:hover {
            transform: translateY(-2px) scale(1.04);
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
        }
        .kofi-fab img {
            width: 36px;
            height: auto;
            display: block;
        }
        @media (max-width: 600px) {
            .kofi-fab { width: 56px; height: 56px; }
            .kofi-fab img { width: 33px; }
        }

        .kofi-panel {
            position: fixed;
            right: 18px;
            bottom: 92px;
            z-index: 10000;
            width: 360px;
            max-width: calc(100vw - 36px);
            height: min(640px, calc(100vh - 120px));
            background: #f9f9f9;
            border-radius: 16px;
            box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
            overflow: hidden;
            transform-origin: bottom right;
            animation: kofi-pop 0.18s ease-out;
        }
        .kofi-panel[hidden] { display: none; }
        body.kofi-open .coffee-bubble { display: none; }
        .kofi-panel iframe {
            border: none;
            width: 100%;
            height: 100%;
            display: block;
        }
        .kofi-panel-close {
            position: absolute;
            top: 8px;
            right: 10px;
            z-index: 1;
            width: 30px;
            height: 30px;
            border: none;
            border-radius: 50%;
            background: rgba(0, 0, 0, 0.55);
            color: #fff;
            font-size: 18px;
            line-height: 30px;
            cursor: pointer;
        }
        @keyframes kofi-pop {
            from { opacity: 0; transform: translateY(8px) scale(0.96); }
            to { opacity: 1; transform: none; }
        }
        @media (max-width: 600px) {
            .kofi-panel {
                right: 0;
                left: 0;
                bottom: 0;
                width: 100%;
                max-width: none;
                height: 82vh;
                border-radius: 16px 16px 0 0;
                transform-origin: bottom center;
            }
        }
        @media (prefers-reduced-motion: reduce) {
            .kofi-panel { animation: none; }
        }

        /* Ko-fiの丸ボタン（右下）の左隣に出す吹き出し。UIの邪魔をしない控えめサイズ */
        .coffee-bubble {
            position: fixed;
            right: 88px;
            bottom: 26px;
            z-index: 9998;
            max-width: 210px;
            background: #fff;
            border: 1px solid var(--line);
            border-radius: 12px;
            padding: 8px 26px 8px 12px;
            font-size: 0.78rem;
            line-height: 1.5;
            box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
        }

        .coffee-bubble::after {
            content: '';
            position: absolute;
            right: -7px;
            bottom: 18px;
            width: 12px;
            height: 12px;
            background: #fff;
            border-right: 1px solid var(--line);
            border-top: 1px solid var(--line);
            transform: rotate(45deg);
        }

        .coffee-bubble-close {
            position: absolute;
            top: 3px;
            right: 7px;
            border: none;
            background: none;
            font-size: 1rem;
            color: var(--muted);
            cursor: pointer;
            padding: 0;
            line-height: 1;
        }

        @media (max-width: 600px) {
            .coffee-bubble {
                max-width: 150px;
                font-size: 0.74rem;
                right: 84px;
                bottom: 24px;
            }
        }


.kofi-fab{bottom:calc(18px + env(safe-area-inset-bottom,0px))}.coffee-bubble{bottom:calc(26px + env(safe-area-inset-bottom,0px))}
