* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --vh: 100vh;
}

html {
    font-size: 13px;
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: 'Segoe UI', 'Hiragino Sans', 'Meiryo', sans-serif;
    background: #ffffff;
    color: #1a1a1a;
    height: var(--vh, 100vh);
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
    overscroll-behavior: none;
}

.app {
    display: flex;
    flex-direction: column;
    height: var(--vh, 100vh);
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    overflow: hidden;
}

/* --- サイドメニュー --- */

.menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 900;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.menu-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.side-menu {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    max-width: 75vw;
    background: #f8f9fa;
    border-right: 1px solid #dee2e6;
    z-index: 950;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}
.side-menu.open {
    transform: translateX(0);
}

.side-menu-header {
    padding: 14px 16px;
    font-size: 1rem;
    font-weight: bold;
    color: #2563eb;
    border-bottom: 1px solid #dee2e6;
    flex-shrink: 0;
}

.menu-jump-bottom {
    display: block;
    width: calc(100% - 24px);
    margin: 8px 12px;
    padding: 7px;
    background: #e8f0fe;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    font-size: 0.92rem;
    cursor: pointer;
    text-align: center;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: background 0.15s;
}
.menu-jump-bottom:hover {
    background: #dbeafe;
}
.menu-jump-bottom:active {
    background: #bfdbfe;
}

/* スクリーニング条件フォーム */
.screening-params {
    display: flex;
    gap: 6px;
    padding: 2px 12px 6px;
    align-items: center;
    flex-wrap: wrap;
}
.screening-params label {
    font-size: 0.73rem;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 2px;
    white-space: nowrap;
}
.screening-param-input {
    width: 44px;
    padding: 2px 3px;
    border: 1px solid #d1d5db;
    border-radius: 3px;
    font-size: 0.73rem;
    text-align: right;
}

.screening-btn-row {
    display: flex;
    gap: 6px;
    margin: 0 12px 8px;
    align-items: stretch;
}

.menu-screening-btn {
    flex: 1;
    display: block;
    padding: 7px;
    background: #ffffff;
    color: #2563eb;
    border: 1px solid #2563eb;
    border-radius: 6px;
    font-size: 0.92rem;
    cursor: pointer;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: background 0.15s;
}
.menu-screening-btn:hover {
    background: #e8f0fe;
}
.menu-screening-btn:active {
    background: #dbeafe;
}
.menu-screening-btn:disabled {
    color: #9ca3af;
    border-color: #d1d5db;
    cursor: not-allowed;
}

.screening-reset-btn {
    flex-shrink: 0;
    padding: 7px 10px;
    background: #ffffff;
    color: #6b7280;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: background 0.15s;
}
.screening-reset-btn:hover {
    background: #f3f4f6;
    color: #374151;
}
.screening-reset-btn:active {
    background: #e5e7eb;
}

.side-menu-list {
    list-style: none;
    overflow-y: auto;
    padding: 4px 0;
    max-height: 40vh;
}

.side-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 16px;
    cursor: pointer;
    transition: background 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.side-menu-item:hover {
    background: #e9ecef;
}
.side-menu-item:active {
    background: #dbeafe;
}

.menu-stock-name {
    font-size: 1rem;
    color: #1a1a1a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 10px;
    flex: 1;
    min-width: 0;
}

.menu-stock-code {
    font-size: 0.85rem;
    color: #2563eb;
    background: #e8f0fe;
    border: 1px solid #bfdbfe;
    border-radius: 4px;
    padding: 1px 6px;
    flex-shrink: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: background 0.15s, border-color 0.15s;
}
.menu-stock-code:hover {
    background: #dbeafe;
    border-color: #93c5fd;
}
.menu-stock-code:active {
    background: #bfdbfe;
}

.fav-remove-btn {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: #9ca3af;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    margin-left: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: background 0.15s, color 0.15s;
}
.fav-remove-btn:hover {
    background: #fee2e2;
    color: #dc2626;
}
.fav-remove-btn:active {
    background: #fecaca;
}

.menu-fav-star {
    font-size: 0.7rem;
    color: #f59e0b;
    flex-shrink: 0;
    margin-right: 4px;
    line-height: 1;
}

/* サイドメニューセクション */
.side-menu-section {
    border-bottom: 1px solid #e5e7eb;
}

.side-menu-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    font-size: 0.92rem;
    font-weight: bold;
    color: #374151;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s;
}
.side-menu-section-header:hover {
    background: #e9ecef;
}

