/* ツールチップ */
.term-tip {
    position: relative;
    cursor: help;
    border-bottom: 1px dotted #6c757d;
    white-space: nowrap;
}
.term-tip .tip-text {
    display: none;
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a2e;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: normal;
    line-height: 1.5;
    white-space: normal;
    width: max-content;
    max-width: 260px;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0,0,0,.25);
    pointer-events: none;
}
.term-tip .tip-text::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1a1a2e;
}
.term-tip:hover .tip-text,
.term-tip:active .tip-text,
.term-tip:focus .tip-text {
    display: block;
}

/* モバイル対応 */
@media (max-width: 767.98px) {
    .da-header { flex-direction: column; align-items: flex-start !important; gap: 0.5rem; }
    .da-header .ms-auto { margin-left: 0 !important; }
    .da-header h1 { font-size: 1.25rem; }
    .da-params .row { flex-direction: column; }
    .da-params .col-auto { width: 100%; }
    .da-params select, .da-params input { width: 100% !important; }
    .da-params button { width: 100%; }
    .da-result-header { flex-direction: column; gap: 0.5rem; align-items: flex-start !important; }
    .da-result-header .ms-auto { margin-left: 0 !important; width: 100%; }
    .da-result-header .ms-auto select { width: 100% !important; }

    /* カード表示（モバイル） */
    .da-table-wrap table { display: none; }
    .da-card-list { display: block !important; }
    .da-card-item {
        border: 1px solid #dee2e6;
        border-radius: 8px;
        padding: 12px;
        margin-bottom: 10px;
        background: #fff;
    }
    .da-card-item.is-top3 { background: #fff8e1; border-color: #ffc107; }
    .da-card-item .card-rank { font-size: 1.1rem; font-weight: 700; }
    .da-card-item .card-label { font-weight: 600; margin-bottom: 6px; }
    .da-card-item .card-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; font-size: 0.85rem; }
    .da-card-item .card-metrics dt { color: #6c757d; margin: 0; }
    .da-card-item .card-metrics dd { margin: 0; text-align: right; font-weight: 600; }
}
@media (min-width: 768px) {
    .da-card-list { display: none !important; }
}

/* ソートヘッダー */
th[data-sort] {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
th[data-sort]:hover { background: #2c3e50; }
.sort-icon { opacity: 0.45; font-size: .75em; }
th.sort-active .sort-icon { opacity: 1; color: #ffc107; }

/* フィルタパネル */
#filter-panel { background: #f8f9fa; border-bottom: 1px solid #dee2e6; }
#filter-panel label { font-size: .75rem; color: #6c757d; margin-bottom: 2px; display: block; }
.filter-badge { font-size: .7rem; vertical-align: middle; }
