        :root {
            --font-size-base: 1rem; /* 標準サイズ */
            --line-height-base: 1.8; /* ベース行間 */
            --section-spacing: 30px;
            --focus-color: #4CAF50; /* フォーカスリングの色（CSS変数） */
        }
        
        body { 
            font-family: 
                "BIZ UDPGothic",           /* UDフォント（Windows 10/11） */
                "Hiragino Kaku Gothic ProN", /* UDフォント（macOS） */
                "Yu Gothic",               /* UDフォント（Windows 8.1+） */
                -apple-system,             /* システムフォント（macOS/iOS） */
                BlinkMacSystemFont,        /* システムフォント（macOS Safari） */
                "Segoe UI",                /* システムフォント（Windows） */
                sans-serif;                /* フォールバック */
            margin: 0; 
            padding: 0; 
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            height: 100vh;
            height: 100dvh;
            text-align: left;
            -webkit-text-size-adjust: 100%;
            font-size: var(--font-size-base);
            line-height: var(--line-height-base);
        }
        
        /* モバイル向け最適化 */
        @media (max-width: 768px) {
            body {
                font-family: 
                    -apple-system,         /* iOS標準フォント優先 */
                    "BIZ UDPGothic",
                    "Hiragino Kaku Gothic ProN",
                    "Yu Gothic",
                    "Roboto",               /* Android標準フォント */
                    sans-serif;
            }
        }
        
        /* 文字サイズクラス */
        .font-size-small { 
            --font-size-base: 0.75rem; 
            --line-height-base: 1.7; /* 少し詰める */
        }
        .font-size-normal { 
            --font-size-base: 1rem; 
            --line-height-base: 1.8;
        }
        .font-size-large { 
            --font-size-base: 1.25rem; 
            --line-height-base: 1.75; /* 少し詰める */
        }
        .font-size-extra-large { 
            --font-size-base: 1.5rem; /* 最大150% */
            --line-height-base: 1.7; /* 少し詰める */
        }
        .chat-container { 
            width: 100%;
            max-width: 900px; 
            margin: 0 auto; 
            background: #fff; 
            min-height: 100dvh;
            height: -webkit-fill-available;
            display: flex;
            flex-direction: column;
            box-shadow: 0 0 20px rgba(0,0,0,0.1);
            position: relative;
        }
        
        @supports (-webkit-touch-callout: none) {
            html, body {
                height: -webkit-fill-available;
            }
        }
        .chat-header {
            background: #4CAF50;
            color: white;
            padding: 20px 20px 12px;
            text-align: center;
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
            position: relative;
        }
        .chat-header h1 {
            margin: 0;
            font-size: 28px;
        }
        #appTitle {
            margin: 0;
            margin-bottom: 6px;
        }
        #appDescription {
            margin: 6px 0 12px;
            line-height: 1.4;
        }
        
        /* Language Selector Styles */
        .language-selector {
            position: absolute;
            top: 10px;
            left: 10px;
            z-index: 1000;
        }
        
        .lang-toggle {
            background: rgba(255, 255, 255, 0.2);
            border: 2px solid rgba(255, 255, 255, 0.3);
            color: white;
            padding: 8px 12px;
            border-radius: 20px;
            cursor: pointer;
            font-size: 14px;
            display: flex;
            align-items: center;
            gap: 5px;
            transition: all 0.3s ease;
            min-width: 60px;
        }
        
        .lang-toggle:hover {
            background: rgba(255, 255, 255, 0.3);
            border-color: rgba(255, 255, 255, 0.5);
        }
        
        .dropdown-arrow {
            font-size: 10px;
            transition: transform 0.3s ease;
        }
        
        .lang-toggle.open .dropdown-arrow {
            transform: rotate(180deg);
        }
        
        .lang-dropdown {
            position: absolute;
            top: 100%;
            left: 0;
            background: white;
            border: 1px solid #ddd;
            border-radius: 8px;
            box-shadow: 0 4px 12px rgba(0,0,0,0.15);
            min-width: 150px;
            display: none;
            z-index: 1001;
        }
        
        .lang-dropdown.show {
            display: block;
        }
        
        .lang-option {
            width: 100%;
            padding: 10px 15px;
            border: none;
            background: white;
            text-align: left;
            cursor: pointer;
            font-size: 14px;
            display: flex;
            align-items: center;
            gap: 8px;
            transition: background-color 0.2s ease;
        }
        
        .lang-option:hover {
            background: #f5f5f5;
        }
        
        .lang-option.active {
            background: #e3f2fd;
            color: #1976d2;
        }
        .chat-messages { 
            flex: 1;
            overflow-y: auto; 
            padding: 20px;
            padding-bottom: 120px;
            background: rgba(192, 192, 192, 1);
            text-align: left;
            min-height: 0;
            position: relative;
            overflow-x: hidden; /* 横スクロールを防止 */
        }
        
        /* シーズン装飾画像（chat-inputの上に固定、チャットメッセージの下に配置） */
        .season-decoration {
            position: absolute;
            pointer-events: none; /* クリックを無効化 */
            z-index: 1; /* メッセージ(z-index: 2)の下に配置 */
            will-change: transform; /* パフォーマンス最適化 */
            image-rendering: -webkit-optimize-contrast;
            image-rendering: crisp-edges;
            opacity: 0.7; /* チャットの邪魔にならないように透明度を設定 */
            transform: translateZ(0); /* GPU加速 */
            height: auto;
        }
        
        .season-decoration.position-right {
            bottom: calc(91px + 20px); /* chat-inputの高さ(91px) + padding(20px) */
            right: 20px;
            width: 120px;
        }
        
        .season-decoration.position-left {
            bottom: calc(91px + 20px); /* chat-inputの高さ(91px) + padding(20px) */
            left: 20px;
            width: 100px;
        }
        
        /* 雪のアニメーション */
        .snow-container {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            min-height: 100%;
            height: var(--snow-container-height, 100%);
            pointer-events: none;
            z-index: 0; /* チャットメッセージ（z-index: 2）の下、背景の上に配置 */
            overflow: hidden;
        }
        
        .snowflake {
            position: absolute;
            color: rgba(255, 255, 255, 0.8);
            font-size: 1em;
            font-family: Arial, sans-serif;
            text-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
            animation: snowfall linear infinite;
            will-change: transform, opacity;
        }
        
        @keyframes snowfall {
            0% {
                transform: translateY(-100px) translateX(0) rotate(0deg);
                opacity: 0;
            }
            10% {
                opacity: 1;
            }
            90% {
                opacity: 1;
            }
            100% {
                transform: translateY(calc(var(--snow-container-height, 100vh) + 100px)) translateX(var(--drift)) rotate(360deg);
                opacity: 0;
            }
        }
        
        /* モバイル対応 */
        @media (max-width: 768px) {
            .season-decoration.position-right {
                width: 80px;
                bottom: calc(80px + 10px); /* chat-inputの高さ(約80px) + padding(10px) */
                right: 10px;
            }
            
            .season-decoration.position-left {
                width: 70px;
                bottom: calc(80px + 10px); /* chat-inputの高さ(約80px) + padding(10px) */
                left: 10px;
            }
        }
        
        @media (max-width: 480px) {
            .season-decoration.position-right {
                width: 60px;
                bottom: calc(80px + 8px); /* chat-inputの高さ(約80px) + padding(8px) */
                right: 5px;
            }
            
            .season-decoration.position-left {
                width: 50px;
                bottom: calc(80px + 8px); /* chat-inputの高さ(約80px) + padding(8px) */
                left: 5px;
            }
        }
        .message {
            margin-bottom: 15px;
            display: block;
            width: 100%;
            position: relative;
            z-index: 2; /* 装飾の上に表示 */
        }
        .message.user {
            text-align: right;
        }
        .message.bot {
            text-align: left;
            display: block !important;
        }
        .message.bot > div {
            display: inline-block;
            max-width: 85%;
            vertical-align: top;
        }
        .message.bot > div.recommendation-result,
        .message.bot > div[style*="background: #e3f2fd"] {
            display: block;
            max-width: 95%;
        }
        .message-content {
            max-width: 70%;
            padding: calc(var(--font-size-base) * 0.75) calc(var(--font-size-base) * 1); /* rem単位で可変 */
            border-radius: 24px;
            word-wrap: break-word;
            text-align: left;
            min-height: 20px;
            box-sizing: border-box;
            display: inline-block;
            overflow-x: hidden;
            position: relative;
            z-index: 2; /* 装飾の上に表示 */
            font-size: var(--font-size-base);
            line-height: var(--line-height-base);
        }
        .message.user .message-content {
            background: #4CAF50;
            color: white;
        }
        .message.bot .message-content {
            background: white;
            color: #000;
            border: 1px solid #ddd;
            text-align: left;
            display: inline-block;
            max-width: 85%;
            width: auto;
        }
        .message.bot .message-content.manual-reply {
            background: #fff3cd;
            border: 1px solid #ffc107;
            border-left: 4px solid #ffc107;
        }
        .message.bot .message-content.admin-request {
            background: #fff3cd;
            border: 1px solid #ffc107;
            border-left: 4px solid #ffc107;
            color: #856404;
            font-weight: bold;
        }
        
        /* AI応答内の推奨結果セクションのテキスト色を明示的に設定 */
        .message.bot .message-content .recommendation-result,
        .message.bot .message-content .recommendation-result *,
        .message.bot .message-content .recommendation-result p,
        .message.bot .message-content .recommendation-result div,
        .message.bot .message-content .recommendation-result span,
        .message.bot .message-content .recommendation-result h1,
        .message.bot .message-content .recommendation-result h2,
        .message.bot .message-content .recommendation-result h3,
        .message.bot .message-content .recommendation-result h4,
        .message.bot .message-content .recommendation-result h5,
        .message.bot .message-content .recommendation-result h6,
        .message.bot .message-content .recommendation-result strong,
        .message.bot .message-content .recommendation-result em,
        .message.bot .message-content .recommendation-result li,
        .message.bot .message-content .recommendation-result ul,
        .message.bot .message-content .recommendation-result ol {
            color: #000 !important;
        }
        .chat-input { 
            padding: calc(var(--font-size-base) * 1.25); /* rem単位で可変 */
            background: white;
            border-top: 1px solid #ddd;
            flex-shrink: 0;
            position: relative;
            width: 100%;
            max-width: 100%;
            margin: 0;
            box-sizing: border-box;
        }
        .input-group {
            display: flex;
            gap: 10px;
        }
        .chat-input input, .chat-input textarea { 
            flex: 1;
            padding: 12px 16px;
            border: 2px solid #ddd;
            border-radius: 25px;
            font-size: var(--font-size-base, 16px);
            outline: none;
            resize: none;
            min-height: 44px; /* 高齢者向けの大きなタッチターゲット */
            max-height: 100px;
            overflow-y: auto;
            font-family: inherit;
            box-sizing: border-box;
            width: 100%;
            line-height: var(--line-height-base, 1.4);
        }
        .chat-input input:focus, .chat-input textarea:focus {
            border-color: #4CAF50;
        }
        .chat-input button { 
            padding: 12px 24px;
            background: #4CAF50;
            color: white;
            border: none;
            border-radius: 25px;
            cursor: pointer;
            font-size: 16px;
            transition: background 0.3s;
            min-height: 44px; /* 高齢者向けの大きなタッチターゲット */
            min-width: 44px;
        }
        .chat-input button:hover {
            background: #45a049;
        }
        .mic-btn {
            background: #3498db !important;
            color: white;
            border: none;
            border-radius: 50%;
            width: 45px;
            height: 45px;
            padding: 0 !important;
            cursor: pointer;
            font-size: 1.1em;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }
        .mic-btn:hover {
            background: #2980b9 !important;
            transform: scale(1.1);
            box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
        }
        .mic-btn.recording {
            background: #e74c3c !important;
            animation: pulse 1s infinite;
        }
        @keyframes pulse {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.1); }
        }
        .diagnosis-result {
            background: #e8f5e8;
            border-left: 4px solid #4CAF50;
            padding: 15px;
            margin: 10px 0;
            border-radius: 8px;
            text-align: left;
            min-height: 20px;
            box-sizing: border-box;
        }
        .medicine-list {
            background: #fff3cd;
            border-left: 4px solid #ffc107;
            padding: 15px;
            margin: 10px 0;
            border-radius: 8px;
            text-align: left;
            min-height: 20px;
            box-sizing: border-box;
        }
        .caution-box {
            background: #f8d7da;
            border-left: 4px solid #dc3545;
            padding: 6px;
            margin: 3px 0;
            border-radius: 8px;
            line-height: 1.6;
            word-wrap: break-word;
            text-align: left;
            text-indent: 0;
            white-space: pre-line;
            min-height: 24px;
            box-sizing: border-box;
            position: relative;
        }
        .advice-box {
            background: #d1ecf1;
            border-left: 4px solid #17a2b8;
            padding: 10px;
            margin: 5px 0;
            border-radius: 8px;
            line-height: 1.6;
            word-wrap: break-word;
            text-align: left;
            text-indent: 0;
            white-space: pre-line;
            min-height: 50px;
            box-sizing: border-box;
            position: relative;
        }
        .typing-indicator {
            display: inline-block;
            padding: 8px 12px;
            background: #f0f0f0;
            border-radius: 15px;
            color: #666;
            font-style: italic;
            font-size: 14px;
            text-align: left;
            min-height: 20px;
            box-sizing: border-box;
        }
        .question-prompt {
            background: #e3f2fd;
            border-left: 4px solid #2196f3;
            padding: 15px;
            margin: 10px 0;
            border-radius: 8px;
            font-style: italic;
            text-align: left;
            min-height: 20px;
            box-sizing: border-box;
        }
        .caution-box strong,
        .advice-box strong,
        .diagnosis-result strong,
        .medicine-list strong {
            text-align: left;
            display: inline;
            margin-right: 8px;
            margin-left: 0;
            padding-left: 0;
            text-indent: 0;
        }
        
        .caution-box div,
        .advice-box div,
        .diagnosis-result div,
        .medicine-list div {
            text-align: left;
            text-indent: 0;
            margin-left: 0;
            padding-left: 0;
        }
        
        /* 注意点とアドバイスの内容を強制的に左寄りにする */
        .caution-box p,
        .advice-box p {
            text-align: left !important;
            text-indent: 0 !important;
            margin-left: 0 !important;
            padding-left: 0 !important;
        }
        
        /* 最初の段落を特に強制的に左寄りにする */
        .caution-box p:first-of-type,
        .advice-box p:first-of-type {
            text-align: left !important;
            text-indent: 0 !important;
            margin-left: 0 !important;
            padding-left: 0 !important;
        }
        
        /* 注意点とアドバイスの内容コンテナを強制的に左寄りにする */
        .caution-content,
        .advice-content {
            text-align: left !important;
            text-indent: 0 !important;
            margin-left: 0 !important;
            padding-left: 0 !important;
            white-space: pre-line !important;
            min-height: 30px;
            box-sizing: border-box;
            position: relative;
        }
        
        .manual-reply-indicator {
            display: inline-block;
            background: #ffc107;
            color: #212529;
            padding: 2px 8px;
            border-radius: 10px;
            font-size: 0.8em;
            margin-left: 10px;
            font-weight: bold;
        }
        
        /* 新しい推奨結果のスタイル */
        .recommendation-result {
            background: #f8f9fa;
            border: 1px solid #dee2e6;
            border-radius: 16px;
            padding: calc(var(--font-size-base) * 1.25); /* rem単位で可変 */
            margin: calc(var(--font-size-base) * 1.875) 0; /* rem単位で可変 */
            text-align: left;
            min-height: 100px;
            box-sizing: border-box;
            position: relative;
            font-size: var(--font-size-base);
            line-height: var(--line-height-base);
            display: flex;
            flex-direction: column;
            gap: calc(var(--font-size-base) * 1.25);
            overflow-wrap: break-word;
            word-wrap: break-word;
            overflow-x: hidden; /* オーバーフロー防止 */
        }
        
        .recommendation-result h4 {
            color: #000;
            margin: calc(var(--font-size-base) * 0.625) 0 calc(var(--font-size-base) * 0.3125) 0;
            font-size: calc(var(--font-size-base) * 1.25); /* 20px相当（標準時） */
            border-bottom: 2px solid #4CAF50;
            padding-bottom: calc(var(--font-size-base) * 0.3125);
            font-weight: bold;
        }
        
        .recommendation-result h5 {
            font-size: calc(var(--font-size-base) * 1.125); /* 18px相当（標準時） */
            font-weight: bold;
        }
        
        /* 折りたたみセクションのスタイル（モダン、シンプル、ミニマル） */
        .collapsible-section {
            background: #ffffff;
            border: 1px dotted #dee2e6; /* 点線の境界線 */
            border-radius: 10px; /* 中程度の角丸（8-12px） */
            padding: calc(var(--font-size-base) * 1.25); /* rem単位で可変 */
            margin: calc(var(--font-size-base) * 1.875) 0; /* rem単位で可変、30px相当 */
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); /* 中程度の影（明確な立体感） */
            transition: box-shadow 0.2s ease;
        }
        
        .collapsible-section:hover {
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); /* ホバー時は影を強く */
        }
        
        /* 折りたたみボタンのスタイル */
        .collapse-toggle {
            width: 100%;
            min-height: 44px; /* 高齢者向けの大きなタッチターゲット */
            padding: calc(var(--font-size-base) * 0.75) calc(var(--font-size-base) * 1); /* rem単位で可変 */
            background: transparent;
            border: none;
            border-radius: 8px; /* 中程度の角丸 */
            color: #4CAF50; /* テーマカラー（アプリのメインカラー） */
            font-size: var(--font-size-base);
            font-weight: 600;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: calc(var(--font-size-base) * 0.75);
            transition: transform 0.2s ease, background-color 0.2s ease;
            text-align: left;
        }
        
        .collapse-toggle:hover {
            background-color: rgba(76, 175, 80, 0.1); /* テーマカラーの薄い背景 */
            transform: scale(1.02); /* ホバー時の拡大縮小効果 */
        }
        
        .collapse-toggle:active {
            transform: scale(0.98);
        }
        
        .collapse-toggle:focus-visible {
            outline: 3px solid var(--focus-color, #4CAF50);
            outline-offset: 2px;
        }
        
        /* 折りたたみアイコン（矢印） */
        .collapse-icon {
            font-size: calc(var(--font-size-base) * 0.875); /* 14px相当（標準時） */
            transition: transform 0.2s ease;
            flex-shrink: 0;
        }
        
        .collapsible-section[aria-expanded="true"] .collapse-icon {
            transform: rotate(180deg); /* 展開時は矢印を回転 */
        }
        
        /* 折りたたみコンテンツ */
        .collapse-content {
            margin-top: calc(var(--font-size-base) * 0.9375); /* rem単位で可変 */
            padding-top: calc(var(--font-size-base) * 0.9375); /* rem単位で可変 */
            border-top: 1px dotted #dee2e6; /* 点線の区切り */
        }
        
        .collapsible-section[aria-expanded="false"] .collapse-content,
        .collapsible-section[aria-expanded="false"] > div:not(.collapse-toggle) {
            display: none !important; /* 折りたたみ時は非表示（アニメーションなし） */
        }
        
        .collapsible-section[aria-expanded="true"] > div:not(.collapse-toggle) {
            display: block !important; /* 展開時は表示 */
        }
        
        /* 折りたたみ不可のセクション（常に展開） */
        .collapsible-section[data-collapsible="false"] .collapse-toggle {
            display: none; /* ボタンを非表示 */
        }
        
        .collapsible-section[data-collapsible="false"] .collapse-content {
            display: block !important; /* 常に表示 */
            margin-top: 0;
            padding-top: 0;
            border-top: none;
        }
        
        /* すべてのボタンとリンクを44px×44px以上に（高齢者向け） */
        button:not(.collapse-toggle):not(.collapse-icon),
        a.button,
        .chat-input button,
        .voice-read-main-btn,
        .font-size-btn {
            min-height: 44px;
            min-width: 44px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
        }
        
        /* タッチターゲット間の余白を8px以上に */
        .input-group button + button,
        .font-size-btn + .font-size-btn {
            margin-left: 8px;
        }
        
        /* レイアウト対応（flex/grid） - recommendation-resultの既存スタイルに統合済み */
        
        .input-group {
            display: flex;
            gap: 10px;
            align-items: flex-end;
            flex-wrap: wrap;
        }
        
        /* 文字サイズに応じたメディアクエリ */
        @media (min-width: 768px) {
            .font-size-extra-large .recommendation-result {
                max-width: 95%;
            }
        }
        
        /* セクション間のmarginをrem単位に（30px相当に拡大） */
        .collapsible-section {
            margin: calc(var(--font-size-base) * 1.875) 0; /* 30px相当（標準時） */
        }
        
        .warning-critical,
        .warning-caution,
        .warning-info {
            margin: calc(var(--font-size-base) * 1.875) 0; /* 30px相当（標準時） */
            padding: calc(var(--font-size-base) * 1.25);
        }
        
        .recommendation-result > * {
            margin: calc(var(--font-size-base) * 1.875) 0; /* セクション間のmarginを30px相当に */
        }
        
        /* フォーカスリングの視認性強化（キーボード操作時のみ） */
        button:focus-visible,
        a:focus-visible {
            outline: 3px solid var(--focus-color, #4CAF50); /* 太めのoutline、高コントラスト色 */
            outline-offset: 2px;        /* 余白を開ける */
        }
        
        /* 高コントラストモード対応 */
        @media (prefers-contrast: high) {
            :root {
                --focus-color: #000000; /* 高コントラスト時は黒 */
            }
            button:focus-visible,
            a:focus-visible {
                outline-width: 4px; /* 高コントラスト時は太めに */
            }
        }
        
        /* 警告の色分け */
        /* 危険（赤）- 併用禁忌、アレルギー（命に関わる） */
        .warning-critical {
            background: #ffebee;
            border-left: 4px solid #c62828;
            color: #b71c1c; /* コントラスト比4.5:1以上 */
        }
        
        .warning-critical h4 {
            color: #c62828;
        }
        
        /* 注意（黄色/オレンジ）- 成分重複、副作用 */
        .warning-caution {
            background: #fff3e0;
            border-left: 4px solid #f57c00;
            color: #e65100; /* コントラスト比4.5:1以上 */
        }
        
        .warning-caution h4 {
            color: #e65100;
        }
        
        /* 情報（青/緑）- 推奨、アドバイス */
        .warning-info {
            background: #e3f2fd;
            border-left: 4px solid #1976d2;
            color: #0d47a1; /* コントラスト比4.5:1以上 */
        }
        
        .warning-info h4 {
            color: #1976d2;
        }
        
        /* 音声読み上げボタンのスタイル */
        .voice-read-main-btn {
            width: 100%;
            padding: calc(var(--font-size-base) * 0.75) calc(var(--font-size-base) * 1.25);
            background: #4CAF50;
            color: white;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            font-size: var(--font-size-base);
            font-weight: 600;
            min-height: 44px;
            transition: background-color 0.2s ease, transform 0.2s ease;
        }
        
        .voice-read-main-btn:hover {
            background: #45a049;
            transform: scale(1.02);
        }
        
        .voice-read-main-btn:active {
            transform: scale(0.98);
        }
        
        .voice-read-main-btn.playing {
            background: #dc3545;
        }
        
        .voice-read-main-btn.playing:hover {
            background: #c82333;
        }
        
        .voice-read-main-btn:focus-visible {
            outline: 3px solid var(--focus-color, #4CAF50);
            outline-offset: 2px;
        }
        
        /* 音声読み上げ進行状況 */
        #voice-read-progress,
        #voice-read-progress-inline {
            margin-top: calc(var(--font-size-base) * 0.625);
        }
        
        #voice-read-progress-bar,
        #voice-read-progress-bar-inline {
            background: #4CAF50;
            height: 100%;
            width: 0%;
            transition: width 0.3s ease;
        }
        
        #voice-read-percentage,
        #voice-read-percentage-inline {
            margin: calc(var(--font-size-base) * 0.3125) 0 0 0;
            text-align: center;
            font-size: calc(var(--font-size-base) * 0.875);
            color: #666;
        }
        
        /* recommendation-result内の音声読み上げボタンコンテナ */
        #voice-read-container-inline {
            margin-top: calc(var(--font-size-base) * 1.25);
            margin-bottom: calc(var(--font-size-base) * 0.625);
        }
        
        .medicine-item {
            background: white;
            border: 1px solid #e9ecef;
            border-radius: 12px;
            padding: calc(var(--font-size-base) * 0.75); /* rem単位で可変 */
            margin: calc(var(--font-size-base) * 0.625) 0; /* rem単位で可変 */
            box-shadow: 0 1px 3px rgba(0,0,0,0.1);
            min-height: 20px;
            box-sizing: border-box;
            font-size: var(--font-size-base);
            line-height: var(--line-height-base);
        }
        
        .medicine-item h5 {
            color: #4CAF50;
            margin: 0 0 calc(var(--font-size-base) * 0.5) 0;
            font-size: calc(var(--font-size-base) * 0.875); /* 14px相当（標準時） */
        }
        
        .medicine-item p {
            margin: calc(var(--font-size-base) * 0.3125) 0;
            font-size: calc(var(--font-size-base) * 0.8125); /* 13px相当（標準時） */
            line-height: var(--line-height-base);
            color: #000;
        }
        
        .medicine-item strong {
            color: #000;
        }
        
        .medicine-summary {
            background: #f8f9fa;
            border: 1px solid #e9ecef;
            border-radius: 8px;
            padding: 8px;
            margin: 5px 0;
            font-size: 13px;
            min-height: 20px;
            box-sizing: border-box;
        }
        
        .medicine-summary em {
            color: #6c757d;
            font-style: italic;
        }
        
        /* 医薬品相談回答のスタイル */
        .chat-response {
            background: #f8f9fa;
            border: 1px solid #dee2e6;
            border-radius: 16px;
            padding: 15px;
            margin: 10px 0;
            text-align: left;
            min-height: 100px;
            box-sizing: border-box;
            position: relative;
        }
        
        .chat-response h4 {
            color: #000;
            margin: 10px 0 5px 0;
            font-size: 16px;
            border-bottom: 2px solid #17a2b8;
            padding-bottom: 5px;
        }
        
        .chat-response p {
            margin: 0;
            color: #000;
            line-height: 1.5;
            word-wrap: break-word;
        }
        
        /* 性別登録通知のスタイル */
        .chat-response.gender-notification {
            min-height: auto;
            padding: 15px;
        }
        
        .chat-response.gender-notification p {
            margin: 0;
            color: #000;
            line-height: 1.5;
        }
        
        /* ユーザー情報登録通知のスタイル */
        .chat-response.user-info-notification {
            min-height: auto;
            padding: 15px;
        }
        
        .chat-response.user-info-notification p {
            margin: 0;
            color: #000;
            line-height: 1.5;
            white-space: pre-line;
        }
        
        /* 情報修正ボタンのスタイル */
        .edit-info-btn {
            margin-top: 10px;
            padding: 8px 16px;
            background: #17a2b8;
            color: white;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            font-size: 14px;
            transition: background-color 0.3s ease;
        }
        
        .edit-info-btn:hover {
            background: #138496;
        }
        
        .edit-info-btn:active {
            background: #117a8b;
        }
        
        /* エラー通知のスタイル */
        .chat-response.error-notification {
            background: #fff3cd;
            border: 1px solid #ffc107;
            padding: 15px;
        }
        
        .chat-response.error-notification h4 {
            margin: 0 0 10px 0;
            color: #856404;
            font-size: 16px;
        }
        
        .error-message-content {
            margin: 10px 0;
            color: #856404;
            white-space: pre-line;
        }
        
        /* フィードバックボタンエリアのスタイル */
        .feedback-buttons {
            margin-top: 20px;
            padding: 15px;
            background: #f8f9fa;
            border-radius: 12px;
            border: 1px solid #dee2e6;
        }
        
        .feedback-question {
            margin: 0 0 10px 0;
            font-weight: bold;
            color: #495057;
        }
        
        .feedback-buttons-container {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
        }
        
        .feedback-btn-positive,
        .feedback-btn-negative,
        .bug-report-btn {
            padding: 8px 16px;
            color: white;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            font-size: 14px;
            transition: background-color 0.3s ease;
        }
        
        .feedback-btn-positive {
            background: #28a745;
        }
        
        .feedback-btn-positive:hover {
            background: #218838;
        }
        
        .feedback-btn-negative {
            background: #dc3545;
        }
        
        .feedback-btn-negative:hover {
            background: #c82333;
        }
        
        .bug-report-btn {
            background: #6c757d;
        }
        
        .bug-report-btn:hover {
            background: #5a6268;
        }
        
        .answer-section {
            background: white;
            border: 1px solid #e9ecef;
            border-radius: 12px;
            padding: 12px;
            margin: 10px 0;
            box-shadow: 0 1px 3px rgba(0,0,0,0.1);
            min-height: 20px;
            color: #000;
            box-sizing: border-box;
        }
        
        .details-section {
            background: white;
            border: 1px solid #e9ecef;
            border-radius: 12px;
            padding: 12px;
            margin: 10px 0;
            box-shadow: 0 1px 3px rgba(0,0,0,0.1);
            min-height: 20px;
            box-sizing: border-box;
            color: #000;
        }
        
        .details-section h5 {
            color: #17a2b8;
            margin: 8px 0 5px 0;
            font-size: 14px;
            border-bottom: 1px solid #dee2e6;
            padding-bottom: 3px;
        }
        
        .details-section p {
            margin: 5px 0;
            font-size: 13px;
            line-height: 1.4;
            color: #000;
        }
        /* モーダルスタイル */
        .modal {
            display: none;
            position: fixed;
            z-index: 1000;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.5);
            animation: fadeIn 0.3s;
        }
        
        .modal-content {
            background-color: #fff;
            margin: 5% auto;
            padding: 30px;
            border-radius: 12px;
            width: 90%;
            max-width: 600px;
            box-shadow: 0 4px 20px rgba(0,0,0,0.3);
            animation: slideIn 0.3s;
        }
        
        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }
        
        @keyframes slideIn {
            from { transform: translateY(-50px); opacity: 0; }
            to { transform: translateY(0); opacity: 1; }
        }
        
        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            padding-bottom: 15px;
            border-bottom: 2px solid #4CAF50;
        }
        
        .modal-header h3 {
            margin: 0;
            color: #2e7d32;
        }
        
        .close-modal {
            font-size: 28px;
            font-weight: bold;
            color: #999;
            cursor: pointer;
            transition: color 0.3s;
        }
        
        .close-modal:hover {
            color: #333;
        }
        
        .form-group {
            margin-bottom: 20px;
        }
        
        .form-group label {
            display: block;
            margin-bottom: 8px;
            font-weight: bold;
            color: #333;
        }
        
        .form-group input,
        .form-group select {
            width: 100%;
            padding: 10px;
            border: 1px solid #ddd;
            border-radius: 6px;
            font-size: 14px;
            box-sizing: border-box;
        }
        
        .form-group input:focus,
        .form-group select:focus {
            outline: none;
            border-color: #4CAF50;
            box-shadow: 0 0 5px rgba(76, 175, 80, 0.3);
        }
        
        .submit-attributes-btn {
            width: 100%;
            padding: 12px;
            background: #4CAF50;
            color: white;
            border: none;
            border-radius: 6px;
            font-size: 16px;
            font-weight: bold;
            cursor: pointer;
            transition: background 0.3s;
        }
        
        .submit-attributes-btn:hover {
            background: #45a049;
        }
        
        .answer-questions-btn {
            display: inline-block;
            margin-top: 10px;
            padding: 10px 20px;
            background: #4CAF50;
            color: white;
            border: none;
            border-radius: 6px;
            cursor: pointer;
            font-size: 14px;
            transition: background 0.3s;
        }
        
        .answer-questions-btn:hover {
            background: #45a049;
        }
        
        /* フィードバックボタンスタイル */
        .feedback-buttons {
            display: flex;
            gap: 8px;
            margin-top: 10px;
            justify-content: flex-start;
            width: 100%;
            position: relative;
            z-index: 1;
            flex-wrap: wrap;
            max-width: 100%;
            box-sizing: border-box;
        }
        
        .feedback-btn-positive {
            background: #4CAF50;
            color: white;
            border: none;
            border-radius: 20px;
            padding: 8px 16px;
            font-size: 13px;
            cursor: pointer;
            transition: background 0.2s ease;
            display: inline-block;
            min-width: 60px;
            text-align: center;
            font-weight: 500;
            flex-shrink: 0;
            max-width: 100%;
            box-sizing: border-box;
        }
        
        .feedback-btn-positive:hover {
            background: #45a049;
        }
        
        .feedback-btn-positive:active {
            background: #3d8b40;
        }
        
        .feedback-btn-negative {
            background: #f44336;
            color: white;
            border: none;
            border-radius: 20px;
            padding: 8px 16px;
            font-size: 13px;
            cursor: pointer;
            transition: background 0.2s ease;
            display: inline-block;
            min-width: 60px;
            text-align: center;
            font-weight: 500;
            flex-shrink: 0;
            max-width: 100%;
            box-sizing: border-box;
        }
        
        .feedback-btn-negative:hover {
            background: #d32f2f;
        }
        
        .feedback-btn-negative:active {
            background: #c62828;
        }
        
        .report-bug-btn {
            background: #ff9800;
            color: white;
            border: none;
            border-radius: 20px;
            padding: 6px 12px;
            font-size: 12px;
            cursor: pointer;
            transition: background 0.3s;
            display: flex;
            align-items: center;
            gap: 4px;
            flex-shrink: 0;
            max-width: 100%;
            box-sizing: border-box;
        }
        
        .report-bug-btn:hover {
            background: #f57c00;
        }
        
        /* モーダルスタイル */
        .modal {
            display: none;
            position: fixed;
            z-index: 1000;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0,0,0,0.5);
            animation: fadeIn 0.3s;
        }
        
        .modal-content {
            background-color: #fefefe;
            margin: 15% auto;
            padding: 20px;
            border: none;
            border-radius: 10px;
            width: 90%;
            max-width: 500px;
            position: relative;
            animation: slideIn 0.3s;
        }
        
        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
        }
        
        .modal-title {
            font-size: 18px;
            font-weight: bold;
            color: #333;
        }
        
        .close {
            color: #aaa;
            font-size: 28px;
            font-weight: bold;
            cursor: pointer;
            line-height: 1;
        }
        
        .close:hover {
            color: #000;
        }
        
        .modal-body {
            margin-bottom: 20px;
        }
        
        .modal-body textarea {
            width: 100%;
            padding: 12px;
            border: 1px solid #ddd;
            border-radius: 5px;
            font-size: 14px;
            font-family: inherit;
            resize: vertical;
            min-height: 100px;
            box-sizing: border-box;
        }
        
        .modal-footer {
            display: flex;
            gap: 10px;
            justify-content: flex-end;
        }
        
        .modal-btn {
            padding: 10px 20px;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            font-size: 14px;
            transition: background 0.3s;
        }
        
        .modal-btn-primary {
            background: #4CAF50;
            color: white;
        }
        
        .modal-btn-primary:hover {
            background: #45a049;
        }
        
        .modal-btn-secondary {
            background: #6c757d;
            color: white;
        }
        
        .modal-btn-secondary:hover {
            background: #5a6268;
        }
        
        .modal-btn-link {
            background: #007bff;
            color: white;
        }
        
        .modal-btn-link:hover {
            background: #0056b3;
        }
        
        /* フィードバックモーダルの余白調整 */
        #feedbackModal .modal-content {
            padding: 0; /* パディングを削除してコンテンツに応じた高さに */
            margin: auto; /* 縦方向の余白を最小限に */
            border-radius: 10px; /* 全体の角丸 */
            overflow: hidden; /* ヘッダーの角丸を適用 */
            max-height: none; /* 最大高さの制限を解除 */
            height: auto; /* コンテンツに応じた高さ */
        }
        
        #feedbackModal .modal-header {
            background: linear-gradient(135deg, #4CAF50, #45a049);
            color: white;
            padding: 12px 20px; /* パディングを削減 */
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin: 0; /* デフォルトのmarginをリセット */
            border-radius: 10px 10px 0 0; /* 上部の角丸 */
            position: relative;
            z-index: 1;
        }
        
        #feedbackModal .modal-header .modal-title {
            margin: 0;
            color: white;
            font-size: 18px;
            font-weight: bold;
        }
        
        #feedbackModal .modal-header .close {
            color: white;
            font-size: 28px;
            line-height: 1;
        }
        
        #feedbackModal .modal-header .close:hover {
            color: rgba(255, 255, 255, 0.8);
        }
        
        #feedbackModal .modal-body {
            padding: 12px 20px; /* パディングを削減 */
            margin-bottom: 0;
        }
        
        #feedbackModal .modal-body p {
            margin: 0 0 8px 0; /* マージンを削減 */
            font-size: 14px;
        }
        
        #feedbackModal .modal-body textarea {
            min-height: 80px;
            max-height: 150px;
        }
        
        #feedbackModal .modal-footer {
            padding: 8px 20px 12px; /* パディングを削減 */
            margin-top: 0;
            gap: 8px;
        }
        
        #feedbackModal .modal-btn {
            padding: 8px 16px;
            font-size: 13px;
        }
        
        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }
        
        @keyframes slideIn {
            from { transform: translateY(-50px); opacity: 0; }
            to { transform: translateY(0); opacity: 1; }
        }
        
        /* 成功モーダル */
        .success-modal {
            background-color: #d4edda;
            border: 1px solid #c3e6cb;
            color: #155724;
        }
        
        .success-modal .modal-title {
            color: #155724;
        }
        
        /* 成功モーダルのサイズ調整 */
        #successModal .modal-content {
            padding: 15px;
            margin: 10% auto;
            max-width: 400px;
        }
        
        #successModal .modal-header {
            padding: 12px 15px;
            margin-bottom: 10px;
        }
        
        #successModal .modal-body {
            padding: 10px 15px;
            margin-bottom: 0;
        }
        
        #successModal .modal-body p {
            margin: 0;
            font-size: 14px;
            line-height: 1.5;
        }
        
        /* デスクトップ版の基本スタイル（768px以上） */
        .chat-input {
            padding: 20px;
            background: white;
            border-top: 1px solid #ddd;
            flex-shrink: 0;
            position: relative;
        }
        
        .input-group {
            display: flex;
            gap: 10px;
            justify-content: center;
            align-items: center;
        }
        
        .button-group {
            display: flex;
            gap: 10px;
            margin-bottom: 6px;
            flex-wrap: wrap;
            overflow-x: auto;
        }
        
        .button-group button {
            padding: 8px 16px;
            border-radius: 20px;
            cursor: pointer;
            font-size: 13px;
            font-weight: bold;
            box-shadow: 0 2px 5px rgba(0,0,0,0.2);
            white-space: nowrap;
            display: inline-block;
            text-align: center;
            line-height: 1.2;
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
        }
        
        .button-group button::before {
            content: none !important;
        }
        
        /* 480px-780pxの範囲で確実に動作するようにする */
        @media (min-width: 481px) and (max-width: 780px) {
            .chat-container {
                display: flex !important;
                flex-direction: column !important;
                height: 100vh;
                height: 100dvh;
            }
            
            .chat-input {
                position: sticky !important;
                bottom: 0 !important;
                flex-shrink: 0 !important;
                z-index: 999 !important;
            }
            
            .chat-messages {
                flex: 1 !important;
                min-height: 0 !important;
                padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)) !important; /* chat-inputの高さを考慮 */
                overflow-y: auto !important;
            }
        }
        
        /* レスポンシブデザイン - スマホ・タブレット対応 */
        @media (max-width: 768px) {
            .chat-container {
                max-width: 100%;
                height: 100vh;
                height: 100dvh; /* モバイルブラウザのアドレスバーを考慮 */
                overflow: visible !important; /* 入力欄を表示 */
                display: flex !important; /* flexレイアウトを維持 */
                flex-direction: column !important; /* 縦方向に配置 */
            }
            
            /* スマホでの表示を強制 */
            .chat-input {
                display: flex !important;
                visibility: visible !important;
                opacity: 1 !important;
                position: sticky !important; /* flexレイアウト内に配置 */
                bottom: 0 !important;
                z-index: 999 !important;
                padding: 10px !important;
                width: 100% !important;
                max-width: 100% !important;
                margin: 0 !important;
                background: white !important;
                flex-shrink: 0 !important; /* flexレイアウトで縮小しないように */
                box-sizing: border-box !important;
            }
            
            .chat-messages {
                padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)) !important; /* chat-inputの高さを考慮（padding 10px + input-group約60px + 余裕10px） */
                flex: 1 !important; /* flexレイアウトで適切にサイズ調整 */
                min-height: 0 !important; /* flexレイアウトで適切に縮小 */
            }
            
            .chat-header {
                padding: 8px 5px 6px;
            }
            
            .chat-header h1 {
                font-size: 16px;
                margin-bottom: 6px;
            }
            
            .chat-header p {
                font-size: 11px;
                line-height: 1.2;
                margin: 8px 0 6px;
            }
            
            .button-group {
                display: flex !important;
                flex-direction: row !important;
                gap: 5px !important;
                margin-bottom: 4px !important;
                flex-wrap: wrap !important;
                width: 100% !important;
                max-width: 100% !important;
                overflow-x: auto !important;
                visibility: visible !important;
                opacity: 1 !important;
            }
            
            .button-group button {
                flex: 1 !important;
                padding: 8px 12px !important;
                font-size: 12px !important;
                min-height: 36px !important;
                min-width: calc(50% - 5px) !important;
                display: flex !important;
                flex-direction: row !important;
                align-items: center !important;
                justify-content: center !important;
                gap: 4px !important;
                border-radius: 8px !important;
                position: relative !important;
                white-space: nowrap !important;
                text-align: center !important;
                margin: 0 !important;
            }
            
            .button-group button::before {
                content: none !important;
            }
            
            .chat-messages {
                padding: 8px;
                padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)) !important; /* chat-inputの高さを考慮（padding 10px + input-group約60px + 余裕10px） */
                max-height: none !important; /* max-heightを削除してflexレイアウトに任せる */
                min-height: 0 !important; /* min-heightを削除してflexレイアウトに任せる */
                overflow-y: auto;
                flex: 1 !important; /* flexレイアウトで適切にサイズ調整 */
            }
            
            .message-content {
                max-width: 85%;
                font-size: 13px;
                padding: 8px 12px;
            }
            
            .message.bot .message-content {
                max-width: 90%;
            }
            
            .chat-input {
                padding: 10px calc(5vw + env(safe-area-inset-left)) calc(10px + env(safe-area-inset-bottom)) calc(5vw + env(safe-area-inset-right)) !important;
                display: flex !important;
                flex-direction: column !important;
                gap: 8px !important;
                background: white !important;
                margin: 0 !important;
                min-height: auto !important;
                width: 100% !important;
                max-width: 100% !important;
                box-sizing: border-box !important;
                position: sticky !important; /* fixedからstickyに変更してflexレイアウト内に配置 */
                bottom: 0 !important;
                z-index: 999 !important;
                visibility: visible !important;
                opacity: 1 !important;
                flex-shrink: 0 !important; /* flexレイアウトで縮小しないように */
            }
            
            .input-group {
                display: flex !important;
                flex-direction: row !important;
                align-items: center !important;
                gap: 8px !important;
                width: 100% !important;
                max-width: 100% !important;
                margin: 0 !important;
                padding: 0 !important;
                box-sizing: border-box !important;
            }
            
            #user-input {
                flex: 1;
                font-size: 14px;
                min-height: 40px;
                padding: 10px 12px;
                border: 2px solid #ddd;
                border-radius: 20px;
            }
            
            .mic-btn {
                width: 32px;
                height: 32px;
                font-size: 12px;
                flex-shrink: 0;
            }
            
            button[type="submit"] {
                width: 60px;
                height: 32px;
                padding: 4px 8px;
                font-size: 11px;
                flex-shrink: 0;
            }
            
            .clear-btn,
            .pharmacist-request-btn,
            .answer-questions-btn {
                padding: 8px;
                font-size: 11px;
                min-height: 28px;
            }
            
            .recommendation-result,
            .medicine-item,
            .diagnosis-box {
                max-width: 100% !important;
                font-size: 13px;
            }
            
            .medicine-header {
                font-size: 14px;
            }
            
            .medicine-info {
                font-size: 12px;
            }
        }
        
        @media (max-width: 480px) {
            /* より小さな画面での表示を強制 */
            .chat-input {
                display: flex !important;
                visibility: visible !important;
                opacity: 1 !important;
                position: sticky !important; /* flexレイアウト内に配置 */
                bottom: 0 !important;
                z-index: 999 !important;
                background: white !important;
                flex-shrink: 0 !important; /* flexレイアウトで縮小しないように */
                box-sizing: border-box !important;
            }
            
            .button-group {
                display: flex !important;
                visibility: visible !important;
                opacity: 1 !important;
                flex-wrap: wrap !important;
                overflow-x: auto !important;
            }
            
            .chat-header {
                padding: 15px 10px 8px;
            }
            
            #appTitle {
                font-size: clamp(12px, calc((100vw - 140px) / 10), 18px);
                margin-top: 0;
                position: absolute;
                top: 30px;
                left: 50%;
                transform: translate(-50%, -50%);
                white-space: nowrap;
                z-index: 999;
                max-width: calc(100% - 140px);
                overflow: hidden;
                text-overflow: ellipsis;
                line-height: 1.2;
            }
            
            #appDescription {
                font-size: 11px;
                line-height: 1.4;
                white-space: normal;
                text-align: center;
                margin-top: 47px;
                padding: 0 20px;
                position: relative;
                z-index: 998;
                display: block;
            }
            
            .message-content {
                max-width: 90%;
                font-size: 13px;
            }
            
            .chat-messages {
                padding: 8px;
                padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)) !important; /* chat-inputの高さを考慮（padding 8px + input-group約60px + 余裕12px） */
                flex: 1 !important; /* flexレイアウトで適切にサイズ調整 */
                overflow-y: auto;
                min-height: 0 !important; /* flexレイアウトで適切に縮小 */
            }
            
            /* ボタンエリアの改善 */
            .button-group {
                display: flex;
                flex-direction: row;
                gap: 4px;
                margin-bottom: 5px;
                flex-wrap: wrap !important;
                width: 100%;
                max-width: 100%;
                overflow-x: auto !important;
            }
            
            .button-group button {
                flex: 1 !important;
                font-size: 11px !important;
                padding: 6px 10px !important;
                border-radius: 8px !important;
                margin-left: 0 !important;
                min-height: 32px !important;
                min-width: calc(50% - 4px) !important;
                display: flex !important;
                align-items: center !important;
                justify-content: center !important;
                gap: 3px !important;
                position: relative !important;
                white-space: nowrap !important;
                line-height: 1 !important;
                text-align: center !important;
                margin: 0 !important;
            }
            
            .button-group button::before {
                content: none !important;
            }
            
            /* チャット入力エリアの改善 */
            .chat-input {
                padding: 8px calc(5vw + env(safe-area-inset-left)) calc(8px + env(safe-area-inset-bottom)) calc(5vw + env(safe-area-inset-right)) !important;
                display: flex !important;
                flex-direction: column !important;
                gap: 8px !important;
                position: sticky !important; /* fixedからstickyに変更してflexレイアウト内に配置 */
                bottom: 0 !important;
                width: 100% !important;
                max-width: 100% !important;
                z-index: 999 !important;
                visibility: visible !important;
                opacity: 1 !important;
                background: white !important;
                flex-shrink: 0 !important; /* flexレイアウトで縮小しないように */
                margin: 0 !important;
                box-sizing: border-box !important;
            }
            
            .input-group {
                display: flex !important;
                align-items: center;
                gap: 6px;
                width: 100%;
                margin: 0;
                padding: 0;
            }
            
            .mic-btn {
                width: 35px !important;
                height: 35px !important;
                font-size: 14px;
                flex-shrink: 0;
            }
            
            #messageInput {
                flex: 1;
                font-size: 14px;
                padding: 10px 12px;
                min-height: 35px;
                max-height: 80px;
            }
            
            .chat-input button[type="submit"] {
                padding: 10px 16px;
                font-size: 14px;
                border-radius: 18px;
                flex-shrink: 0;
            }
        }
        
        /* 横向き（ランドスケープ）モード対応 */
        @media (max-height: 500px) and (orientation: landscape) {
            .chat-header {
                padding: 10px 10px 6px;
            }
            
            .chat-header h1 {
                font-size: 14px;
            }
            
            .chat-input {
                padding: 8px;
            }
        }
        
        /* スピナーアニメーション */
        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }
        
        /* 処理中メッセージのスタイル */
        .processing-message {
            animation: fadeIn 0.3s ease-in;
        }
        
        .processing-message .message-content {
            border-left: 4px solid #1976d2;
        }
        
        /* 無効化された送信ボタンのスタイル */
        button[type="submit"]:disabled {
            opacity: 0.6;
            cursor: not-allowed !important;
            background: #6c757d !important;
        }
        
        /* 無効化された入力フィールドのスタイル */
        #messageInput:disabled {
            background-color: #f8f9fa;
            cursor: not-allowed;
            opacity: 0.7;
        }
        
        /* スピナーのスタイル */
        .spinner {
            display: inline-block;
            width: 20px;
            height: 20px;
            border: 2px solid #f3f3f3;
            border-top: 2px solid #1976d2;
            border-radius: 50%;
            animation: spin 1s linear infinite;
        }
        
        /* 情報ボタンスタイル */
        .info-selector {
            position: absolute;
            top: 10px;
            right: 10px;
            z-index: 1000;
        }

        .info-toggle {
            background: rgba(255, 255, 255, 0.2);
            border: 2px solid rgba(255, 255, 255, 0.3);
            color: white;
            padding: 8px 12px;
            border-radius: 50%;
            cursor: pointer;
            font-size: 16px;
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
        }

        .info-toggle:hover {
            background: rgba(255, 255, 255, 0.3);
            border-color: rgba(255, 255, 255, 0.5);
            transform: scale(1.1);
        }

        /* モーダルスタイル */
        .modal {
            display: none;
            position: fixed;
            z-index: 2000;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0,0,0,0.5);
            backdrop-filter: blur(5px);
        }

        .modal-content {
            background-color: #fefefe;
            margin: 5% auto;
            padding: 0;
            border: none;
            border-radius: 15px;
            width: 90%;
            max-width: 800px;
            max-height: 80vh;
            overflow: hidden;
            box-shadow: 0 10px 30px rgba(0,0,0,0.3);
            animation: modalSlideIn 0.3s ease-out;
        }

        @keyframes modalSlideIn {
            from {
                opacity: 0;
                transform: translateY(-50px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .modal-header {
            background: linear-gradient(135deg, #4CAF50, #45a049);
            color: white;
            padding: 20px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .modal-title {
            margin: 0;
            font-size: 20px;
            font-weight: bold;
        }

        .modal-close {
            color: white;
            font-size: 28px;
            font-weight: bold;
            cursor: pointer;
            background: none;
            border: none;
            padding: 0;
            width: 30px;
            height: 30px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            transition: background-color 0.3s;
        }

        .modal-close:hover {
            background-color: rgba(255, 255, 255, 0.2);
        }

        .modal-body {
            padding: 30px;
            max-height: 60vh;
            overflow-y: auto;
            line-height: 1.6;
        }

        .modal-nav {
            background: #f8f9fa;
            padding: 15px 20px;
            border-bottom: 1px solid #dee2e6;
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
        }

        .nav-button {
            background: #6c757d;
            color: white;
            border: none;
            padding: 8px 16px;
            border-radius: 20px;
            cursor: pointer;
            font-size: 14px;
            transition: all 0.3s ease;
        }

        .nav-button:hover {
            background: #5a6268;
            transform: translateY(-1px);
        }

        .nav-button.active {
            background: #4CAF50;
        }

        .nav-button.back {
            background: #17a2b8;
        }

        /* コンテンツスタイル */
        .info-section {
            margin-bottom: 30px;
        }

        .info-section h3 {
            color: #4CAF50;
            border-bottom: 2px solid #4CAF50;
            padding-bottom: 10px;
            margin-bottom: 20px;
        }

        .info-section h4 {
            color: #333;
            margin-top: 25px;
            margin-bottom: 15px;
            font-size: 1.2em;
            font-weight: 600;
        }

        .info-section h5 {
            color: #4CAF50;
            margin-top: 20px;
            margin-bottom: 12px;
            font-size: 1.05em;
            font-weight: 600;
            border-left: 3px solid #4CAF50;
            padding-left: 10px;
        }

        .info-section ul {
            margin-left: 20px;
            margin-bottom: 15px;
        }

        .info-section li {
            margin-bottom: 8px;
            line-height: 1.6;
        }

        .info-section p {
            line-height: 1.7;
            margin-bottom: 10px;
        }

        .info-section strong {
            color: #2e7d32;
            font-weight: 600;
        }

        /* 医薬品相談先のURL折り返し対応 */
        .info-section a,
        .contact-info a {
            word-break: break-all;
            word-wrap: break-word;
            overflow-wrap: break-word;
        }
        
        @media (max-width: 768px) {
            .info-section a,
            .contact-info a {
                word-break: break-all;
                word-wrap: break-word;
                overflow-wrap: break-word;
                display: inline-block;
                max-width: 100%;
            }
        }
        
        .contact-info {
            background: #f8f9fa;
            padding: 15px;
            border-radius: 8px;
            border-left: 4px solid #4CAF50;
        }

        .warning-box {
            background: #fff3cd;
            border: 2px solid #ffc107;
            border-left: 5px solid #ff9800;
            border-radius: 8px;
            padding: 20px;
            margin: 20px 0;
            box-shadow: 0 2px 8px rgba(255, 193, 7, 0.2);
        }

        .warning-box h4 {
            color: #f57c00;
            margin-top: 0;
            margin-bottom: 15px;
            font-size: 1.3em;
        }

        .warning-box h5 {
            color: #e65100;
            border-left-color: #ff9800;
            margin-top: 15px;
        }

        .warning-box p {
            color: #856404;
            margin-bottom: 12px;
        }

        .warning-box strong {
            color: #e65100;
        }

        .emergency-box {
            background: #f8d7da;
            border: 1px solid #f5c6cb;
            border-radius: 8px;
            padding: 15px;
            margin: 15px 0;
        }

        /* 危機対応相談先カードのスタイル */
        .crisis-support-card {
            background: linear-gradient(135deg, #e3f2fd, #bbdefb);
            border: 2px solid #2196f3;
            border-radius: 15px;
            padding: 20px;
            margin: 15px 0;
            box-shadow: 0 4px 15px rgba(33, 150, 243, 0.2);
            width: 100%;
            min-height: 200px;
            box-sizing: border-box;
        }

        .crisis-support-title {
            color: #1565c0;
            font-size: 18px;
            font-weight: bold;
            margin-bottom: 10px;
            text-align: center;
        }

        .crisis-support-message {
            color: #1976d2;
            font-size: 16px;
            margin-bottom: 15px;
            text-align: center;
            line-height: 1.5;
        }

        .resource-item {
            background: rgba(255, 255, 255, 0.95);
            border-radius: 10px;
            padding: 15px;
            margin: 10px 0;
            border-left: 4px solid #2196f3;
            width: 100%;
            box-sizing: border-box;
        }

        .resource-name {
            font-weight: bold;
            color: #2c3e50;
            font-size: 16px;
            margin-bottom: 5px;
        }

        .resource-org {
            color: #7f8c8d;
            font-size: 14px;
            margin-bottom: 8px;
        }

        .resource-contact {
            color: #1976d2;
            font-weight: bold;
            font-size: 16px;
            margin: 5px 0;
        }

        .resource-description {
            color: #34495e;
            font-size: 14px;
            margin-top: 5px;
        }

        .emergency-message {
            background: #1976d2;
            color: white;
            padding: 10px;
            border-radius: 8px;
            text-align: center;
            font-weight: bold;
            margin-top: 15px;
        }

        .resource-link {
            color: #1976d2;
            text-decoration: none;
            font-weight: bold;
        }

        .resource-link:hover {
            text-decoration: underline;
        }

        /* 緊急事案応答のスタイル */
        /* 旧デザイン（後方互換性のため残す） */
        .emergency-response {
            background: linear-gradient(135deg, #ffebee, #ffcdd2);
            border: 3px solid #d32f2f;
            border-radius: 15px;
            padding: 20px;
            margin: 15px 0;
            box-shadow: 0 4px 20px rgba(211, 47, 47, 0.3);
            width: 100%;
            box-sizing: border-box;
            animation: pulse 2s ease-in-out infinite;
        }

        @keyframes pulse {
            0%, 100% {
                box-shadow: 0 4px 20px rgba(211, 47, 47, 0.3);
            }
            50% {
                box-shadow: 0 4px 30px rgba(211, 47, 47, 0.6);
            }
        }

        .emergency-title {
            color: #d32f2f;
            font-size: 20px;
            font-weight: bold;
            margin-bottom: 15px;
            text-align: center;
        }

        .emergency-message {
            color: #212529;
            font-size: 16px;
            line-height: 1.6;
        }

        .safety-first {
            background: #ffcdd2;
            color: #c62828;
            padding: 12px;
            border-radius: 8px;
            font-weight: bold;
            text-align: center;
            margin-bottom: 15px;
            font-size: 18px;
        }

        .emergency-section {
            background: rgba(255, 255, 255, 0.95);
            border-radius: 10px;
            padding: 15px;
            margin: 15px 0;
            border-left: 4px solid #d32f2f;
        }

        .emergency-section h5 {
            color: #d32f2f;
            font-size: 18px;
            font-weight: bold;
            margin-bottom: 10px;
        }

        .emergency-section ul {
            margin: 0;
            padding-left: 20px;
        }

        .emergency-section li {
            margin: 8px 0;
            color: #212529;
        }

        .safety-section {
            border-left-color: #ff9800;
        }

        .safety-section h5 {
            color: #ff9800;
        }

        .staff-section {
            border-left-color: #2196f3;
        }

        .staff-section h5 {
            color: #2196f3;
        }

        .police-section {
            border-left-color: #d32f2f;
        }

        .police-section h5 {
            color: #d32f2f;
        }

        /* モダンな緊急事案デザイン（読みやすさ優先、余白半減） */
        .emergency-response-modern {
            background: linear-gradient(135deg, #fff5f5 0%, #ffe5e5 100%);
            border: 3px solid #d32f2f;
            border-radius: 16px;
            padding: 0;
            margin: 10px 0;
            box-shadow: 0 6px 24px rgba(211, 47, 47, 0.4), 0 0 0 1px rgba(211, 47, 47, 0.1);
            width: 100%;
            box-sizing: border-box;
            overflow: hidden;
            animation: emergencyPulse 2s ease-in-out infinite;
        }

        @keyframes emergencyPulse {
            0%, 100% {
                box-shadow: 0 6px 24px rgba(211, 47, 47, 0.4), 0 0 0 1px rgba(211, 47, 47, 0.1);
            }
            50% {
                box-shadow: 0 8px 32px rgba(211, 47, 47, 0.6), 0 0 0 2px rgba(211, 47, 47, 0.2);
            }
        }

        .emergency-header {
            background: linear-gradient(135deg, #d32f2f 0%, #b71c1c 100%);
            color: white;
            padding: 12px 16px;
            text-align: center;
            position: relative;
            overflow: hidden;
            font-size: 20px;
            font-weight: 700;
            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
            letter-spacing: 0.3px;
        }

        .emergency-header::before {
            content: '';
            position: absolute;
            top: -50%;
            left: -50%;
            width: 200%;
            height: 200%;
            background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
            animation: shimmer 3s ease-in-out infinite;
        }

        @keyframes shimmer {
            0%, 100% {
                transform: translate(-50%, -50%) rotate(0deg);
            }
            50% {
                transform: translate(-50%, -50%) rotate(180deg);
            }
        }

        .emergency-alert-banner {
            background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
            color: white;
            padding: 10px 16px;
            text-align: center;
            font-size: 16px;
            font-weight: 600;
            box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
        }

        .emergency-content {
            padding: 12px 16px;
            background: white;
        }

        .emergency-card {
            background: white;
            border-radius: 12px;
            margin-bottom: 12px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
            overflow: hidden;
            transition: transform 0.2s ease, box-shadow 0.2s ease;
            border: 2px solid transparent;
        }

        .emergency-card:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        }

        .card-header {
            padding: 10px 14px;
            display: flex;
            align-items: center;
            gap: 8px;
            font-weight: 600;
        }

        .safety-header {
            background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
            border-bottom: 2px solid #ff9800;
        }

        .staff-header {
            background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
            border-bottom: 2px solid #2196F3;
        }

        .police-header {
            background: linear-gradient(135deg, #fffde7 0%, #fff9c4 100%);
            border-bottom: 2px solid #fbc02d;
        }

        .card-icon {
            font-size: 20px;
            display: inline-block;
        }

        .card-title {
            font-size: 17px;
            font-weight: 700;
            margin: 0;
            color: #212529;
        }

        .safety-header .card-title {
            color: #e65100;
        }

        .staff-header .card-title {
            color: #1565c0;
        }

        .police-header .card-title {
            color: #f57f17;
        }

        .card-body {
            padding: 12px 14px;
        }

        .card-list {
            list-style: none;
            padding: 0;
            margin: 0;
        }

        .card-list li {
            padding: 8px 0;
            color: #424242;
            font-size: 15px;
            line-height: 1.6;
            border-bottom: 1px solid #f5f5f5;
            display: flex;
            align-items: flex-start;
            gap: 8px;
        }

        .card-list li:last-child {
            border-bottom: none;
            padding-bottom: 0;
        }

        .list-marker {
            color: #d32f2f;
            font-weight: bold;
            font-size: 12px;
            margin-top: 3px;
            flex-shrink: 0;
        }

        .safety-card .list-marker {
            color: #ff9800;
        }

        .staff-card .list-marker {
            color: #2196F3;
        }

        .police-card .list-marker {
            color: #fbc02d;
        }

        /* 一覧ページスタイル */
        .list-page {
            padding: 20px;
        }
        
        .list-item {
            background: #f8f9fa;
            border: 1px solid #dee2e6;
            border-radius: 10px;
            padding: 15px 20px;
            margin-bottom: 10px;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }
        
        .list-item:hover {
            background: #e9ecef;
            border-color: #4CAF50;
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(0,0,0,0.1);
        }
        
        .list-item-icon {
            font-size: 24px;
            margin-right: 15px;
        }
        
        .list-item-content {
            flex: 1;
        }
        
        .list-item-title {
            font-size: 16px;
            font-weight: bold;
            color: #333;
            margin: 0 0 5px 0;
        }
        
        .list-item-description {
            font-size: 12px;
            color: #666;
            margin: 0;
        }
        
        .list-item-arrow {
            font-size: 18px;
            color: #4CAF50;
            transition: transform 0.3s ease;
        }
        
        .list-item:hover .list-item-arrow {
            transform: translateX(5px);
        }
        
        /* 詳細ページスタイル */
        .detail-page {
            display: none;
        }
        
        .detail-page.active {
            display: block;
        }
        
        /* 戻るボタン */
        .back-button {
            background: #6c757d;
            color: white;
            border: none;
            padding: 10px 20px;
            border-radius: 20px;
            cursor: pointer;
            font-size: 14px;
            margin-bottom: 20px;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        
        .back-button:hover {
            background: #5a6268;
            transform: translateY(-1px);
        }
        
        /* レスポンシブ対応 */
        @media (max-width: 768px) {
            .modal-content {
                width: 95%;
                margin: 5% auto;
                max-height: 90vh;
            }
            
            .modal-header {
                padding: 15px;
            }
            
            .modal-title {
                font-size: 18px;
            }
            
            .modal-body {
                padding: 15px;
            }
            
            /* フィードバックモーダルのスマホ向け調整 */
            #feedbackModal .modal-content {
                padding: 0; /* パディングを削除 */
                margin: auto; /* 縦方向の余白を最小限に */
            }
            
            #feedbackModal .modal-header {
                padding: 10px 15px; /* パディングを削減 */
            }
            
            #feedbackModal .modal-body {
                padding: 10px 15px; /* パディングを削減 */
            }
            
            #feedbackModal .modal-footer {
                padding: 6px 15px 10px; /* パディングを削減 */
            }
            
            /* 成功モーダルのスマホ向け調整 */
            #successModal .modal-content {
                padding: 12px;
                margin: 8% auto;
                max-width: 90%;
            }
            
            #successModal .modal-header {
                padding: 10px;
                margin-bottom: 8px;
            }
            
            #successModal .modal-body {
                padding: 8px 10px;
            }
            
            .list-page {
                padding: 15px;
            }
            
            .list-item {
                padding: 12px 15px;
                margin-bottom: 8px;
            }
            
            .list-item-title {
                font-size: 15px;
            }
            
            .list-item-description {
                font-size: 11px;
            }
            
            .list-item-icon {
                font-size: 20px;
                margin-right: 12px;
            }
            
            .back-button {
                padding: 8px 16px;
                font-size: 13px;
            }
            
            /* スマホでの言語選択アイコンの位置調整 */
            .language-selector {
                top: 5px;
                left: 5px;
                z-index: 1000;
            }
            
            .lang-toggle {
                padding: 6px 10px;
                font-size: 12px;
                min-width: 50px;
            }
            
            /* titleをlanguage-selectorとinfo-selectorの間に配置 */
            #appTitle {
                margin-top: 0;
                font-size: clamp(14px, calc((100vw - 140px) / 9), 20px);
                position: absolute;
                top: 30px;
                left: 50%;
                transform: translate(-50%, -50%);
                white-space: nowrap;
                z-index: 999;
                max-width: calc(100% - 140px);
                overflow: hidden;
                text-overflow: ellipsis;
                line-height: 1.2;
            }
            
            #appDescription {
                font-size: 11px;
                margin-top: 50px;
                padding: 0 30px;
                text-align: center;
                white-space: normal;
                line-height: 1.4;
                position: relative;
                z-index: 998;
                display: block;
            }
            
            .info-selector {
                top: 10px;
                right: 10px;
            }
        }
        
        @media (max-width: 480px) {
            .modal-content {
                width: 98%;
                margin: 2% auto;
                max-height: 95vh;
            }
            
            /* フィードバックモーダルの小さなスマホ向け調整 */
            #feedbackModal .modal-content {
                padding: 0; /* パディングを削除 */
                margin: auto; /* 縦方向の余白を最小限に */
            }
            
            #feedbackModal .modal-header {
                padding: 8px 12px; /* パディングを削減 */
            }
            
            #feedbackModal .modal-header .modal-title {
                font-size: 16px;
            }
            
            #feedbackModal .modal-body {
                padding: 8px 12px; /* パディングを削減 */
            }
            
            #feedbackModal .modal-body p {
                margin: 0 0 6px 0; /* マージンを削減 */
                font-size: 13px;
            }
            
            #feedbackModal .modal-body textarea {
                min-height: 70px;
                max-height: 120px;
                padding: 10px;
            }
            
            #feedbackModal .modal-footer {
                padding: 6px 12px 8px; /* パディングを削減 */
                flex-wrap: wrap;
                gap: 6px;
            }
            
            #feedbackModal .modal-btn {
                padding: 6px 12px;
                font-size: 12px;
                flex: 1;
                min-width: calc(50% - 3px);
            }
            
            /* 成功モーダルの小さなスマホ向け調整 */
            #successModal .modal-content {
                padding: 10px;
                margin: 5% auto;
                max-width: 95%;
            }
            
            #successModal .modal-header {
                padding: 8px;
                margin-bottom: 6px;
            }
            
            #successModal .modal-body {
                padding: 6px 8px;
            }
            
            #successModal .modal-body p {
                font-size: 13px;
            }
            
            .list-item {
                padding: 10px 12px;
                margin-bottom: 6px;
            }
            
            .list-item-title {
                font-size: 14px;
            }
            
            .list-item-description {
                font-size: 10px;
            }
            
            /* より小さなスマホでの調整 */
            .language-selector {
                top: 3px;
                left: 3px;
            }
            
            .lang-toggle {
                padding: 5px 8px;
                font-size: 11px;
                min-width: 45px;
            }
            
            #appTitle {
                margin-top: 0;
                font-size: clamp(11px, calc((100vw - 113px) / 11), 16px);
                position: absolute;
                top: 23px;
                left: 50%;
                transform: translate(-50%, -50%);
                white-space: nowrap;
                z-index: 999;
                max-width: calc(100% - 113px);
                overflow: hidden;
                text-overflow: ellipsis;
                line-height: 1.2;
            }
            
            #appDescription {
                font-size: 11px;
                margin-top: 42px;
                padding: 0 20px;
                text-align: center;
                white-space: normal;
                line-height: 1.4;
                position: relative;
                z-index: 998;
                display: block;
            }
            
            .info-selector {
                top: 3px;
                right: 3px;
            }
        }

        /* ===== 入力モーダルの可読性改善（左右余白の拡大） ===== */
        #userInfoModal .modal-content,
        #attributeModal .modal-content {
            padding: 0 0 24px 0; /* ヘッダーをモーダル幅いっぱいに、上下のみ余白 */
            max-height: 80vh; /* 高さ制限を設定して下部余白を抑制 */
            overflow-y: auto; /* 内容が多い場合はスクロール可能 */
        }

        /* コンテンツ本体に内側余白を付与（ヘッダーは余白なしでフル幅） */
        #userInfoModal form,
        #attributeModal form {
            padding: 24px 28px;
        }

        /* 入力要素の内側余白と角丸を強化 */
        #userInfoModal .form-group input,
        #userInfoModal .form-group select,
        #userInfoModal .form-group textarea,
        #attributeModal .form-group input,
        #attributeModal .form-group select,
        #attributeModal .form-group textarea {
            padding-left: 16px;
            padding-right: 16px;
            border-radius: 10px;
        }

        /* モーダルヘッダーの緑色背景を大きく（アプリ概要モーダルと同様のスタイル） */
        #userInfoModal .modal-header,
        #attributeModal .modal-header {
            background: linear-gradient(135deg, #4CAF50, #45a049);
            color: white;
            padding: 20px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin: 0; /* デフォルトのmarginをリセット */
            border-radius: 15px 15px 0 0; /* 上部の角丸を維持 */
            /* スクロールバーによる角の角ばりを防ぐ */
            position: relative;
            z-index: 1;
        }

        #userInfoModal .modal-header h3,
        #attributeModal .modal-header h3 {
            margin: 0;
            font-size: 20px; /* アプリ概要モーダルと同じサイズ */
            font-weight: bold; /* アプリ概要モーダルと同じウェイト */
        }

        /* モバイル時の余白最適化（はみ出し防止） */
        @media (max-width: 480px) {
            #userInfoModal .modal-content,
            #attributeModal .modal-content {
                width: 95%;
                padding: 14px 16px; /* 端末幅が狭いときは少し控えめに */
                max-height: 85vh; /* モバイルでは少し高めに設定 */
            }
            
            #userInfoModal .modal-header,
            #attributeModal .modal-header {
                padding: 15px; /* モバイルでは少し控えめに */
            }
        }