.section-toggle-icon {
    font-size: 0.7rem;
    color: #9ca3af;
}

.side-menu-empty {
    padding: 16px;
    color: #999;
    font-size: 0.92rem;
    text-align: center;
}

/* ハンバーガーボタン（左・右共通ベース） */
.menu-btn,
.right-menu-btn {
    position: absolute;
    top: 10px;
    width: 30px;
    height: 30px;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 4px;
    z-index: 10;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.menu-btn {
    left: 12px;
}
.right-menu-btn {
    right: 12px;
}
.menu-btn span,
.right-menu-btn span {
    display: block;
    width: 18px;
    height: 2px;
    background: #6b7280;
    border-radius: 1px;
    transition: background 0.2s;
}
.menu-btn:hover span,
.right-menu-btn:hover span {
    background: #2563eb;
}

.header {
    padding: 12px 46px 12px 46px;
    border-bottom: 1px solid #e5e7eb;
    background: #f8f9fa;
    position: relative;
    flex-shrink: 0;
}

/* --- 右サイドメニュー --- */

.right-side-menu {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 260px;
    max-width: 75vw;
    background: #f8f9fa;
    border-left: 1px solid #dee2e6;
    z-index: 950;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}
.right-side-menu.open {
    transform: translateX(0);
}

.right-menu-commands {
    padding: 8px 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.88rem;
    color: #374151;
    line-height: 1.6;
}
.right-menu-commands code {
    background: #e8f0fe;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 0.85em;
    color: #1d4ed8;
}

.group-history-item {
    flex-direction: row;
    align-items: center;
    gap: 0;
    padding: 9px 16px;
}
.group-history-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    gap: 2px;
}
.group-history-names {
    font-size: 0.92rem;
    color: #1a1a1a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.group-history-codes {
    font-size: 0.78rem;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header h1 {
    font-size: 1.23rem;
    color: #1d4ed8;
}

/* レポートハイライト（メニューからのジャンプ時） */
.message.highlight .message-content {
    box-shadow: 0 0 0 2px #3b82f688;
    transition: box-shadow 0.3s ease;
}

.subtitle {
    font-size: 0.85rem;
    color: #999;
    margin-top: 2px;
}

.vix-bar {
    font-size: 0.8rem;
    color: #374151;
    margin-top: 3px;
    clear: both;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 3px;
}
.vix-row {
    display: flex;
    align-items: baseline;
    gap: 3px;
}
@media (max-width: 640px) {
    .vix-bar {
        flex-direction: column;
        gap: 2px;
    }
    .vix-row {
        flex-wrap: wrap;
        row-gap: 2px;
    }
    .market-sep-group {
        display: none;
    }
}
.vix-label {
    color: #6b7280;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.vix-value {
    font-weight: 700;
    color: #111827;
}
.vix-value.danger {
    color: #dc2626;
}
.vix-value.caution {
    color: #ea580c;
}
.vix-value.safe {
    color: #2563eb;
}
.edinet-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.2em;
    height: 1.2em;
    background: #dc2626;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 50%;
    vertical-align: middle;
    margin-right: 0.2em;
    cursor: default;
}
.vix-change {
    font-size: 0.77rem;
}
.vix-change.up {
    color: #dc2626;
}
.vix-change.down {
    color: #16a34a;
}
.vix-change.flat {
    color: #6b7280;
}
.market-sep {
    color: #d1d5db;
    margin: 0 6px;
    font-weight: 300;
}
.vix-change.vol-up {
    color: #dc2626;
}
.vix-change.vol-down {
    color: #2563eb;
}
.vix-change.vol-normal {
    color: inherit;
}
.mkt-copy-btn {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 3px;
    color: #9ca3af;
    display: flex;
    align-items: center;
    border-radius: 3px;
    transition: color 0.15s;
    flex-shrink: 0;
}
.mkt-copy-btn:hover {
    color: #374151;
}
.mkt-copy-btn svg {
    width: 13px;
    height: 13px;
}
.mkt-copy-btn.copied {
    color: #16a34a;
}

.connection-status {
    float: right;
    font-size: 0.77rem;
    padding: 1px 6px;
    border-radius: 10px;
    margin-top: -18px;
}
.connection-status.connected {
    background: #d1fae5;
    color: #047857;
}
.connection-status.disconnected {
    background: #fef3c7;
    color: #b45309;
}

