/* ========================================
   List画面 — チャットUIリニューアル
   ======================================== */

/* ----------------------------------------
   List画面表示時：右サイドバーを消して
   app-container を 2カラムに切り替える
   ---------------------------------------- */
.app-container.list-mode {
    grid-template-columns: 260px 1fr;
}

/* ----------------------------------------
   List画面全体コンテナ（チャットUI）
   ---------------------------------------- */
.list-chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: var(--bg-primary);
}

/* ----------------------------------------
   ヘッダー（データソースセレクタ + ログアウト）
   ---------------------------------------- */
.list-chat-header {
    display: flex;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    flex-shrink: 0;
}

.list-data-source-selector {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    flex: 1;
}

.list-logout-btn {
    margin-left: auto;
    padding: 8px 16px;
    background: none;
    border: 1.5px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    white-space: nowrap;
    flex-shrink: 0;
}

.list-logout-btn:hover {
    border-color: var(--error);
    color: var(--error);
    background-color: rgba(239, 68, 68, 0.05);
}

/* ----------------------------------------
   チャットメッセージエリア
   ---------------------------------------- */
.list-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    scroll-behavior: smooth;
    display: flex;
    flex-direction: column;
}

.list-welcome-message {
    text-align: center;
    padding: 60px 20px;
    margin: auto;
}

.list-welcome-message h2 {
    font-size: 28px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.list-welcome-message p {
    font-size: 16px;
    color: var(--text-secondary);
}

/* メッセージ共通 */
.list-message {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    animation: fadeIn 0.3s ease-in;
    max-width: 85%;
}

/* AIアシスタント：左寄せ */
.list-message.assistant {
    align-self: flex-start;
    flex-direction: row;
    max-width: 100%;
}

/* ユーザー：右寄せ */
.list-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.list-message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-weight: 600;
    font-size: 14px;
}

.list-message.user .list-message-avatar {
    background-color: var(--accent-primary);
    color: white;
}

.list-message.assistant .list-message-avatar {
    background-color: var(--success);
    color: white;
}

.list-message-content {
    flex: 1;
    min-width: 0;
}

/* ユーザー側：テキストと吹き出しを右揃え */
.list-message.user .list-message-content {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.list-message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

/* ユーザー側：名前・時刻を右揃え */
.list-message.user .list-message-header {
    flex-direction: row-reverse;
}

.list-message-author {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.list-message-time {
    font-size: 12px;
    color: var(--text-tertiary);
}

/* ユーザーメッセージ：吹き出し風バブル */
.list-message.user .list-message-text {
    background-color: var(--accent-primary);
    color: white;
    padding: 10px 14px;
    border-radius: 18px 4px 18px 18px;
    display: inline-block;
    text-align: left;
}

/* AIメッセージ：吹き出し風バブル */
.list-message.assistant .list-message-text {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: 4px 18px 18px 18px;
    border: 1px solid var(--border-color);
    display: block;
    text-align: left;
}

.list-message-text {
    font-size: 14px;
    line-height: 1.6;
    word-wrap: break-word;
    white-space: normal;
}

/* テーブル（吹き出し内） */
.list-message-table {
    margin-top: 12px;
    overflow-x: auto;          /* 横スクロール有効 */
    border-radius: 8px;
    border: 1px solid var(--border-color);
    width: 100%;
}

.list-message-table table {
    width: 100%;
    min-width: 1100px;         /* 全列が収まる最低幅 */
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 13px;
    background-color: var(--bg-secondary);
}

.list-message-table th,
.list-message-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    word-break: break-word;
    overflow-wrap: break-word;
}

.list-message-table th {
    background-color: var(--bg-tertiary);
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-message-table td {
    color: var(--text-secondary);
    vertical-align: top;
    line-height: 1.5;
    white-space: normal;
}

/* ===== 各列の幅指定（table-layout:fixed と組み合わせて使用）=====
   合計: 36px + 120px + 130px + 140px + 18% + 18% + 80px + 200px
   min-width:1100px に対して余裕を持たせた配分
   ================================================================ */

/* # 番号 */
.list-message-table th:nth-child(1),
.list-message-table td:nth-child(1) {
    width: 36px;
    min-width: 36px;
    text-align: center;
    word-break: keep-all;
}

/* 図番 */
.list-message-table th:nth-child(2),
.list-message-table td:nth-child(2) {
    width: 120px;
    min-width: 120px;
    word-break: break-all;
}

/* 不具合内容 */
.list-message-table th:nth-child(3),
.list-message-table td:nth-child(3) {
    width: 130px;
    min-width: 130px;
}

/* 不具合画像 */
.list-message-table th:nth-child(4),
.list-message-table td:nth-child(4) {
    width: 150px;
    min-width: 150px;
    text-align: center;
    vertical-align: middle;
}

/* 発生原因 */
.list-message-table th:nth-child(5),
.list-message-table td:nth-child(5) {
    width: 18%;
    min-width: 160px;
    white-space: normal;
    word-break: break-word;
    line-height: 1.6;
}

/* 発生対策 */
.list-message-table th:nth-child(6),
.list-message-table td:nth-child(6) {
    width: 18%;
    min-width: 160px;
    white-space: normal;
    word-break: break-word;
    line-height: 1.6;
}

/* リンク */
.list-message-table th:nth-child(7),
.list-message-table td:nth-child(7) {
    width: 80px;
    min-width: 80px;
    text-align: center;
    white-space: nowrap;
}

/* 類似度 */
.list-message-table th:nth-child(8),
.list-message-table td:nth-child(8) {
    width: 200px;
    min-width: 200px;
}

.list-message-table tbody tr:last-child td {
    border-bottom: none;
}

.list-message-table tbody tr:hover {
    background-color: var(--bg-tertiary);
}

/* アクションボタン */
.list-message-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.list-message-action-btn {
    padding: 6px 12px;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.list-message-action-btn:hover {
    background-color: var(--bg-secondary);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* Excelへ出力ボタン — 緑系カラー */
.list-excel-export-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background-color: #f0faf4;
    border: 1.5px solid #22c55e;
    border-radius: 6px;
    color: #16a34a;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    letter-spacing: 0.01em;
}

.list-excel-export-btn:hover {
    background-color: #22c55e;
    border-color: #16a34a;
    color: #fff;
}

.list-excel-export-btn:active {
    background-color: #16a34a;
    border-color: #15803d;
    color: #fff;
    transform: translateY(1px);
}

.list-excel-export-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* ローディングアニメーション */
@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* タイピングインジケーター */
.list-typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 0;
}

/* ----------------------------------------
   入力エリア
   ---------------------------------------- */
.list-chat-input-container {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    flex-shrink: 0;
}

.list-chat-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 12px;
    background-color: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.2s;
    position: relative;
}

.list-chat-input-wrapper:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-light);
}