/* =============================== */
/* Onboarding Overlay Styles       */
/* =============================== */

.hidden {
    display: none !important;
}

body.onboarding-open {
    overflow: hidden;
}

.onboarding-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.5);
    z-index: 11000;
    padding: 20px;
    overflow-y: auto;
    pointer-events: none; /* オーバーレイ自体はクリックを透過 */
    box-sizing: border-box;
}

/* オーバーレイ内のコンテナはクリック可能に */
.onboarding-container {
    pointer-events: auto;
    position: fixed !important;
    z-index: 11020 !important;
    isolation: isolate !important;
}

/* ステップ1（症状入力画面）では入力エリアの部分を透過 */
.onboarding-overlay[data-step="1"] {
    background: 
        radial-gradient(
            ellipse 600px 140px at 50% calc(100% - 85px),
            transparent 0%,
            transparent 42%,
            rgba(255, 255, 255, 0.15) 47%,
            rgba(255, 255, 255, 0.5) 63%
        );
}

/* ステップ0では言語選択ボタンは操作可能 */
body.onboarding-open[data-onboarding-step="0"] .language-selector,
body.onboarding-open[data-onboarding-step="0"] .lang-toggle {
    pointer-events: auto !important;
    opacity: 1 !important;
    cursor: pointer !important;
}