/* 進捗バー */
.progress-bar-container {
    padding: 6px 14px;
    background: #f8f9fa;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}
.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 3px;
    color: #2563eb;
}
.progress-track {
    height: 5px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.chat-container {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    padding: 12px;
    scroll-behavior: smooth;
    background: #ffffff;
}

.message {
    margin-bottom: 12px;
    animation: fadeIn 0.3s ease;
}

.message-time {
    font-size: 0.72rem;
    color: #9ca3af;
    margin-top: 3px;
    clear: both;
}
.message.user .message-time {
    text-align: right;
}
.message.assistant .message-time,
.message.system .message-time {
    text-align: left;
    padding-left: 2px;
}

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

.message.user .message-content {
    background: #1d4ed8;
    color: #ffffff;
    border-radius: 10px 10px 3px 10px;
    padding: 7px 12px;
    display: inline-block;
    max-width: 80%;
    float: right;
    clear: both;
}

.message.assistant .message-content {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 10px 10px 10px 3px;
    padding: 12px 14px;
    max-width: 100%;
    line-height: 1.6;
    clear: both;
    word-break: break-word;
    overflow-wrap: break-word;
}

.message.system .message-content {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.92rem;
    color: #6b7280;
}

.message-content h2 {
    color: #1d4ed8;
    font-size: 1.08rem;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid #e5e7eb;
}

.message-content h3 {
    color: #2563eb;
    font-size: 1rem;
    margin-top: 12px;
    margin-bottom: 4px;
}

.message-content strong {
    color: #1e40af;
}

.message-content ul, .message-content ol {
    margin-left: 16px;
    margin-bottom: 6px;
}

.message-content li {
    margin-bottom: 2px;
}

.message-content code {
    background: #e8f0fe;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 0.92em;
    color: #7c3aed;
}

.message-content hr {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 8px 0;
}

/* テーブル（Markdownレポート内） */
.message-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
    table-layout: fixed;
    word-break: break-all;
}
.message-content th,
.message-content td {
    padding: 3px 5px;
    border: 1px solid #e5e7eb;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
}

.loading-dots span {
    animation: blink 1.4s infinite both;
}
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes blink {
    0%, 80%, 100% { opacity: 0; }
    40% { opacity: 1; }
}

.input-area {
    padding: 10px 12px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid #e5e7eb;
    background: #f8f9fa;
    flex-shrink: 0;
}

/* モデルセレクタ */
.model-selector {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    font-size: 0.85rem;
    color: #6b7280;
}

.model-selector label {
    flex-shrink: 0;
}

.model-selector select {
    flex: 1;
    min-width: 0;
    padding: 3px 6px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #ffffff;
    color: #1a1a1a;
    font-size: 0.85rem;
    font-family: inherit;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
}

.model-selector select:focus {
    border-color: #3b82f6;
}

.input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 6px;
}

#userInput {
    flex: 1;
    min-width: 0;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #ffffff;
    color: #1a1a1a;
    font-size: 1rem;
    font-family: inherit;
    line-height: 1.5;
    outline: none;
    transition: border-color 0.2s;
    resize: none;
    overflow-y: hidden;
    max-height: 150px;
}

#clearBtn {
    display: none;
    width: 32px;
    height: 32px;
    border: 1px solid #d1d5db;
    border-radius: 50%;
    background: #ffffff;
    color: #6b7280;
    font-size: 1.1rem;
    cursor: pointer;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}
#clearBtn.visible {
    display: flex;
}
#clearBtn:hover {
    background: #e8f0fe;
    border-color: #bfdbfe;
    color: #2563eb;
}
#clearBtn:active {
    background: #dbeafe;
}

#userInput:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px #3b82f622;
}

#fetchBtn {
    padding: 8px 12px;
    border: 1px solid #2563eb;
    border-radius: 8px;
    background: #ffffff;
    color: #2563eb;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
    white-space: nowrap;
}

#fetchBtn:hover {
    background: #e8f0fe;
}

#fetchBtn:disabled {
    background: #f3f4f6;
    color: #9ca3af;
    border-color: #d1d5db;
    cursor: not-allowed;
}

#sendBtn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    background: #2563eb;
    color: white;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
    white-space: nowrap;
}

#sendBtn:hover {
    background: #1d4ed8;
}

