/* /custom-assets/blog-pages-v2/common-style.css */

/* --- グループカラー定義 --- */
.group-nogizaka46 { --theme-color: var(--nogizaka-color); }
.group-sakurazaka46 { --theme-color: var(--sakurazaka-color); }
.group-hinatazaka46 { --theme-color: var(--hinatazaka-color); }
.group-keyakizaka46 { --theme-color: var(--keyakizaka-color); }

/* --- 基本コンポーネント: 形状定義 --- */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none !important;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.9em;
}
.action-button {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
    text-align: center;
    padding: 8px;
    border-radius: 8px;
    text-decoration: none !important;
    font-size: 0.9em;
    font-weight: bold;
}

/* --- 共通ボタンカラースタイル --- */
.button-solid {
    background-color: var(--theme-color, #555);
    color: white !important;
    border: 1px solid var(--theme-color, #555);
    transition: all 0.2s ease;
}
.button-solid:hover {
    background-color: white;
    color: var(--theme-color, #555) !important;
}
.button-outline {
    background-color: white;
    color: var(--theme-color, #555) !important;
    border: 1px solid var(--theme-color, #555);
    transition: all 0.2s ease;
}
.button-outline:hover {
    background-color: var(--theme-color, #555);
    color: white !important;
}
.button.disabled, .button-solid.disabled, .button-outline.disabled {
    opacity: 0.6;
    pointer-events: none;
    filter: none;
    background-color: #ccc;
    color: #888 !important;
    border-color: #ccc;
}
.bml-group-button.disabled {
    background-color: var(--theme-color);
    opacity: 0.6;
    pointer-events: none;
    filter: none;
}
.bml-group-button.disabled:hover {
    background-color: var(--theme-color);
    color: white !important;
}

/* --- 一覧上部アクションラッパー --- */
.global-top-actions-wrapper {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    width: 100%;
}
.global-top-actions-wrapper > button {
    flex: 1 1 50%;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 10px 14px;
    font-size: 0.95em;
}

@media (max-width: 600px) {
    .global-top-actions-wrapper {
        flex-direction: column;
        gap: 8px;
    }
    .global-top-actions-wrapper > button {
        width: 100%;
        flex: 1 1 100%;
        font-size: 0.9em;
    }
}

/* --- 人アイコン凡例 --- */
.face-icon-legend {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 0.84em;
    color: #555;
    margin: -12px 0 16px;
    padding: 0 4px;
    user-select: none;
}
.search-controls + .face-icon-legend {
    padding: 0 15px;
    margin: -10px 0 15px;
}
.face-icon-legend .legend-unverified,
.face-icon-legend .legend-verified {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.face-icon-legend .legend-unverified i {
    color: #ff4d4f;
}
.face-icon-legend .legend-verified i {
    color: #2ecc71;
}

/* --- ヘッダー・タブ --- */
.entry-header { border-bottom: 1px solid #eee; }
.view-switcher { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px; margin-top: 20px; }
.view-tabs { display: flex; gap: 10px; }
.tab-button {
    background: none;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 1.1em;
    color: #888;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}
.tab-button.active {
    color: var(--theme-color, #333);
    border-color: var(--theme-color, #333);
    font-weight: bold;
}

/* --- トグルスイッチ --- */
.toggle-container { display: flex; align-items: center; gap: 8px; font-size: 0.9em; cursor: pointer; user-select: none; }
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.toggle-switch .toggle-input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; border-radius: 24px; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
.toggle-input:checked + .slider { background-color: var(--theme-color, #2196F3); }
.toggle-input:checked + .slider:before { transform: translateX(20px); }

/* --- ビューコンテナ --- */
.view-content { display: none; padding-top: 20px; }
.view-content.active { display: block; }

/* --- 画像ギャラリー --- */
.blog-image-controls { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 20px; margin-bottom: 20px; background: #f9f9f9; padding: 15px; border-radius: 8px; }
.save-structure-wrapper { display: flex; flex-direction: column; gap: 10px; flex-grow: 1; }
.structure-label { font-weight: bold; font-size: 0.9em; }
.structure-toggles { display: flex; gap: 8px; flex-wrap: wrap; }
.structure-toggle {
    background-color: #ccc; color: #555; border: none; padding: 6px 12px; border-radius: 15px;
    font-size: 0.85em; font-weight: bold; cursor: pointer; transition: all 0.2s ease;
}
.structure-toggle.active { background-color: var(--theme-color); color: white; }
.structure-preview {
    font-size: 0.9em; color: #666; background-color: #fff; border: 1px solid #ddd;
    padding: 8px 12px; border-radius: 4px; overflow-wrap: break-word;
}
.structure-preview .path-part { font-weight: bold; color: #333; }
.view-options-wrapper { display: flex; align-items: center; gap: 20px; }
.batch-download-area { text-align: center; margin: 20px 0; }
.image-gallery { display: flex; flex-wrap: wrap; justify-content: center; gap: 15px; }

.gallery-item { 
    cursor: pointer; 
    flex-basis: 200px; 
    flex-grow: 0; 
    position: relative; 
    z-index: 1; 
}
.gallery-item:hover,
.gallery-item:focus-within,
.gallery-item.has-active-tooltip { 
    z-index: 40; 
}

.image-wrapper { 
    position: relative; 
    width: 100%; 
    aspect-ratio: 1 / 1; 
    border-radius: 8px; 
    overflow: visible; 
    border: 1px solid #eee; 
    background-color: #fafafa; 
}
.image-wrapper img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    border-radius: 7px; 
    display: block; 
}
.item-actions { display: flex; gap: 2px; margin-top: 8px; }

/* --- ギャラリーおよび本文画像右上の顔認識人数バッジ --- */
.gl-face-badge-container {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
    cursor: pointer;
    user-select: none;
    display: inline-flex;
    align-items: center;
}

.gl-face-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 7px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: bold;
    color: #ffffff;
    background-color: rgba(20, 20, 20, 0.65);
    backdrop-filter: blur(2px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
    border: 1px solid transparent;
    box-sizing: border-box;
    transition: background-color 0.2s ease, transform 0.15s ease, color 0.2s ease, border-color 0.2s ease;
}

.gl-face-badge i {
    font-size: 11px;
}

.gl-face-badge:hover {
    transform: scale(1.05);
}

.gallery-item.is-face-matched .gl-face-badge {
    background-color: rgba(10, 10, 10, 0.85);
    padding: 1.5px 5.5px;
    border: 2.5px solid var(--theme-color, #2196F3);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.35);
}

/* --- 人数・人アイコンの色分けスタイル --- */
.bl-face-count.is-checked-true,
.gl-face-badge.is-checked-true {
    color: #2ecc71 !important;
}

.bl-face-count.is-checked-false,
.gl-face-badge.is-checked-false {
    color: #ff4d4f !important;
}

/* --- ツールチップ内の誤り報告ボタン --- */
.tooltip-report-footer {
    display: block;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed #eee;
    text-align: center;
}

.btn-report-face {
    background: none;
    border: 1px solid #cbd5e1;
    color: #555;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
    width: 100%;
    justify-content: center;
}
.btn-report-face:hover {
    background-color: #f1f5f9;
    color: #0f172a;
    border-color: #94a3b8;
}

/* --- ギャラリー・本文画像用顔一覧ツールチップ --- */
.gl-face-tooltip {
    position: absolute;
    background: #ffffff;
    border: 1px solid #dcdcdc;
    border-radius: 8px;
    padding: 10px 12px;
    min-width: 170px;
    max-width: min(280px, calc(100vw - 24px));
    width: max-content;
    display: none;
    z-index: 999;
    pointer-events: auto;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18), 0 2px 6px rgba(0, 0, 0, 0.08);
    text-align: left;
    color: #333;
    line-height: 1.4;
    font-family: inherit;
    box-sizing: border-box;
    max-height: none !important;
    overflow: visible !important;
}

.gl-face-tooltip,
.gl-face-tooltip.position-above {
    top: auto !important;
    bottom: calc(100% + 8px) !important;
    right: 0;
}
.gl-face-tooltip::before,
.gl-face-tooltip.position-above::before {
    content: '';
    position: absolute;
    top: 100%;
    bottom: auto;
    left: var(--arrow-x, calc(100% - 16px));
    transform: translateX(-50%);
    border: 7px solid transparent;
    border-top-color: #dcdcdc;
    border-bottom-color: transparent;
}
.gl-face-tooltip::after,
.gl-face-tooltip.position-above::after {
    content: '';
    position: absolute;
    top: 100%;
    bottom: auto;
    left: var(--arrow-x, calc(100% - 16px));
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #ffffff;
    border-bottom-color: transparent;
}

.gl-face-tooltip.position-below {
    bottom: auto !important;
    top: calc(100% + 8px) !important;
    right: 0;
}
.gl-face-tooltip.position-below::before {
    top: auto;
    bottom: 100%;
    left: var(--arrow-x, calc(100% - 16px));
    transform: translateX(-50%);
    border: 7px solid transparent;
    border-top-color: transparent;
    border-bottom-color: #dcdcdc;
}
.gl-face-tooltip.position-below::after {
    top: auto;
    bottom: 100%;
    left: var(--arrow-x, calc(100% - 16px));
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: transparent;
    border-bottom-color: #ffffff;
}

/* --- ツールチップとバッジ間の不可視ホバーブリッジ --- */
.gl-face-tooltip .tooltip-body::before,
.gl-face-tooltip.position-above .tooltip-body::before {
    content: '';
    position: absolute;
    left: -12px;
    right: -12px;
    height: 14px;
    background: transparent;
    pointer-events: auto;
    z-index: 1;
    top: 100% !important;
    bottom: auto !important;
}
.gl-face-tooltip.position-below .tooltip-body::before {
    top: auto !important;
    bottom: 100% !important;
}

@media (hover: hover) and (pointer: fine) {
    .gl-face-badge-container:hover .gl-face-tooltip {
        display: block;
    }
}

.gl-face-tooltip.is-active {
    display: block !important;
}

.gl-face-tooltip .tooltip-header {
    display: block;
    font-size: 11px;
    color: #666;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
    margin-bottom: 8px;
    font-weight: bold;
    text-align: left;
    white-space: nowrap;
}

.gl-face-tooltip .tooltip-body {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
}

.bl-tooltip-face-item {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: bold;
    color: var(--theme-color, #333);
    border: 1px solid var(--theme-color, #ccc);
    background: #ffffff;
    white-space: nowrap;
    line-height: 1.4;
    text-decoration: none !important;
    box-sizing: border-box;
}

.bl-tooltip-face-item.group-nogizaka46 { --theme-color: var(--nogizaka-color, #7e1083); }
.bl-tooltip-face-item.group-sakurazaka46 { --theme-color: var(--sakurazaka-color, #ea559a); }
.bl-tooltip-face-item.group-hinatazaka46 { --theme-color: var(--hinatazaka-color, #7cc7e8); }
.bl-tooltip-face-item.group-keyakizaka46 { --theme-color: var(--keyakizaka-color, #5fb446); }

/* --- ブログ本文ビュー --- */
.sns-embed-control {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 15px;
    margin-bottom: 20px;
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 8px;
}
.blog-text-content {
    line-height: 1.8;
}

/* --- 共通アクションボタン --- */
.common-action-buttons {
    display: flex;
    justify-content: space-between;
    align-items: stretch; 
    gap: 10px;
    padding: 15px;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    border-top: 1px solid #eee;
    position: sticky;
    bottom: 0;
    z-index: 30;
}
.common-tab-buttons-wrapper {
    display: flex;
}

/* --- 報告機能 --- */
.report-feature-wrapper { margin: 30px 0; }
.report-accordion {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}
.report-accordion[open] > summary { border-bottom: 1px solid #e0e0e0; }
.report-accordion > summary {
    display: flex;
    align-items: center;
    gap: 0.5em;
    padding: 15px 20px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    color: #555;
    background-color: #fff;
    transition: background-color 0.2s ease;
}
.report-accordion > summary i {
    color: #666;
}
.report-accordion > summary:hover {
    background-color: #f9f9f9;
}
.report-form-container { padding: 20px; }
#blog-report-form .form-field { margin-bottom: 15px; }
#blog-report-form label { display: block; font-weight: bold; margin-bottom: 5px; font-size: 0.9em; }
#blog-report-form input[type="text"],
#blog-report-form input[type="hidden"],
#blog-report-form select,
#blog-report-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1em;
}
#blog-report-form input[readonly] { background-color: #f0f0f0; cursor: not-allowed; }

.report-turnstile-wrapper {
    margin-bottom: 15px;
    display: flex;
    justify-content: flex-start;
}

#blog-report-form .form-actions { text-align: right; }
.report-message {
    margin-top: 15px;
    padding: 10px 15px;
    border-radius: 4px;
    font-size: 0.9em;
    display: none;
}
.report-message.processing { display: block; background-color: #e6f7ff; border: 1px solid #91d5ff; color: #096dd9; }
.report-message.success { display: block; background-color: #f6ffed; border: 1px solid #b7eb8f; color: #389e0d; }
.report-message.error { display: block; background-color: #fff1f0; border: 1px solid #ffa39e; color: #cf1322; }

@media (max-width: 450px) {
    .view-options-wrapper { flex-direction: column; align-items: flex-start; gap: 10px; width: 100%; }
}

/* --- 画像ギャラリーの選択ハイライト --- */
.gallery-item .image-wrapper {
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item.selected .image-wrapper {
    border: 4px solid var(--theme-color);
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
}

.gallery-item.selected .image-wrapper::before {
    content: '\f00c';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    width: 30px;
    height: 30px;
    background-color: var(--theme-color);
    color: white;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    animation: check-in 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    transform: scale(0) rotate(-180deg);
    opacity: 0;
}

@keyframes check-in {
    from {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    to {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* --- ブログ本文ビューのレイアウト調整 --- */
.blog-text-header,
.blog-text-body {
    max-width: 750px;
    margin-left: auto;
    margin-right: auto;
}

.blog-text-header {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.blog-text-title {
    font-size: 1.4em;
    margin: 0 0 10px;
    line-height: 1.4;
    font-weight: bold;
}

.blog-text-meta {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 15px;
    font-size: 0.9em;
    color: #555;
}

.blog-text-body img {
    display: block;
}

.text-image-container {
    display: block;
    margin: 20px 0;
    width: fit-content;
    max-width: 100%;
}

.text-image-wrapper {
    position: relative;
    display: inline-block;
    max-width: 100%;
    border-radius: 8px;
}

.text-image-wrapper:hover,
.text-image-wrapper:focus-within,
.text-image-wrapper.has-active-tooltip {
    z-index: 40;
}

.text-image-container img {
    max-height: 500px;
    max-width: 100%;
    object-fit: contain;
    height: auto;
    display: block;
    border-radius: 8px;
}

.text-image-actions {
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    margin-top: 8px;
}

/* --- 本文読み込みエラー表示 --- */
.load-error-container {
    text-align: center;
    padding: 40px 20px;
    border: 1px dashed #ccc;
    border-radius: 8px;
    background-color: #f9f9f9;
}
.load-error-container .error-text {
    margin: 0 0 15px;
    font-weight: bold;
    color: #d9534f;
}
.retry-load-btn {
    background-color: #555 !important;
    border-color: #555 !important;
}
.retry-load-btn:hover {
    background-color: white !important;
    color: #555 !important;
}

/* --- 一括設定によるUI非表示 --- */
body.hide-view-settings .view-switcher .toggle-container,
body.hide-view-settings .blog-image-controls .view-options-wrapper,
body.hide-view-settings .save-structure-wrapper .structure-label,
body.hide-view-settings .save-structure-wrapper .structure-toggles,
body.hide-view-settings .sns-embed-control {
    display: none;
}

body.hide-view-settings .blog-image-controls {
    padding: 0;
    background: none;
    margin-bottom: 0;
}

/* --- 顔認識投票・報告モーダル --- */
.face-vote-modal {
    position: fixed;
    top: var(--vvt, 0px);
    left: 0;
    width: 100%;
    height: var(--vvh, 100vh);
    height: var(--vvh, 100dvh);
    z-index: 10001;
    display: none;
    align-items: center;
    justify-content: center;
    padding-top: max(28px, env(safe-area-inset-top, 28px));
    padding-bottom: max(28px, env(safe-area-inset-bottom, 28px));
    box-sizing: border-box;
}
.face-vote-modal.active { display: flex; }
.face-vote-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); cursor: pointer; }

.face-vote-container {
    position: relative;
    width: 96%;
    max-width: 1400px;
    height: 100%;
    max-height: 880px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    overflow: visible !important;
    box-sizing: border-box;
}

.face-vote-close {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background-color: #333333;
    color: #ffffff;
    border: 2px solid #ffffff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    z-index: 1000;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
    transition: transform 0.15s ease, background-color 0.15s ease;
}
.face-vote-close:hover {
    background-color: #000000;
    transform: scale(1.08);
}

.face-vote-content {
    padding: 10px 14px;
    overflow: hidden !important;
    flex: 1 1 0%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    position: relative;
    box-sizing: border-box;
}

.vote-toast {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: var(--theme-color, #1e293b);
    color: #fff;
    padding: 7px 18px;
    border-radius: 20px;
    font-size: 0.88em;
    font-weight: bold;
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
    white-space: nowrap;
}
.vote-toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.vote-toast.type-info { background: var(--theme-color, #0284c7); }
.vote-toast.type-success { background: var(--theme-color, #16a34a); }
.vote-toast.type-warning { background: #ea580c; }
.vote-toast.type-error { background: #dc2626; }

.vote-filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 5px 10px;
    margin-bottom: 8px;
    flex-shrink: 0;
}
.vote-filter-group {
    display: flex;
    align-items: center;
    gap: 6px;
}
.vote-filter-title {
    font-size: 0.82em;
    font-weight: bold;
    color: #475569;
    white-space: nowrap;
}

.vote-segmented-controls {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
}
.vote-segmented-controls label {
    position: relative;
    cursor: pointer;
    margin: 0;
    user-select: none;
}
.vote-segmented-controls label:not(:last-child) {
    border-right: 1px solid #cbd5e1;
}
.vote-segmented-controls input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.vote-segmented-controls span {
    display: flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 0.8em;
    font-weight: bold;
    color: #475569;
    background: #fff;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.vote-segmented-controls input[type="radio"]:checked + span {
    background: var(--theme-color, #2196F3);
    color: #fff;
}
.vote-segmented-controls label:hover span {
    background: #f1f5f9;
}
.vote-segmented-controls label input[type="radio"]:checked + span:hover {
    background: var(--theme-color, #2196F3);
}

.vote-nav-actions-container {
    margin-left: auto;
    display: flex;
    align-items: center;
}
.vote-nav-btns {
    display: flex;
    gap: 5px;
}
.vote-nav-btns button {
    padding: 4px 10px;
    font-size: 0.8em;
    white-space: nowrap;
}

.vote-loading-state {
    text-align: center;
    padding: 40px 10px;
}

.vote-workbench {
    display: flex;
    flex-direction: column;
    flex: 1 1 0%;
    min-height: 0;
    overflow: hidden;
}

.vote-blog-summary {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 6px 12px;
    margin-bottom: 8px;
    line-height: 1.35;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
    gap: 12px;
}
.vote-blog-summary strong {
    font-size: 0.9em;
    color: #1e293b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.vote-blog-summary span {
    font-size: 0.82em;
    color: #64748b;
    flex-shrink: 0;
}

.vote-main-grid {
    display: flex;
    flex: 1 1 0%;
    min-height: 0;
    overflow: hidden;
    gap: 16px;
    align-items: stretch;
}

.vote-image-pane {
    flex: 1 1 65%;
    min-width: 0;
    min-height: 0;
    height: 100%;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
    overflow: hidden;
}

.vote-image-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.84em;
    font-weight: bold;
    color: #475569;
    margin-bottom: 6px;
    flex-shrink: 0;
}

/* --- ズームツールバー --- */
.vote-zoom-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}
#vote-zoom-level {
    font-size: 11px;
    color: #64748b;
    font-weight: bold;
}
.btn-zoom {
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 11px;
    cursor: pointer;
    font-weight: bold;
    color: #334155;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s ease;
}
.btn-zoom:hover { background: #e2e8f0; }
.btn-zoom:active { background: #cbd5e1; }

.vote-zoom-viewport {
    width: 100%;
    flex: 1 1 0%;
    min-height: 0;
    overflow: hidden !important;
    background: #0f172a;
    border-radius: 6px;
    position: relative;
    box-sizing: border-box;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}
.vote-zoom-viewport.is-dragging {
    cursor: grabbing;
}

.vote-zoom-stage {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

.vote-image-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    line-height: 0;
    margin: 0;
    flex-shrink: 0;
    transform-origin: 0 0;
    user-select: none;
    -webkit-user-select: none;
    will-change: transform, width, height;
}
.vote-image-wrapper img {
    display: block;
    user-select: none;
    -webkit-user-select: none;
    pointer-events: none;
    -webkit-user-drag: none;
    object-fit: contain;
}

.vote-image-wrapper .face-box {
    position: absolute;
    border: 2px solid #00e676;
    background: transparent;
    box-sizing: border-box;
    pointer-events: auto;
    cursor: pointer;
    transition: border-color 0.15s ease-out, box-shadow 0.15s ease-out, opacity 0.15s ease-out, background-color 0.15s ease-out;
    z-index: 2;
}
.vote-image-wrapper .face-box.inactive {
    opacity: 0.35;
    border-style: dashed;
    border-color: rgba(255, 255, 255, 0.7);
}
.vote-image-wrapper .face-box.inactive .face-box-tag {
    background: rgba(51, 65, 85, 0.75) !important;
    color: rgba(255, 255, 255, 0.85);
    box-shadow: none;
}
.vote-image-wrapper .face-box.current-focus {
    opacity: 1 !important;
    border: 3px solid #ff0055 !important;
    box-shadow: 0 0 0 2px #ffffff, 0 0 12px rgba(255, 0, 85, 0.9) !important;
    z-index: 10 !important;
    background: rgba(255, 0, 85, 0.08);
}
.vote-image-wrapper .face-box-tag {
    position: absolute;
    top: -24px;
    left: -2px;
    background: #2e7d32;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    pointer-events: none;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: background-color 0.15s ease-out, transform 0.15s ease-out;
}
.vote-image-wrapper .face-box.current-focus .face-box-tag {
    background: #ff0055 !important;
    transform: scale(1.05);
    box-shadow: 0 2px 6px rgba(255, 0, 85, 0.8);
}
.vote-image-wrapper .face-num-pill {
    background: #ffffff;
    color: #111827;
    font-size: 10px;
    font-weight: 800;
    padding: 0 5px;
    border-radius: 8px;
    display: inline-block;
    line-height: 1.2;
}

/* --- ルール説明エリア（複数行） --- */
.vote-rule-notice {
    width: 100%;
    margin-top: 6px;
    padding: 6px 10px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.74rem;
    line-height: 1.45;
    color: #64748b;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    box-sizing: border-box;
    flex-shrink: 0;
    word-break: break-word;
}
.vote-rule-notice i {
    color: var(--theme-color, #2196F3);
    margin-top: 2px;
    flex-shrink: 0;
    font-size: 0.85em;
}
.vote-rule-notice span {
    flex: 1 1 auto;
}

.vote-question-pane {
    flex: 0 0 380px;
    max-width: 420px;
    min-width: 320px;
    min-height: 0;
    height: 100%;
    background-color: #ffffff !important;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    overflow: visible;
}

.vote-image-nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid #f1f5f9;
    gap: 6px;
    flex-shrink: 0;
    background-color: #ffffff;
}
.btn-img-nav {
    padding: 6px 12px;
    font-size: 0.85em;
    color: #475569 !important;
    border-color: #cbd5e1 !important;
    border-radius: 6px;
}
.btn-img-nav:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    border-color: #94a3b8 !important;
}

.btn-vote-view-text {
    background: #fff;
    color: var(--theme-color, #2196F3) !important;
    border-color: var(--theme-color, #2196F3) !important;
    font-weight: bold;
}
.btn-vote-view-text:hover {
    background: var(--theme-color, #2196F3) !important;
    color: #fff !important;
}
.btn-vote-view-text.active {
    background: var(--theme-color, #2196F3) !important;
    color: #fff !important;
}

.btn-vote-finish-early {
    background-color: var(--theme-color, #2196F3) !important;
    border-color: var(--theme-color, #2196F3) !important;
    color: #ffffff !important;
    font-weight: bold;
}
.btn-vote-finish-early:hover {
    filter: brightness(1.1);
    color: #ffffff !important;
    background-color: var(--theme-color, #2196F3) !important;
}

.vote-step-block {
    display: flex;
    flex-direction: column;
    flex: 1 1 0%;
    min-height: 0;
    height: 100%;
    justify-content: flex-start;
    gap: 8px;
    background-color: #ffffff;
    box-sizing: border-box;
}

.vote-step-header-compact {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    background-color: #ffffff;
}
.vote-question-title {
    margin: 0;
    font-size: 1.05em;
    font-weight: bold;
    color: #1e293b;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vote-confirm-title-full {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    word-break: break-word !important;
    line-height: 1.4 !important;
    font-size: 1.05em !important;
}

.vote-choice-group {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: #ffffff;
}
.vote-group-label {
    display: block;
    font-size: 0.82em;
    font-weight: bold;
    color: #64748b;
    margin-bottom: 4px;
    flex-shrink: 0;
}

#vote-candidate-buttons {
    display: flex;
    flex-wrap: wrap !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    flex: 1 1 auto;
    min-height: 0;
    gap: 8px;
    padding: 2px 4px 6px 2px;
    align-content: flex-start;
    align-items: center;
    background-color: #ffffff;
    -webkit-overflow-scrolling: touch;
}
#vote-candidate-buttons::-webkit-scrollbar {
    width: 4px;
}
#vote-candidate-buttons::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
#vote-candidate-buttons::-webkit-scrollbar-track {
    background: transparent;
}
#vote-candidate-buttons span {
    flex-shrink: 0;
    line-height: 28px;
}

.vote-candidate-btn {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    padding: 8px 16px;
    font-size: 0.95em;
    border-radius: 20px;
    font-weight: bold;
    color: var(--theme-color, #555) !important;
    border: 1.5px solid var(--theme-color, #ccc) !important;
    background-color: #fff;
    transition: all 0.2s ease;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.vote-candidate-btn:hover {
    background-color: var(--theme-color, #555) !important;
    color: #fff !important;
}
.vote-candidate-btn.active {
    background-color: var(--theme-color, #555) !important;
    color: #fff !important;
    border-color: var(--theme-color, #555) !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.18);
}

.vote-candidate-btn.vote-special-btn {
    border-color: #94a3b8 !important;
    color: #475569 !important;
    background-color: #f8fafc;
}
.vote-candidate-btn.vote-special-btn:hover {
    background-color: #e2e8f0 !important;
    color: #0f172a !important;
}
.vote-candidate-btn.vote-special-btn.active {
    background-color: #475569 !important;
    color: #ffffff !important;
    border-color: #475569 !important;
}

.vote-search-actions-block {
    flex-shrink: 0;
    margin-top: 4px;
    position: relative;
    background-color: #ffffff !important;
    z-index: 15;
}

.vote-question-pane .member-search-wrapper {
    position: relative;
    width: 100%;
    background-color: #ffffff !important;
}
.vote-question-pane .member-search-wrapper .member-search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.9em;
    box-sizing: border-box;
    background-color: #ffffff !important;
}
.vote-question-pane .member-search-wrapper .member-search-input:focus {
    border-color: var(--theme-color, #2196F3);
    outline: none;
}

.vote-question-pane .member-suggestions {
    position: absolute;
    left: 0;
    right: 0;
    background-color: #ffffff !important;
    border: 1.5px solid #cbd5e1;
    overflow-y: auto;
    z-index: 10100;
    box-sizing: border-box;
}

.vote-question-pane .member-suggestions .suggestion-item {
    background-color: #ffffff !important;
    border-bottom: 1px solid #f1f5f9;
}
.vote-question-pane .member-suggestions .suggestion-item:hover {
    background-color: #f8fafc !important;
}

.vote-question-pane .member-suggestions.position-below,
.vote-question-pane .member-suggestions:not(.position-above) {
    top: calc(100% + 2px);
    bottom: auto;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.vote-question-pane .member-suggestions.position-above {
    bottom: calc(100% + 2px);
    top: auto;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.25);
}

.vote-nav-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid #f1f5f9;
    flex-shrink: 0;
    background-color: #ffffff !important;
    z-index: 10;
}
.vote-nav-actions button {
    padding: 8px 16px;
    font-size: 0.9em;
    white-space: nowrap;
    border-radius: 6px;
}

.vote-action-btn {
    padding: 8px 16px;
    font-size: 0.88em;
    border-radius: 6px;
    color: #475569 !important;
}
.vote-action-btn:hover {
    background: #f1f5f9;
    color: #0f172a !important;
}

.vote-confirm-actions {
    display: flex;
    gap: 8px;
    margin: 8px 0;
    flex-shrink: 0;
}
.vote-confirm-actions .button {
    flex: 1;
    padding: 10px 14px;
    font-size: 0.9em;
    margin: 0;
    border-radius: 8px;
}

.vote-missing-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 8px 10px;
    margin-top: 4px;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: visible;
}
.vote-missing-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    max-height: 72px;
    overflow-y: auto;
}
.vote-member-tag {
    background: #fff;
    color: var(--theme-color, #334155);
    border: 1.5px solid var(--theme-color, #cbd5e1);
    padding: 3px 10px;
    border-radius: 9999px;
    font-size: 0.8em;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.vote-member-tag .remove-btn {
    position: relative;
    width: 0.8em;
    height: 0.8em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.75;
}
.vote-member-tag .remove-btn::before,
.vote-member-tag .remove-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 0.15em;
    background-color: currentColor;
    border-radius: 0.1em;
}
.vote-member-tag .remove-btn::before { transform: translate(-50%, -50%) rotate(45deg); }
.vote-member-tag .remove-btn::after { transform: translate(-50%, -50%) rotate(-45deg); }

.vote-missing-next-row {
    text-align: right;
    margin-top: 8px;
    flex-shrink: 0;
}
.vote-missing-next-row button {
    padding: 6px 14px;
    font-size: 0.84em;
    border-radius: 6px;
}

.vote-step-final-box {
    text-align: center;
    justify-content: center;
    padding: 12px 0;
}
.vote-finish-icon {
    font-size: 34px;
    color: var(--theme-color, #2196F3);
    margin-bottom: 6px;
}
.vote-help-text {
    font-size: 0.84em;
    color: #64748b;
    margin-bottom: 8px;
}
.vote-turnstile-container {
    display: flex;
    justify-content: center;
    margin: 8px 0 6px;
}
.vote-turnstile-reload-wrapper {
    text-align: center;
    margin-bottom: 6px;
}
.btn-vote-reload-turnstile {
    background: none;
    border: none;
    color: #64748b;
    font-size: 0.78em;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 4px;
    text-decoration: underline;
}

.vote-step-text-pane {
    display: flex;
    flex-direction: column;
    flex: 1 1 0%;
    min-height: 0;
    overflow: hidden;
    background: #fff;
}

.vote-text-pane-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 6px;
    margin-bottom: 6px;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
    gap: 8px;
}

.vote-text-nav-actions {
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-vote-text-nav {
    padding: 4px 10px;
    font-size: 0.8em;
    color: #475569 !important;
    border-color: #cbd5e1 !important;
    border-radius: 6px;
    white-space: nowrap;
}
.btn-vote-text-nav:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
}

.vote-text-pane-header .btn-vote-close-text {
    padding: 5px 12px;
    font-size: 0.84em;
    white-space: nowrap;
    border-radius: 6px;
}

.vote-blog-text-scroll {
    flex: 1 1 0%;
    min-height: 0;
    overflow-y: auto !important;
    padding: 10px 12px;
    font-size: 0.88em;
    line-height: 1.65;
    color: #334155;
    word-break: break-word;
    border: 1px solid #f1f5f9;
    border-radius: 6px;
    background: #fafbfc;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
    overscroll-behavior-y: contain;
}

.vote-blog-text-scroll img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
    margin: 12px auto;
    border-radius: 6px;
    box-sizing: border-box;
}

.vote-blog-text-scroll img.vote-target-image {
    border: 3.5px solid var(--theme-color, #2196F3) !important;
    box-shadow: 0 0 0 2px #ffffff, 0 0 18px var(--theme-color, #2196F3) !important;
    border-radius: 6px;
    animation: targetPulse 1.8s infinite alternate ease-in-out;
}

@keyframes targetPulse {
    0% { transform: scale(1); filter: brightness(1); }
    100% { transform: scale(1.02); filter: brightness(1.08); }
}

.vote-text-pane-footer {
    padding-top: 6px;
    margin-top: 6px;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
}
.vote-text-pane-footer .btn-vote-close-text {
    padding: 6px;
    font-size: 0.84em;
    border-radius: 6px;
}

/* --- モバイル専用表示 --- */
@media (max-width: 768px) {
    .face-vote-modal {
        padding-top: max(28px, env(safe-area-inset-top, 28px));
        padding-bottom: max(28px, env(safe-area-inset-bottom, 28px));
        padding-left: 14px;
        padding-right: 14px;
    }
    .face-vote-container {
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 8px;
    }
    .face-vote-close {
        top: -12px;
        right: -8px;
        width: 30px;
        height: 30px;
        font-size: 20px;
        border-width: 2px;
    }
    .face-vote-content {
        padding: 6px 6px;
    }
    .vote-filter-bar {
        padding: 3px 6px;
        gap: 4px;
        margin-bottom: 4px;
    }
    .vote-filter-title {
        display: none;
    }
    .vote-segmented-controls span {
        padding: 3px 6px;
        font-size: 0.72em;
    }
    .vote-blog-summary {
        padding: 3px 6px;
        margin-bottom: 4px;
    }
    .vote-blog-summary strong {
        font-size: 0.82em;
    }
    .vote-blog-summary span {
        font-size: 0.74em;
    }

    .vote-main-grid {
        flex-direction: column;
        gap: 4px;
    }
    .vote-image-pane {
        flex: 1 1 0;
        min-height: 140px;
        height: auto;
        padding: 4px;
    }
    .vote-rule-notice {
        padding: 4px 6px;
        margin-top: 4px;
        font-size: 0.68em;
        line-height: 1.35;
    }
    .vote-question-pane {
        flex: 0 0 auto;
        max-width: none;
        min-width: 0;
        height: auto;
        padding: 6px 8px;
    }

    .vote-workbench.is-reading-text .vote-image-pane {
        flex: 0 0 30% !important;
        height: 30% !important;
        max-height: 30% !important;
    }
    .vote-workbench.is-reading-text .vote-question-pane {
        flex: 1 1 0% !important;
        height: 70% !important;
        max-height: 70% !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    #vote-candidate-buttons {
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        max-height: none !important;
        padding: 2px 2px 4px 2px;
        gap: 6px;
    }
    #vote-candidate-buttons::-webkit-scrollbar {
        height: 2px !important;
    }
    #vote-candidate-buttons::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 2px;
    }
    .vote-candidate-btn {
        padding: 5px 11px;
        font-size: 0.8em;
        border-radius: 16px;
        min-height: 32px;
    }

    .vote-step-block {
        gap: 4px;
    }
    .vote-question-title {
        font-size: 0.88em;
    }
    .vote-group-label {
        font-size: 0.72em;
        margin-bottom: 2px;
    }
    .vote-nav-actions {
        margin-top: 3px;
        padding-top: 3px;
        gap: 4px;
    }
    .vote-nav-actions button {
        padding: 4px 8px;
        font-size: 0.76em;
    }
    .vote-action-btn {
        padding: 4px 8px;
        font-size: 0.76em;
    }
    .vote-text-nav-actions {
        gap: 3px;
    }
    .btn-vote-text-nav {
        padding: 2px 6px;
        font-size: 0.72em;
    }
    .vote-question-pane .member-search-wrapper .member-search-input {
        padding: 5px 9px;
        font-size: 0.82em;
    }
}