/* オプションボタン */
.list-options-btn {
    width: 36px;
    height: 36px;
    padding: 8px;
    background: none;
    border: none;
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.list-options-btn:hover {
    background-color: var(--bg-tertiary);
    color: var(--accent-primary);
}

.list-options-btn svg {
    width: 100%;
    height: 100%;
}

/* オプションポップオーバー */
.list-options-popover {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 8px;
    min-width: 280px;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 8px;
    z-index: 1000;
    animation: popoverSlideUp 0.2s ease-out;
}

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

.list-options-popover.active {
    display: block;
}

/* 入力コンテンツ */
.list-chat-input-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

/* 選択オプションタグ */
.list-selected-options-tags {
    display: none;
    flex-wrap: wrap;
    gap: 6px;
}

.list-selected-options-tags.active {
    display: flex;
}

/* textarea */
#listChatInput {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    resize: none;
    max-height: 200px;
    line-height: 1.5;
    min-height: 20px;
}

#listChatInput::placeholder {
    color: var(--text-tertiary);
}

/* 送信ボタン */
.list-send-btn {
    width: 36px;
    height: 36px;
    padding: 8px;
    background: none;
    border: none;
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.list-send-btn:hover {
    background-color: var(--bg-tertiary);
    color: var(--accent-primary);
}

.list-send-btn svg {
    width: 100%;
    height: 100%;
}

/* ----------------------------------------
   チェックリスト画面（不具合ワード表検索）
   ---------------------------------------- */
.list-checklist-screen {
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: var(--bg-primary);
}

/* チェックリストヘッダー */
.list-checklist-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    flex-shrink: 0;
}

.list-checklist-back-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: none;
    border: 1.5px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.list-checklist-back-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background-color: var(--accent-light);
}

.list-checklist-back-btn svg {
    width: 16px;
    height: 16px;
}

.list-checklist-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

/* チェックリストボディ */
.list-checklist-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: auto;
    padding: 16px 20px;
}


/* カテゴリ列の横並びレイアウト — 6項目を必ず1行に並べる */
.list-checklist-columns {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
}