#sendBtn:disabled {
    background: #d1d5db;
    color: #9ca3af;
    cursor: not-allowed;
}

/* ユーザーメッセージ コピーエリア */
.user-copy-wrapper {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    justify-content: flex-end;
}
.user-copy-btn {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.8rem;
    font-family: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: background 0.2s, border-color 0.2s;
}
.user-copy-btn:hover {
    background: rgba(255, 255, 255, 0.28);
    border-color: rgba(255, 255, 255, 0.65);
}
.user-copy-btn:active {
    background: rgba(255, 255, 255, 0.38);
}
.user-copy-btn.copied {
    background: rgba(187, 247, 208, 0.25);
    border-color: rgba(187, 247, 208, 0.5);
    color: #bbf7d0;
}

/* レポートコピーボタン */
.message-content {
    cursor: default;
    -webkit-user-select: text;
    user-select: text;
}

.report-copy-wrapper {
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
}

/* お気に入りスターボタン */
.fav-star-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #ffffff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: background 0.2s, border-color 0.2s, transform 0.15s;
    padding: 0;
    flex-shrink: 0;
}
.fav-star-btn::before {
    content: '\2606';
    font-size: 1.2rem;
    color: #9ca3af;
    line-height: 1;
}
.fav-star-btn.active::before {
    content: '\2605';
    color: #f59e0b;
}
.fav-star-btn:hover {
    background: #fef9c3;
    border-color: #f59e0b;
}
.fav-star-btn:active {
    transform: scale(0.92);
}

/* グループ結果：銘柄見出しとお気に入りボタンを横並び */
.group-stock-h2 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.group-stock-h2 > span {
    flex: 1;
    min-width: 0;
}


.report-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #e8f0fe;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    padding: 5px 12px;
    font-size: 0.92rem;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: background 0.2s, border-color 0.2s;
}
.report-copy-btn:hover {
    background: #dbeafe;
    border-color: #93c5fd;
}
.report-copy-btn:active {
    background: #bfdbfe;
    transform: scale(0.97);
}
.report-copy-btn.copied {
    background: #d1fae5;
    border-color: #6ee7b7;
    color: #047857;
}
.report-copy-btn-detail {
    background: #ecfdf5;
    color: #047857;
    border-color: #6ee7b7;
}
.report-copy-btn-detail:hover {
    background: #d1fae5;
    border-color: #34d399;
}
.report-copy-btn-detail:active {
    background: #a7f3d0;
}
.report-copy-btn-detail.copied {
    background: #d1fae5;
    border-color: #6ee7b7;
    color: #047857;
}

.copy-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #1e40af;
    color: #ffffff;
    padding: 5px 16px;
    border-radius: 20px;
    font-size: 0.92rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 1000;
    white-space: nowrap;
}

.copy-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* 履歴読み込みインジケーター */
.history-loader {
    text-align: center;
    padding: 8px 0;
}
.history-loader-text {
    font-size: 0.85rem;
    color: #999;
    background: #f3f4f6;
    padding: 2px 12px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

/* 履歴メッセージは最初フェードインしない */
.message.no-animate {
    animation: none;
}

/* --- メッセージ長押しポップオーバー --- */

/* iOS の長押し callout（テキスト選択バブル）を抑制 */
.message {
    -webkit-touch-callout: none;
}

/* ポップオーバー表示中に背後のタッチ/クリックを横取りする透明オーバーレイ */
.msg-popover-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 799;
    background: transparent;
    -webkit-tap-highlight-color: transparent;
}

.msg-popover {
    position: fixed;
    z-index: 800;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 4px;
    opacity: 0;
    transform: scale(0.88);
    transform-origin: center bottom;
    transition: opacity 0.15s ease, transform 0.15s ease;
    pointer-events: none;
    min-width: 100px;
}

.msg-popover.visible {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.msg-popover-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 9px 16px;
    border: none;
    border-radius: 7px;
    background: transparent;
    font-size: 0.92rem;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: background 0.15s;
    white-space: nowrap;
}

.msg-popover-btn.delete {
    color: #dc2626;
}

.msg-popover-btn.delete:hover {
    background: #fee2e2;
}

.msg-popover-btn.delete:active {
    background: #fecaca;
}

/* スクロールバー */
.chat-container::-webkit-scrollbar {
    width: 4px;
}
.chat-container::-webkit-scrollbar-track {
    background: transparent;
}
.chat-container::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 2px;
}