/* ステップ1では入力エリアと関連ボタンは操作可能 */
body.onboarding-open[data-onboarding-step="1"] .input-group,
body.onboarding-open[data-onboarding-step="1"] #micBtn,
body.onboarding-open[data-onboarding-step="1"] #messageInput,
body.onboarding-open[data-onboarding-step="1"] #chatForm button[type="submit"],
body.onboarding-open[data-onboarding-step="1"] #chatForm {
    pointer-events: auto !important;
    opacity: 1 !important;
    cursor: pointer !important;
}

body.onboarding-open[data-onboarding-step="1"] #messageInput {
    cursor: text !important;
}

/* オンボーディング中の要素強調 */
.onboarding-highlight {
    position: relative;
    z-index: 11002 !important;
    box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.5), 
                0 0 20px 8px rgba(76, 175, 80, 0.3),
                0 4px 12px rgba(0, 0, 0, 0.15) !important;
    border-radius: 8px !important;
    animation: onboardingPulse 2s ease-in-out infinite;
    transition: box-shadow 0.3s ease, transform 0.2s ease;
}

.onboarding-highlight:hover {
    transform: scale(1.02);
    box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.7), 
                0 0 24px 10px rgba(76, 175, 80, 0.4),
                0 6px 16px rgba(0, 0, 0, 0.2) !important;
}