/* 各カテゴリカード */
.list-checklist-col {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    overflow: hidden;
}

.list-checklist-col-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* チェックボックスアイテム */
.list-checklist-item {
    display: flex;
    align-items: flex-start; /* 改行時にチェックボックスとバッジを上揃えにする */
    gap: 5px;
    padding: 3px 4px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.15s;
    user-select: none;
    min-width: 0;
}

.list-checklist-item:hover {
    background-color: var(--bg-tertiary);
}

.list-checklist-item input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: var(--accent-primary);
    flex-shrink: 0;
    margin-top: 1px; /* テキスト1行目と縦位置を合わせる */
}

.list-checklist-item label {
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    line-height: 1.4;
    white-space: normal;   /* 改行を許可してすべての文字を表示 */
    overflow: visible;
    word-break: break-all; /* 長い単語も折り返す */
    min-width: 0;
    flex: 1;  /* ラベルが伸びてバッジを押し出さないよう flex:1 で伸縮させる */
}

.list-checklist-item:has(input:checked) {
    background-color: var(--accent-light);
}

.list-checklist-item:has(input:checked) label {
    color: var(--accent-primary);
    font-weight: 500;
}

/* 0件の選択肢は選択不可 */
.list-checklist-item.disabled {
    cursor: not-allowed;
    opacity: 0.45;
    pointer-events: none;
}

.list-checklist-item.disabled label {
    cursor: not-allowed;
    color: var(--text-tertiary);
}

.list-checklist-item.disabled input[type="checkbox"] {
    cursor: not-allowed;
}

/* 件数バッジ（各選択肢の右端に表示） */
.list-checklist-count {
    flex-shrink: 0;  /* バッジは縮まない */
    margin-left: 4px;
    margin-top: 1px; /* テキスト1行目と縦位置を合わせる */
    font-size: 11px;
    font-weight: 600;
    color: var(--accent-primary);
    background-color: var(--accent-light);
    border-radius: 10px;
    padding: 1px 6px;
    white-space: nowrap;
    line-height: 1.6;
    align-self: flex-start; /* 改行時に上端に固定 */
}

/* 0件の場合はグレーで薄く表示 */
.list-checklist-count.zero {
    color: var(--text-tertiary);
    background-color: var(--bg-tertiary);
}

/* チェックリストフッター */
.list-checklist-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    flex-shrink: 0;
}

