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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    text-align: center;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 300;
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.content {
    padding: 40px;
}

.error {
    background: #fee;
    color: #c33;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    font-size: 1.1rem;
}

.section {
    margin-bottom: 50px;
}

.section-title {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 30px;
    margin-top: 40px;
    padding-bottom: 10px;
    border-bottom: 3px solid #667eea;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 50px;
    height: 3px;
    background: #764ba2;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card.positive {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.stat-card.negative {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.stat-card.repeat {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: #333;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 1rem;
    opacity: 0.9;
}

.table-container {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 500;
}

.data-table td {
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.data-table tr:hover {
    background: #f8f9fa;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 5px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
}

.chart-container {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.chart-title {
    font-size: 1.3rem;
    color: #333;
    margin-bottom: 20px;
    margin-top: 20px;
    text-align: center;
}

.repeat-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.repeat-card {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.repeat-card:hover {
    transform: translateY(-3px);
}

.repeat-number {
    font-size: 2rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
}

.repeat-label {
    font-size: 0.9rem;
    color: #666;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }
    
    .content {
        padding: 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .repeat-stats {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .data-table {
        font-size: 0.9rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 10px;
    }
}

/* Details/Summary スタイル */
details {
    margin-bottom: 20px;
}

details summary {
    cursor: pointer;
    padding: 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

details summary:hover {
    background: #e9ecef;
}

details[open] summary {
    border-bottom: 2px solid #667eea;
}

/* チャートコンテナの高さ調整 */
.chart-container canvas {
    width: 100% !important;
    height: auto !important;
    display: block;
}

/* タブナビゲーション */
.tab-navigation {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    background: white;
    border-radius: 15px;
    padding: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.tab-button {
    background: none;
    border: none;
    padding: 12px 24px;
    margin: 0 5px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: #666;
    transition: all 0.3s ease;
}

.tab-button:hover {
    background: #f0f0f0;
    color: #333;
}

.tab-button.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.5s ease-in-out;
}



.messages-container {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.messages-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.messages-header h3 {
    color: #333;
    font-size: 1.3rem;
    margin: 0;
}

.messages-count {
    background: #f8f9fa;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

.messages-list-detailed {
    /* セクション内スクロールを削除し、画面全体スクロールに変更 */
    /* max-height: 600px; */
    /* overflow-y: auto; */
}

.message-item-detailed {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
}

.message-item-detailed:hover {
    background: #f0f0f0;
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.message-header-detailed {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.message-date {
    font-size: 0.9rem;
    color: #666;
}

.message-sentiment {
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

.message-sentiment.positive {
    background: #d4edda;
    color: #155724;
}

.message-sentiment.neutral {
    background: #e2e3e5;
    color: #383d41;
}

.message-sentiment.negative {
    background: #f8d7da;
    color: #721c24;
}

.message-content-detailed {
    font-size: 1rem;
    line-height: 1.6;
    color: #333;
    margin-bottom: 15px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.message-participants {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.message-sender,
.message-recipient {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.message-arrow {
    color: #667eea;
    font-weight: bold;
}

.message-tags,
.message-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.message-tag {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.message-action {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    color: #333;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.no-messages {
    text-align: center;
    color: #666;
    padding: 40px;
    font-size: 1.1rem;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .repeater-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .repeater-count {
        align-self: flex-end;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .modal-header {
        padding: 15px 20px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .user-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .tab-navigation {
        flex-direction: column;
        gap: 10px;
    }
    
    .tab-button {
        margin: 0;
        width: 100%;
    }
    
    .filter-container {
        justify-content: flex-start;
    }
    
    .filter-btn {
        font-size: 0.8rem;
        padding: 6px 12px;
    }
    
    .messages-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .message-participants {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .message-arrow {
        transform: rotate(90deg);
    }
    
    .message-item-detailed {
        padding: 15px;
    }
    
    .message-content-detailed {
        font-size: 0.9rem;
    }
}

/* フィルタセクション */
.filter-section {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.filter-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.filter-label {
    font-weight: 600;
    color: #333;
    font-size: 1rem;
}

.filter-select {
    padding: 10px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background: white;
    font-size: 1rem;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 150px;
}

.filter-select:hover {
    border-color: #667eea;
}

.filter-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.shop-selector {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .filter-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .shop-selector {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .filter-select {
        min-width: auto;
    }
} 

.chart-section h2 {
    margin-left: 24px;
} 

.view-mode-btn {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    color: #667eea;
    font-size: 1rem;
    font-weight: 600;
    padding: 10px 24px;
    border-radius: 8px;
    margin-right: 10px;
    cursor: pointer;
    transition: all 0.2s;
}
.view-mode-btn.active, .view-mode-btn:active {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
}
.view-mode-btn:hover {
    background: #e0e7ff;
    color: #333;
} 

.shop-button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 5px;
}
.shop-button {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    color: #764ba2;
    font-size: 1rem;
    font-weight: 500;
    padding: 8px 18px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}
.shop-button.active, .shop-button:active {
    background: #764ba2;
    color: #fff;
    border-color: #764ba2;
}
.shop-button:hover {
    background: #667eea;
    transform: translateY(-2px);
}

/* リピーター関連のスタイル */
.repeater-list-container {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    margin-top: 20px;
}

.repeater-list-container h3 {
    font-size: 1.3rem;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

.repeater-list {
    display: grid;
    gap: 15px;
}

.repeater-item {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.repeater-item:hover {
    background: #e3f2fd;
    border-color: #2196f3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(33, 150, 243, 0.3);
}

.repeater-info {
    flex: 1;
}

.repeater-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.repeater-icon {
    font-size: 1.3rem;
}

.user-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    vertical-align: middle;
    margin-right: 4px;
}

.staff-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    vertical-align: middle;
    margin-right: 4px;
}

.repeater-details {
    font-size: 0.9rem;
    color: #666;
}

.repeater-count {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    min-width: 60px;
    text-align: center;
}

/* モーダル関連のスタイル */
.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 ease;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    animation: slideIn 0.3s ease;
}

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

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.close {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.close:hover {
    opacity: 0.7;
}

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

.user-info {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    border-left: 4px solid #667eea;
}

.user-info h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 1.2rem;
}

.user-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.user-stat {
    text-align: center;
    padding: 10px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.user-stat-number {
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
}

.user-stat-label {
    font-size: 0.8rem;
    color: #666;
    margin-top: 5px;
}

.messages-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    transition: all 0.3s ease;
}

.message-item:hover {
    border-color: #667eea;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.1);
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.message-date {
    font-size: 0.9rem;
    color: #666;
}

.message-sentiment {
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
}

.message-sentiment.positive {
    background: #e8f5e8;
    color: #2e7d32;
}

.message-sentiment.neutral {
    background: #f5f5f5;
    color: #666;
}

.message-sentiment.negative {
    background: #f8d7da;
    color: #721c24;
}

.message-content {
    font-size: 1rem;
    line-height: 1.5;
    color: #333;
    margin-bottom: 10px;
}

.message-recipient {
    font-size: 0.9rem;
    color: #666;
    display: flex;
    align-items: center;
    gap: 5px;
}

.message-recipient-icon {
    font-size: 1.1rem;
}

/* 返信と感謝のスタイル */
.message-replies,
.message-thanks {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

.replies-header,
.thanks-header {
    font-size: 0.9rem;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 10px;
}

.reply-item,
.thank-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    border-left: 3px solid #667eea;
}

.reply-content,
.thank-content {
    font-size: 0.95rem;
    line-height: 1.4;
    color: #333;
    margin-bottom: 5px;
}

.reply-date,
.thank-date {
    font-size: 0.8rem;
    color: #666;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .repeater-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .repeater-count {
        align-self: flex-end;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .modal-header {
        padding: 15px 20px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .user-stats {
        grid-template-columns: repeat(2, 1fr);
    }
} 

/* 追加分析データ用スタイル */
.analysis-info {
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 25px;
    margin-top: 10px;
    font-size: 0.9rem;
}

.detailed-analysis-content {
    display: grid;
    gap: 30px;
}

.analysis-summary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.analysis-summary h3 {
    margin-bottom: 10px;
    font-size: 1.3rem;
    text-align: center;
}

.analysis-timestamp {
    text-align: center;
    margin-bottom: 20px;
    color: #666;
    font-size: 0.9rem;
}

.analysis-timestamp small {
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.summary-stats .stat-card {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    transition: transform 0.3s ease;
}

.summary-stats .stat-card:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.3);
}

.summary-stats .stat-number {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.summary-stats .stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.analysis-report {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.analysis-report h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.3rem;
    text-align: center;
}

.report-content {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.report-content pre {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #333;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0;
}

.tag-details,
.action-details,
.keyword-details {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.tag-details h3,
.action-details h3,
.keyword-details h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.2rem;
    text-align: center;
}

.tag-list,
.action-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-start;
}

.keyword-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.tag-item,
.action-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 20px;
    transition: all 0.3s ease;
    min-width: fit-content;
    max-width: 300px;
    border: 1px solid #e9ecef;
}

.tag-item:hover,
.action-item:hover {
    background: #e9ecef;
}

.keyword-item {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.2);
}

.keyword-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.keyword-item:hover::before {
    left: 100%;
}

.keyword-item:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.3);
}

.keyword-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}

.keyword-name {
    font-weight: bold;
    color: white;
    font-size: 1.2rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.keyword-count {
    background: rgba(255, 255, 255, 0.9);
    color: #667eea;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.keyword-synonyms,
.keyword-examples {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    line-height: 1.5;
    position: relative;
    z-index: 1;
}

.keyword-synonyms small,
.keyword-examples small {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 8px;
    border-radius: 8px;
    display: inline-block;
    margin: 2px 4px 2px 0;
    backdrop-filter: blur(10px);
}

.tag-name,
.action-name {
    font-weight: 500;
    color: #333;
    margin-right: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.tag-count,
.action-count {
    background: #667eea;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    min-width: fit-content;
    flex-shrink: 0;
}

.staff-actions-container {
    display: grid;
    gap: 30px;
}

.staff-action-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.staff-action-card h4 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.2rem;
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

.action-chart-container {
    height: 200px;
    position: relative;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .summary-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .summary-stats .stat-card {
        padding: 15px;
    }
    
    .summary-stats .stat-number {
        font-size: 1.5rem;
    }
    
    .summary-stats .stat-label {
        font-size: 0.8rem;
    }
    
    .tag-item,
    .action-item {
        padding: 6px 10px;
        max-width: 250px;
    }
    
    .tag-name,
    .action-name {
        max-width: 150px;
        font-size: 0.85rem;
    }
    
    .tag-count,
    .action-count {
        font-size: 0.8rem;
        padding: 3px 6px;
    }
    
    .keyword-list {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .keyword-item {
        padding: 15px;
    }
    
    .keyword-name {
        font-size: 1.1rem;
    }
    
    .keyword-count {
        font-size: 0.8rem;
        padding: 4px 8px;
    }
    
    .staff-action-card {
        padding: 20px;
    }
    
    .action-chart-container {
        height: 180px;
    }
}

@media (max-width: 480px) {
    .summary-stats {
        grid-template-columns: 1fr;
    }
    
    .detailed-analysis-content {
        gap: 20px;
    }
    
    .analysis-summary,
    .analysis-report {
        padding: 20px;
    }
} 

/* 詳細タブ用スタイル */
.filter-section-detailed {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.filter-group {
    margin-bottom: 25px;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-group h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.1rem;
    text-align: center;
}

.filter-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.filter-btn {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #666;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: #e9ecef;
    border-color: #667eea;
    color: #667eea;
}

.filter-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* キーワード分析コンテナ */
.keyword-analysis-container {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.keyword-chart-section {
    margin-bottom: 30px;
}

.keyword-chart-section h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.3rem;
    text-align: center;
} 

/* 店舗選択ボタンの固定表示 */
.shop-selector {
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
    z-index: 9999 !important;
    background: white !important;
    border-radius: 15px !important;
    padding: 20px 15px 20px 15px !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2) !important;
    max-width: 250px !important;
    width: 250px !important;
    max-height: 80vh !important;
    overflow-y: auto !important;
    display: flex !important;
    flex-direction: column !important;
}

.shop-selector h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.1rem;
    text-align: left;
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    font-weight: 600;
    border-bottom: 2px solid #667eea;
    padding-bottom: 8px;
    transition: all 0.3s ease;
}

.shop-selector.collapsed h3 {
    margin: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.shop-selector-toggle {
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
}

.shop-selector-toggle:hover {
    color: #667eea;
}

.toggle-icon {
    font-size: 0.8rem;
    margin-left: 5px;
    transition: transform 0.3s ease;
}

.shop-selector.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.shop-selector.collapsed {
    padding: 10px 15px !important;
    max-height: 50px !important;
    overflow: hidden !important;
}

.shop-button-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    overflow-y: auto;
    width: 100%;
}

.shop-button {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #666;
    transition: all 0.3s ease;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    display: block;
}

.shop-button.active, .shop-button:active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.shop-button:hover {
    background: #e9ecef;
    border-color: #667eea;
    color: #667eea;
    transform: none;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .shop-selector {
        position: fixed;
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        width: auto;
        max-height: 60vh;
    }
    
    .shop-button {
        font-size: 0.8rem;
        padding: 6px 10px;
        max-width: 100%;
    }
} 

/* スタッフ別アクション分析のスタイル */
.staff-selector-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.staff-selector-label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
    font-size: 1.1rem;
}

.staff-selector {
    width: 100%;
    max-width: 400px;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.staff-selector:hover {
    border-color: #667eea;
}

.staff-selector:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.staff-chart-display-area {
    min-height: 300px;
    padding: 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.select-prompt {
    text-align: center;
    color: #666;
    font-size: 1.1rem;
    margin: 100px 0;
}

.no-data {
    text-align: center;
    color: #666;
    font-size: 1.1rem;
    margin: 50px 0;
}

.staff-info-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
}

.staff-info-card h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.3rem;
    font-weight: 600;
}

.staff-stats {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

.staff-stats p {
    margin: 8px 0;
    color: #555;
    font-size: 1rem;
}

.staff-stats strong {
    color: #333;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .staff-selector-section {
        padding: 15px;
    }
    
    .staff-selector {
        max-width: 100%;
        font-size: 0.9rem;
        padding: 10px 12px;
    }
    
    .staff-chart-display-area {
        padding: 15px;
        min-height: 250px;
    }
    
    .staff-info-card h4 {
        font-size: 1.1rem;
    }
    
    .staff-stats {
        padding: 12px;
    }
    
    .staff-stats p {
        font-size: 0.9rem;
    }
}

/* 期間選択スタイル */
.period-selector {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
    border: 1px solid #e9ecef;
}

.period-selector h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.2rem;
}

.period-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.period-btn {
    padding: 10px 20px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.period-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.period-btn.active {
    background: #667eea;
    color: white;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}



@media (max-width: 768px) {
    .period-buttons {
        flex-direction: column;
    }
    
    .period-btn {
        text-align: center;
    }
}

/* スタッフ分析専用スタイル */
.staff-analysis-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.staff-info-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.staff-info-card h3 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    text-align: center;
}

.staff-stats .stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.staff-stats .stat-item {
    text-align: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.staff-stats .stat-number {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
}

.staff-stats .stat-label {
    font-size: 0.9rem;
    color: #666;
    opacity: 0.9;
}

.staff-action-analysis,
.staff-tag-analysis {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.staff-action-analysis h3,
.staff-tag-analysis h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.staff-action-analysis .chart-container,
.staff-tag-analysis .chart-container {
    height: 300px;
    margin-bottom: 20px;
}

.action-details,
.tag-details {
    margin-top: 20px;
}

.action-details h4,
.tag-details h4 {
    color: #666;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.action-list,
.tag-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.action-item,
.tag-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.action-item:hover,
.tag-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
    transition: all 0.3s ease;
}

.action-name,
.tag-name {
    font-weight: 500;
    color: #333;
}

.action-count,
.tag-count {
    background: #667eea;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
}

.staff-report {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.staff-report h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.staff-report .report-content {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.staff-report h4 {
    color: #667eea;
    margin: 15px 0 10px 0;
    font-size: 1.2rem;
}

.staff-report h5 {
    color: #333;
    margin: 20px 0 10px 0;
    font-size: 1.1rem;
}

.staff-report ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

.staff-report li {
    margin-bottom: 5px;
    color: #555;
}

.report-summary {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.report-summary p {
    margin: 5px 0;
    color: #333;
}

.analysis-section {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid #007bff;
}

.analysis-section h6 {
    color: #007bff;
    margin-bottom: 10px;
    font-weight: 600;
}

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

.analysis-section li {
    margin-bottom: 5px;
    color: #333;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 15px;
    border: 1px solid #f5c6cb;
}

.action-analysis {
    background: #e9ecef;
    padding: 10px;
    border-radius: 5px;
    margin-top: 10px;
}

.no-data-message {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 20px;
}

/* スタッフ言及タブのスタイル */
.mentions-summary {
    margin-bottom: 30px;
    padding: 0 20px;
}

.mentions-summary .summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.mentions-summary .stat-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.mentions-summary .stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
    border-color: #667eea;
}

.mentions-summary .stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 10px;
    display: block;
}

.mentions-summary .stat-label {
    color: #666;
    font-size: 1rem;
    font-weight: 500;
}

.all-mentioned-staff {
    margin-top: 30px;
    padding: 0 20px;
}

.all-mentioned-staff h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.3rem;
}

.staff-mention-list {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 #f1f1f1;
}

.staff-mention-list::-webkit-scrollbar {
    height: 8px;
}

.staff-mention-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.staff-mention-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.staff-mention-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.staff-mention-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    min-width: 180px;
    flex-shrink: 0;
    text-align: center;
}

.staff-name {
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
}



.mentioned-messages-section {
    margin-top: 30px;
    padding: 0 20px;
}

.mentioned-messages-section h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.3rem;
}

.message-filter {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.95em;
    color: #495057;
    user-select: none;
}

.filter-checkbox input[type="checkbox"] {
    margin-right: 8px;
    width: 16px;
    height: 16px;
    cursor: pointer;
}





/* スタッフ言及タブ全体のスタイル */
#mentions-tab .chart-section {
    padding: 30px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    max-width: 100%;
    box-sizing: border-box;
}

#mentions-tab .chart-section h2 {
    color: #333;
    margin-bottom: 25px;
    font-size: 1.5rem;
    text-align: center;
    border-bottom: 2px solid #667eea;
    padding-bottom: 15px;
}

.mentioned-message-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
}

.message-destination-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
    min-width: fit-content;
}

.message-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    flex: 1;
}

.message-number {
    background: #007bff;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.9em;
    font-weight: bold;
}

.message-sender {
    color: #495057;
    font-weight: 500;
}

.message-date {
    color: #6c757d;
    font-size: 0.9em;
}

.original-destination {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #e8f5e8;
    padding: 6px 12px;
    border-radius: 15px;
    border: 1px solid #c8e6c9;
    font-size: 0.9em;
    color: #1b5e20;
    font-weight: 600;
}

.mentioned-staff-tags {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
    min-width: fit-content;
}

.tags-label {
    font-size: 0.9em;
    color: #1976d2;
    font-weight: 500;
}

.staff-tag {
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 500;
    border: 1px solid #bbdefb;
}

.message-content {
    margin-bottom: 15px;
}

.content-text {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    line-height: 1.6;
    color: #495057;
    border-left: 4px solid #007bff;
}

.staff-highlight {
    background: #fff3cd;
    color: #856404;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
}

.mention-details {
    border-top: 1px solid #e9ecef;
    padding-top: 15px;
}

.mention-detail {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 8px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 5px;
}

.mention-staff {
    font-weight: 600;
    color: #495057;
    min-width: 120px;
}

.mention-context {
    color: #6c757d;
    flex: 1;
}

.mention-confidence {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 500;
}

.confidence-高 {
    background: #d4edda;
    color: #155724;
}

.confidence-中 {
    background: #fff3cd;
    color: #856404;
}

.confidence-低 {
    background: #f8d7da;
    color: #721c24;
}

.no-mentions {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px dashed #dee2e6;
}

.no-mentions-message {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px dashed #dee2e6;
    margin-top: 30px;
}

.no-mentions-message h3 {
    color: #495057;
    margin-bottom: 15px;
}

.no-mentions-message p {
    margin: 0;
    font-size: 1.1em;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .staff-stats .stat-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .staff-stats .stat-number {
        font-size: 1.5rem;
    }
    
    .staff-stats .stat-label {
        font-size: 0.8rem;
    }
    
    .action-list,
    .tag-list {
        grid-template-columns: 1fr;
    }
    
    .staff-action-analysis,
    .staff-tag-analysis,
    .staff-report {
        padding: 20px;
    }
    
    .staff-info-card {
        padding: 20px;
    }
    
    .staff-info-card h3 {
        font-size: 1.5rem;
    }
}

/* エラー表示スタイル */
.error-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.error-modal {
    background: white;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    max-width: 500px;
    margin: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.error-modal h2 {
    color: #e74c3c;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.error-modal p {
    color: #333;
    margin-bottom: 30px;
    line-height: 1.6;
}

.error-modal button {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s ease;
}

.error-modal button:hover {
    background: #5a6fd8;
} 