@keyframes onboardingPulse {
    0%, 100% {
        box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.5), 
                    0 0 20px 8px rgba(76, 175, 80, 0.3),
                    0 4px 12px rgba(0, 0, 0, 0.15);
    }
    50% {
        box-shadow: 0 0 0 5px rgba(76, 175, 80, 0.6), 
                    0 0 24px 10px rgba(76, 175, 80, 0.4),
                    0 6px 16px rgba(0, 0, 0, 0.2);
    }
}

/* ℹ️ボタンの強調を他のボタンと同様にする */
.info-selector .onboarding-highlight,
.info-toggle.onboarding-highlight {
    box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.5), 
                0 0 20px 8px rgba(76, 175, 80, 0.3),
                0 4px 12px rgba(0, 0, 0, 0.15) !important;
    border-radius: 50% !important;
    animation: onboardingPulse 2s ease-in-out infinite;
    transition: box-shadow 0.3s ease, transform 0.2s ease;
}

.info-selector .onboarding-highlight:hover,
.info-toggle.onboarding-highlight:hover {
    transform: scale(1.15);
    box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.7), 
                0 0 24px 10px rgba(76, 175, 80, 0.4),
                0 6px 16px rgba(0, 0, 0, 0.2) !important;
}

/* 言語選択ボタンの強調を他のボタンと同様にする */
.language-selector .onboarding-highlight,
.lang-toggle.onboarding-highlight {
    box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.5), 
                0 0 20px 8px rgba(76, 175, 80, 0.3),
                0 4px 12px rgba(0, 0, 0, 0.15) !important;
    border-radius: 20px !important;
    animation: onboardingPulse 2s ease-in-out infinite;
    transition: box-shadow 0.3s ease, transform 0.2s ease;
}