.list-checklist-clear-btn {
    padding: 10px 20px;
    background: none;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.list-checklist-clear-btn:hover {
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

.list-checklist-search-btn {
    padding: 10px 24px;
    background-color: var(--accent-primary);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.list-checklist-search-btn:hover {
    background-color: var(--accent-hover);
    box-shadow: var(--shadow-md);
}

/* テーブル行のホバースタイル */
.list-message-table tbody tr {
    transition: background-color 0.15s;
}

.list-message-table tbody tr:hover {
    background-color: var(--bg-tertiary);
}

/* テーブルを含むメッセージは最大幅を広げる */
.list-message.assistant:has(.list-message-table) {
    max-width: 100%;
}

/* 件数バッジ */
.list-result-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background-color: var(--accent-light);
    color: var(--accent-primary);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
}

/* ----------------------------------------
   不具合画像セル
   ---------------------------------------- */
.list-table-img-cell {
    text-align: center;
    vertical-align: middle;
    padding: 6px 8px !important;
}

.list-table-img {
    width: 120px;
    height: 90px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    object-fit: contain;
    display: block;
    margin: 0 auto;
    background-color: var(--bg-tertiary);
}

.list-table-no-img {
    display: inline-block;
    padding: 4px 8px;
    background-color: var(--bg-tertiary);
    color: var(--text-tertiary);
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
}

/* ----------------------------------------
   リンクセル
   ---------------------------------------- */
.list-table-link {
    display: inline-block;
    padding: 4px 10px;
    background-color: var(--accent-light);
    color: var(--accent-primary);
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}

.list-table-link:hover {
    background-color: var(--accent-primary);
    color: white;
}

/* 発生原因セルの長文対応は th/td:nth-child(5) で統合済み */

/* ----------------------------------------
   類似度セル — 上：総合％バッジ / 下：詳細リスト（縦並び）
   ---------------------------------------- */
.list-similarity-cell {
    vertical-align: top;
}

.list-similarity-layout {
    display: flex;
    flex-direction: column;   /* 縦並びに変更 */
    gap: 6px;
    align-items: flex-start;
}

/* ％バッジ */
.list-similarity-pct-col {
    flex-shrink: 0;
}

.list-similarity-badge {
    display: inline-block;
    padding: 3px 10px;
    background-color: var(--success, #10b981);
    color: white;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

/* 詳細リスト */
.list-similarity-detail-col {
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 100%;
}

.list-similarity-detail-item {
    line-height: 1.4;
}

.list-similarity-detail-label {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.6;
    word-break: break-word;
    white-space: normal;
}

/* ----------------------------------------
   不具合画像セル — 画像 + 「その他」ボタン
   ---------------------------------------- */
.list-table-img-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    line-height: 1;
}


/* 画像にカーソルを当てると手のひらアイコン */
.list-table-img-clickable {

    cursor: pointer;
    transition: opacity 0.15s;
}

.list-table-img-clickable:hover {
    opacity: 0.85;
}

/* 「その他」ボタン — 画像の下に独立して配置 */
.list-table-img-more-btn {
    display: inline-block;
    padding: 3px 10px;
    background-color: var(--accent-primary, #3b82f6);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    line-height: 1.4;
    white-space: nowrap;
    transition: background-color 0.2s;
    font-family: inherit;
    letter-spacing: 0.02em;
}

.list-table-img-more-btn:hover {
    background-color: var(--accent-hover, #2563eb);
}

/* ----------------------------------------
   不具合画像モーダル
   ---------------------------------------- */
.defect-images-modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.2s ease-in;
}

.defect-images-modal-container {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    width: min(90vw, 720px);
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.defect-images-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.defect-images-modal-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.defect-images-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.defect-images-modal-close:hover {
    border-color: var(--error, #ef4444);
    color: var(--error, #ef4444);
    background-color: rgba(239, 68, 68, 0.05);
}

.defect-images-modal-body {
    display: flex;
    flex-direction: column;  /* グループを縦に積む */
    gap: 24px;               /* グループ間の余白 */
    padding: 20px;
    overflow-y: auto;
}

/* 同じ種類の画像をまとめるグループ行 */
/* モーダル幅に合わせて自動折り返し */
.defect-images-modal-group {
    display: flex;
    flex-wrap: wrap;         /* モーダル幅に応じて自動折り返し */
    gap: 16px;
    justify-content: flex-start;
}

.defect-images-modal-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1 1 180px;   /* モーダル幅に応じて伸縮・折り返し */
    max-width: 240px;  /* 1枚だけのとき横に広がりすぎない */
}

.defect-images-modal-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.defect-images-modal-img {
    width: 100%;       /* 親（.defect-images-modal-item）の幅に追従 */
    aspect-ratio: 4/3; /* 縦横比を固定（220×165 と同じ比率） */
    border-radius: 6px;
    border: 1px solid var(--border-color);
    object-fit: contain;
    background-color: var(--bg-secondary);
    cursor: pointer;
    transition: opacity 0.15s;
}

.defect-images-modal-img:hover {
    opacity: 0.85;
}

/* ----------------------------------------
   ライトボックス（画像全画面拡大）
   ---------------------------------------- */
.image-lightbox-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.92);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    z-index: 10000;
    animation: fadeIn 0.15s ease-in;
}

.image-lightbox-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    flex-shrink: 0;
}

.image-lightbox-counter {
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    font-weight: 500;
}

.image-lightbox-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.image-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* 画像エリア：残りの高さを全て使う */
.image-lightbox-img-area {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 16px 80px;        /* 左右に前後ボタン分の余白 */
    box-sizing: border-box;
    overflow: hidden;
}

.image-lightbox-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
    user-select: none;
}

/* 前へ・次へナビゲーションボタン */
.image-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    transition: background-color 0.2s, opacity 0.2s;
    flex-shrink: 0;
}

.image-lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.28);
}

.image-lightbox-prev {
    left: 16px;
}

.image-lightbox-next {
    right: 16px;
}

/* ----------------------------------------
   参考リンクブロック（インターネット検索ONのときのみ表示）
   ---------------------------------------- */
.list-ref-links-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 1em;
}

/* 【参考リンク】見出し */
.list-ref-links-heading {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
    margin-bottom: 2px;
}

/* リンク1行ずつのラッパー */
.list-ref-link-row {
    display: flex;
    align-items: center;
}

/* リンク本体 */
.list-ref-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--accent-primary);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s, text-decoration 0.2s;
    word-break: break-all;
}

.list-ref-link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.list-ref-link svg {
    flex-shrink: 0;
    color: var(--accent-primary);
}
