        :root {
            --mss-red: #F61500;
            --mss-pink: #F3BEC7;
            --mss-dark: #161615;
            --mss-light: #EDEDEC;
            --mss-transition: all 0.3s ease;
            --mss-gradient-start: #e16a29;
            --mss-gradient-end: #d92728;
        }

        body {
            font-family: 'Instrument Sans', ui-sans-serif, system-ui, sans-serif;
            margin: 0;
            padding: 0;
            /* padding-top: 70px; */
            /* Add space for fixed header */
            background-color: #fff;
            color: var(--mss-dark);
            height: 100%;
            overflow-x: hidden;
            /* 横スクロールを無効化 */
        }

        html {
            height: 100%;
        }

        .chat-container {
            max-width: 800px;
            margin: 0 auto;
            border-radius: 8px;
            overflow: hidden;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        }

        /* メディアクエリ - モバイル対応 */
        @media (max-width: 768px) {
            .chat-container {
                max-width: 100%;
                margin: 0;
                border-radius: 0;
                box-shadow: none;
                height: 100vh;
                /* 高さを画面いっぱいに設定 */
                display: flex;
                /* フレックスボックスに変更 */
                flex-direction: column;
                /* 縦方向に並べる */
            }
        }

        @media (max-width: 768px) {
            body {
                overflow-y: auto;
                /* 縦スクロールを許可 */
            }
        }

        .chat-header {
            background: linear-gradient(135deg, var(--mss-gradient-start), var(--mss-gradient-end));
            color: white;
            padding: 7px 5px;
            display: flex;
            align-items: center;
            position: relative;
            overflow: hidden;
        }

        @media (max-width: 480px) {
            .chat-header {
                padding: 7px 5px;
            }

            .chat-header h1 {
                font-size: 1rem;
            }
        }

        .chat-header::before {
            content: '';
            position: absolute;
            right: -50px;
            bottom: -50px;
            width: 100px;
            height: 100px;
            background-color: rgba(255, 255, 255, 0.1);
            transform: rotate(45deg);
        }

        .chat-header h1 {
            margin: 0;
            font-size: 1rem;
            font-weight: 500;
        }

        #log {
            height: 60vh;
            overflow: auto;
            padding: 20px;
            background-color: white;
            border: none;
        }

        @media (max-width: 480px) {
            #log {
                height: calc(100vh - 130px);
                /* ヘッダーと入力エリアの高さを考慮 */
                padding: 15px;
                padding-bottom: 70px;
                /* 入力エリアの高さ分余白を追加 */
                flex: 1;
                /* フレックスボックス内で余剰スペースを占める */
            }
        }

        #log>div {
            margin-bottom: 16px;
            opacity: 0;
            transform: translateY(10px);
            animation: fadeIn 0.5s forwards;
        }

        @keyframes fadeIn {
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .message-user,
        .message-ai {
            padding: 12px 16px;
            border-radius: 8px;
            max-width: 80%;
            margin-bottom: 8px;
            position: relative;
        }

        @media (max-width: 480px) {

            .message-user,
            .message-ai {
                max-width: 90%;
                padding: 10px 12px;
            }
        }

        .message-user {
            background-color: #f0f0f0;
            margin-left: auto;
            border-bottom-right-radius: 2px;
        }

        .message-ai {
            background-color: white;
            margin-right: auto;
            border-bottom-left-radius: 2px;
            border-left: 4px solid;
            border-image: linear-gradient(to bottom, var(--mss-gradient-start), var(--mss-gradient-end)) 1;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
        }

        .message-name {
            font-weight: 600;
            margin-bottom: 6px;
            color: var(--mss-dark);
        }

        .chat-input-container {
            display: flex;
            align-items: center;
            padding: 15px;
            background-color: #f8f8f8;
            border-top: 1px solid #eaeaea;
        }

        @media (max-width: 480px) {
            .chat-input-container {
                padding: 10px;
                position: fixed;
                bottom: 0;
                left: 0;
                right: 0;
                z-index: 100;
            }
        }

        #msg {
            flex: 1;
            padding: 12px 16px;
            border: 1px solid #ddd;
            border-radius: 24px;
            outline: none;
            font-size: 16px;
            transition: var(--mss-transition);
            box-sizing: border-box;
        }

        @media (max-width: 480px) {
            #msg {
                padding: 10px 12px;
                font-size: 16px;
                /* iOS Safariの自動ズームを防止するため16px以上に設定 */
            }

            #send-btn {
                padding: 8px 12px;
                /* パディングを小さく */
                font-size: 14px;
                min-width: 60px;
                /* 幅を制限 */
            }
        }

        #msg:focus {
            border-color: var(--mss-red);
            box-shadow: inset 0 0 0 2px rgba(246, 21, 0, 0.1);
        }

        #send-btn {
            background: linear-gradient(135deg, var(--mss-gradient-start), var(--mss-gradient-end));
            color: white;
            border: none;
            border-radius: 24px;
            padding: 12px 24px;
            margin-left: 10px;
            cursor: pointer;
            font-weight: 500;
            transition: var(--mss-transition);
        }

        #send-btn:hover {
            filter: brightness(1.1);
        }

        #send-btn:disabled {
            background-color: #ccc;
            cursor: not-allowed;
        }

        /* スピナー */
        #spinner {
            display: none;
            width: 24px;
            height: 24px;
            border: 3px solid rgba(225, 106, 41, 0.2);
            border-top: 3px solid var(--mss-gradient-end);
            border-radius: 50%;
            animation: spin .8s linear infinite;
            margin-left: 12px;
        }

        @keyframes spin {
            100% {
                transform: rotate(360deg)
            }
        }

        @keyframes typewriter {
            from {
                width: 0
            }

            to {
                width: 100%
            }
        }

        /* ヘッダースタイル */
        .site-header {
            background-color: #fff;
            box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
            padding: 15px 0;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            z-index: 1000;
        }

        .header-container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 0 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 50px;
            position: relative;
        }

        .header-logo {
            height: 40px;
            width: auto;
        }

        /* デスクトップナビゲーション */
        .desktop-nav {
            display: flex;
            align-items: center;
            gap: 30px;
        }

        .nav-item {
            color: var(--mss-dark);
            text-decoration: none;
            font-weight: 500;
            font-size: 16px;
            transition: var(--mss-transition);
            padding: 5px 10px;
        }

        .contact-btn {
            background: linear-gradient(135deg, var(--mss-gradient-start), var(--mss-gradient-end));
            color: white;
            border-radius: 50px;
            padding: 10px 20px;
        }

        .nav-item:hover {
            color: var(--mss-red);
        }

        .contact-btn:hover {
            color: white;
            filter: brightness(1.1);
        }

        /* モバイルメニューボタン - デフォルトでは非表示 */
        .mobile-menu-container {
            display: none;
            /* PC表示では非表示 */
        }

        #mobile-menu-btn {
            position: absolute;
            right: 20px;
            top: 50%;
            transform: translateY(-50%);
            background: none;
            border: none;
            padding: 0;
            cursor: pointer;
            z-index: 1001;
            flex-direction: column;
            align-items: center;
        }

        .hamburger {
            width: 25px;
            height: 20px;
            position: relative;
            margin-bottom: 2px;
        }

        .hamburger span {
            position: absolute;
            width: 100%;
            height: 2px;
            background-color: #333;
            left: 0;
            transition: all 0.3s ease;
        }

        .hamburger span:nth-child(1) {
            top: 0;
        }

        .hamburger span:nth-child(2) {
            top: 9px;
        }

        .hamburger span:nth-child(3) {
            top: 18px;
        }

        .menu-text {
            font-size: 10px;
            font-weight: bold;
        }

        /* モバイルメニュー */
        .mobile-menu {
            display: none;
            position: fixed;
            top: 70px;
            left: 0;
            right: 0;
            background: white;
            box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
            z-index: 999;
        }

        .mobile-nav {
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 20px;
            gap: 15px;
        }

        /* モバイルメニューボタン（デフォルトでは非表示） */
        .mobile-only {
            display: none;
            /* デフォルトでは非表示 */
            position: absolute;
            right: 15px;
            top: 50%;
            transform: translateY(-50%);
            z-index: 1001;
            background: none;
            border: none;
            cursor: pointer;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            color: #333;
            padding: 5px;
        }

        #mobile-menu-btn {
            display: none;
            /* デフォルトでは非表示 */
        }

        .message-content★ {
            white-space: pre-wrap;
            /* 改行コードをそのまま表示 */
            word-break: break-word;
            /* 単語が長過ぎるときも折り返す */
        }

        .message-content pre,
        .message-content code {
            white-space: pre-wrap !important;
            /* 改行コードも維持して折り返し */
            word-break: break-word;
            /* 長い単語／URL で強制改行 */
            font-family: inherit;
            /* 等幅は読みづらければ外す */
        }

        /* モバイル表示 */
        @media screen and (max-width: 768px) {
            .header-container {
                justify-content: space-between;
            }

            .desktop-nav {
                display: none;
            }

            .mobile-only {
                display: flex !important;
                /* モバイル表示時のみ表示 */
            }

            #mobile-menu-btn {
                display: flex !important;
                /* モバイル表示時のみ表示 */
            }

            #mobile-menu-btn svg {
                margin-bottom: 2px;
            }
        }

        /* スマホ表示 */
        @media (max-width: 480px) {
            .site-header {
                padding: 10px 0;
            }

            .header-logo {
                height: 30px;
            }

            .site-header {
                padding: 10px 0;
            }

            .header-logo {
                height: 30px;
            }

            .header-container {
                padding: 0 15px;
            }

            body.menu-open .header-nav {
                top: 60px;
            }

            .nav-item {
                padding: 5px 10px;
                font-size: 14px;
            }

            .nav-item:last-child {
                padding: 8px 15px;
                margin-top: 5px;
            }

            .pc-only {
                display: none;
            }
        }

        @media (max-width: 1000px) {
            .message-content {
                font-size: 14px;
                /* お好みで 12〜16px 程度に調整 */
                line-height: 1.6;
                /* 行間も少し詰める */
            }

            .message-user,
            .message-ai {
                font-size: 14px;
                /* 吹き出し全体の文字サイズを合わせる */
            }
        }