.language-selector .onboarding-highlight:hover,
.lang-toggle.onboarding-highlight:hover {
    transform: scale(1.05);
    box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.7), 
                0 0 24px 10px rgba(76, 175, 80, 0.4),
                0 6px 16px rgba(0, 0, 0, 0.2) !important;
}

/* オンボーディング時にinfo-selectorのz-indexを上げる（位置は維持） */
body.onboarding-open .info-selector {
    z-index: 11002 !important;
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
}

/* オンボーディング時にinfo-selectorが強調対象の場合 */
.info-selector.onboarding-highlight-parent {
    z-index: 11002 !important;
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
}

.info-selector.onboarding-highlight-parent .info-toggle.onboarding-highlight {
    position: relative;
    z-index: 11003 !important;
}

/* オンボーディング時にlanguage-selectorのz-indexを上げる（位置は維持） */
body.onboarding-open .language-selector {
    z-index: 11002 !important;
    position: absolute !important;
    top: 10px !important;
    left: 10px !important;
}

/* オンボーディング時にlanguage-selectorが強調対象の場合 */
.language-selector.onboarding-highlight-parent {
    z-index: 11002 !important;
    position: absolute !important;
    top: 10px !important;
    left: 10px !important;
}

.language-selector.onboarding-highlight-parent .lang-toggle.onboarding-highlight {
    position: relative;
    z-index: 11003 !important;
}

.onboarding-container {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    max-width: 480px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: fadeInUp 0.4s ease;
    position: fixed !important;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) translateZ(0) !important;
    z-index: 11020 !important;
    isolation: isolate !important;
    will-change: transform;
    box-sizing: border-box;
    margin: 0;
    display: flex;
    flex-direction: column;
}

.onboarding-visual {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.onboarding-title {
    font-size: 1.6rem;
    margin: 0 0 0.5rem;
    color: #2c3e50;
}

.onboarding-subtitle {
    font-size: 1rem;
    color: #4f6b95;
    margin: 0 0 1rem;
}

.onboarding-desc {
    text-align: left;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.onboarding-desc p {
    margin: 0 0 0.75rem;
    color: #424242;
    line-height: 1.6;
}

.onboarding-desc ul {
    margin: 0 0 1rem 1.25rem;
    padding: 0;
    color: #424242;
    line-height: 1.6;
}

.onboarding-slide {
    display: none;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    position: relative;
    z-index: 1;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.onboarding-slide.active {
    display: flex;
    flex-direction: column;
    opacity: 1;
    transform: translateX(0);
}

.onboarding-btn {
    background: #4CAF50;
    color: #ffffff;
    border: none;
    padding: 0.75rem 1.6rem;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 1rem;
    transition: background 0.2s ease, transform 0.2s ease;
}

.onboarding-btn:hover,
.onboarding-btn:focus {
    background: #43a047;
    transform: translateY(-1px);
}

.onboarding-btn:focus-visible,
.onboarding-skip:focus-visible,
.slide-indicator button:focus-visible {
    outline: 2px solid #2196F3;
    outline-offset: 2px;
}

.onboarding-btn:disabled {
    background: #9e9e9e;
    cursor: not-allowed;
    transform: none;
}

.onboarding-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1rem 0;
}

.onboarding-link-btn {
    display: inline-block;
    background: #2196F3;
    color: #ffffff;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    text-align: center;
    box-shadow: 0 2px 4px rgba(33, 150, 243, 0.2);
}

.onboarding-link-btn:hover,
.onboarding-link-btn:focus {
    background: #1976D2;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(33, 150, 243, 0.3);
}

.onboarding-link-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(33, 150, 243, 0.2);
}

.onboarding-link-btn:focus-visible {
    outline: 2px solid #2196F3;
    outline-offset: 2px;
}

@media (max-width: 768px) {
    .onboarding-link-btn {
        padding: 0.7rem 1.2rem;
        font-size: 0.9rem;
    }
}

.onboarding-btn-primary {
    width: 100%;
}

.onboarding-skip {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    color: #4f6b95;
    border: none;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: underline;
    padding: 0.25rem 0.5rem;
    z-index: 11021;
}

.onboarding-skip:hover,
.onboarding-skip:focus {
    color: #388e3c;
}

.slide-indicator {
    margin-top: 1.5rem;
    text-align: center;
}

.slide-indicator button {
    background: none;
    border: none;
    font-size: 1.2rem;
    margin: 0 4px;
    color: #bdbdbd;
    cursor: pointer;
}

.slide-indicator button.active,
.slide-indicator button[aria-current="step"] {
    color: #4CAF50;
    cursor: default;
}

.onboarding-details {
    margin: 1rem 0;
    text-align: left;
}

.onboarding-details summary {
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}

.onboarding-details summary::-webkit-details-marker {
    display: none;
}

.onboarding-details summary::before {
    content: '▸';
    display: inline-block;
    margin-right: 0.5rem;
    transition: transform 0.2s ease;
    color: #4CAF50;
}

.onboarding-details[open] summary::before {
    transform: rotate(90deg);
}

.onboarding-details ul {
    margin: 0.75rem 0 0 1.25rem;
}

.onboarding-details-content {
    margin-top: 0.75rem;
    max-height: min(280px, 40vh);
    overflow-y: auto;
    padding-right: 0.5rem;
    font-size: 0.95rem;
    line-height: 1.6;
    /* スクロールバーのスタイリング */
    scrollbar-width: thin;
    scrollbar-color: #4CAF50 #f0f0f0;
}

.onboarding-details-content::-webkit-scrollbar {
    width: 6px;
}

.onboarding-details-content::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 3px;
}

.onboarding-details-content::-webkit-scrollbar-thumb {
    background: #4CAF50;
    border-radius: 3px;
}

.onboarding-details-content::-webkit-scrollbar-thumb:hover {
    background: #43a047;
}

.onboarding-details-content .info-section {
    margin-bottom: 1.5rem;
}

.onboarding-details-content ul,
.onboarding-details-content ol {
    margin-left: 1.25rem;
}

.onboarding-agree {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    color: #424242;
    margin-top: 1rem;
}

.onboarding-agree input {
    width: 1rem;
    height: 1rem;
    accent-color: #4CAF50;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate(-50%, calc(-50% + 12px)) translateZ(0);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) translateZ(0);
    }
}

@media (max-width: 768px) {
    .onboarding-overlay {
        padding: 10px;
    }

    .onboarding-container {
        padding: 1.5rem;
        max-width: calc(100% - 20px);
        width: calc(100% - 20px);
        max-height: 85vh;
        margin: 0;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%) translateZ(0);
    }
    
    .onboarding-details-content {
        max-height: min(200px, 35vh);
    }

    .onboarding-title {
        font-size: 1.4rem;
    }

    .onboarding-btn {
        width: 100%;
    }

    .onboarding-skip {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .onboarding-overlay {
        padding: 8px;
    }

    .onboarding-container {
        padding: 1.25rem;
        max-width: calc(100% - 16px);
        width: calc(100% - 16px);
        max-height: 80vh;
        margin: 0;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%) translateZ(0);
    }
    
    .onboarding-details-content {
        max-height: min(180px, 30vh);
    }

    .onboarding-title {
        font-size: 1.25rem;
    }

    .onboarding-visual {
        font-size: 2.5rem;
    }
}