.filter-section {
    background: #f8f9fa;
    padding: 15px;
    margin: 20px 0;
    border-radius: 5px;
    border: 1px solid #dee2e6;
}
.filter-group {
    margin-bottom: 15px;
}
.filter-group label {
    display: inline-block;
    margin-right: 15px;
    cursor: pointer;
}
.search-box {
    width: 100%;
    max-width: 400px;
    padding: 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}
.btn {
    padding: 8px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}
.btn-primary {
    background: #007bff;
    color: white;
}
.btn-secondary {
    background: #6c757d;
    color: white;
    margin-left: 10px;
}
/*追加*/
.btn-container {
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
}

.btn-success {
    background: #28a745;
    color: white;
    margin-left: 10px;
}
/*追加*/
.check-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 6px 16px;
    padding: 6px 10px;
}
/*追加*/
.check-group label {
    display: flex;
    align-items: flex-start; 
    gap: 6px;
    overflow-wrap: break-word; 
    line-height: 1.4;
}

/* ▼ フィルター折りたたみボタン（スマホ用） */
.filter-toggle-btn {
    display: none;
    width: 100%;
    padding: 10px;
    background: #003a70;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    text-align: left;
    margin-bottom: 10px;
}
.filter-toggle-btn::after {
    content: ' ▼';
    float: right;
}
.filter-toggle-btn.collapsed::after {
    content: ' ▲';
}
.filter-body {
    display: block;
}

.table-wrapper {
    background: white;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #dee2e6;
    margin: 20px 0;
}
.scroll-hint {
    display: none;
    text-align: center;
    font-size: 11px;
    color: #888;
    background: #f8f9fa;
    padding: 5px;
    border-bottom: 1px solid #dee2e6;
}
.table-scroll-area {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
table#labTable {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
    background: white;
}
table#labTable th {
    background: #003a70;
    color: white;
    padding: 12px 8px;
    text-align: left;
    font-weight: bold;
    position: sticky;
    top: 0;
    z-index: 10;
    user-select: none;
}
#labTable th.sortable {
    cursor: pointer;
}
#labTable th.sortable:hover {
    background: #00559d;
}
#labTable th.sortable .th-label::after {
    content: ' ⇅';
    opacity: 0.5;
}
#labTable th.sort-asc .th-label::after {
    content: ' ▲';
    opacity: 1;
}
#labTable th.sort-desc .th-label::after {
    content: ' ▼';
    opacity: 1;
}
#labTable td {
    padding: 10px 8px;
    border: 1px solid #dee2e6;
}
#labTable tr:nth-child(even) {
    background: none;
}
#labTable tr.group-hover td {
    background: #e9ecef;
}
#labTable tr.group-separator td {
    padding: 0;
    height: 1px;
    background-color: #e0e0e0;
    border: none;
}
#labTable td.group-cell {
    border-right: 1px solid #dee2e6;
    background: none;
    vertical-align: top;
}

.pdf-link {
    color: #dc3545;
    text-decoration: none;
}

.pagination {
    margin: 20px 0;
    text-align: center;
    display: flex;
    flex-wrap: wrap;        /* ボタンを折り返す */
    justify-content: center;
    gap: 4px;
}
.pagination button {
    padding: 6px 12px;
    margin: 0;              /* gap で管理するので margin: 0 2px → 0 に */
    border: 1px solid #dee2e6;
    background: white;
    cursor: pointer;
    flex-shrink: 0;         /* ボタンが縮まないように */
    min-width: 36px;        /* タップしやすいサイズ確保 */
}
.pagination button:hover {
    background: #e9ecef;
}
.pagination button.active {
    background: #003a70;
    color: white;
    border-color: #003a70;
}
.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.result-info {
    margin: 10px 0;
    font-size: 1.3em;
    color: #1a0399;
    font-weight: bold;
}
#pageSize {
    font-size: 0.9em;
}

select {
    padding: 6px;
    border: 1px solid #ced4da;
    border-radius: 4px;
}

/* オートフィルター */
#labTable th {
    position: relative;
}
#labTable th .th-content {
    display: flex;
    align-items: center;
    gap: 4px;
}
#labTable th .th-label {
    flex: 1;
}
.autofilter-btn {
    background: none;
    border: 1px solid rgba(255,255,255,0.4);
    color: white;
    cursor: pointer;
    padding: 1px 4px;
    font-size: 10px;
    border-radius: 3px;
    line-height: 1;
    flex-shrink: 0;
}
.autofilter-btn:hover {
    background: rgba(255,255,255,0.2);
}
.autofilter-btn.active {
    background: #ffc107;
    color: #003a70;
    border-color: #ffc107;
}
.autofilter-dropdown {
    display: none;
    position: absolute;
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    min-width: 220px;
    max-width: 350px;
    color: #333;
    font-weight: normal;
    text-align: left;
}
.autofilter-dropdown.show {
    display: block;
}
.autofilter-search {
    width: calc(100% - 16px);
    margin: 8px;
    padding: 5px 8px;
    border: 1px solid #ced4da;
    border-radius: 3px;
    font-size: 12px;
    box-sizing: border-box;
}
.autofilter-list {
    max-height: 250px;
    overflow-y: auto;
    padding: 0 8px;
}
.autofilter-list label {
    display: block;
    padding: 3px 0;
    cursor: pointer;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.autofilter-list label:hover {
    background: #f0f0f0;
}
.autofilter-list input[type="checkbox"] {
    margin-right: 6px;
}
.autofilter-actions {
    display: flex;
    gap: 6px;
    padding: 8px;
    border-top: 1px solid #eee;
}
.autofilter-actions button {
    flex: 1;
    padding: 5px 10px;
    border: 1px solid #ccc;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}
.autofilter-actions .af-apply {
    background: #007bff;
    color: white;
    border-color: #007bff;
}
.autofilter-actions .af-clear {
    background: #f8f9fa;
}
.autofilter-selectall {
    padding: 4px 8px;
    border-bottom: 1px solid #eee;
    font-size: 12px;
}
.autofilter-selectall label {
    cursor: pointer;
}
.filter-group {
    margin-bottom: 15px;
    display: block;
}

#dynamicFilters {
    border: 1px solid #ccc;
    border-radius: 4px;
    overflow: hidden;
    margin: 10px;
}
#dynamicFilters .filter-group {
    display: grid;
    grid-template-columns: 160px 1fr;
    align-items: center;
    margin-bottom: 0;
    border-bottom: 1px solid #e0e0e0;
    min-height: 38px;
}
#dynamicFilters .filter-group:last-child {
    border-bottom: none;
}
#dynamicFilters .filter-group strong {
    background: #f0f4f8;
    padding: 8px 12px;
    font-size: 13px;
    color: #333;
    border-right: 1px solid #ccc;
    align-self: stretch;
    display: flex;
    align-items: center;
}
#dynamicFilters .filter-group select {
    max-width: 280px;
    margin: 6px 10px;
}
#dynamicFilters .filter-group > label {
    padding: 6px 10px;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
}
/* TOPへ戻るボタン */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 20px;
    background: #004098;
    color: white;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    font-size: 20px;
    cursor: pointer;
    display: none;   
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    z-index: 10000;
    transition: opacity 0.3s;
}
.back-to-top.visible {
    display: flex;
}
.back-to-top:hover {
    background: #00559d;
}
#labTable {
    margin-top: 0 !important;
}
#labTable caption {
    padding: 0;
    font-size: 0;
    line-height: 0;
    height: 0;
}
/* ============================================================
   スマートフォン対応（768px以下）
============================================================ */
@media (max-width: 768px) {
    #header {
        min-height: 0 !important;
    }
    .search-box { max-width: 100%; }
    #clearBtn { margin-left: 0; margin-top: 8px; }
    #dynamicFilters .filter-group {
        display: block; 
        margin-bottom: 8px;
    }
    #dynamicFilters .filter-group strong {
        display: block; 
        border-right: none;
        border-bottom: 1px solid #ccc;
        margin-bottom: 4px;
        padding: 6px 8px;
    }
    #dynamicFilters .filter-group select {
        width: 98%; 
        max-width: 100%;
        box-sizing: border-box;
        margin: 4px;
    }
    #dynamicFilters .filter-group > label {
        padding: 4px 8px;
    }
    /* テーブルを横スクロール */
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .filter-toggle-btn { display: block; }
    .filter-body { display: none; padding-top: 12px; }
    .filter-body.open { display: block; }
    .scroll-hint { display: block; }
    .result-info { flex-direction: column; align-items: flex-start; gap: 6px; }
    .noside .heading { background-image: none; }
}

/* ============================================================
   タブレット対応（820px以下）
============================================================ */

@media screen and (max-width: 820px) {
    .scroll-hint { display: block; }
}


/* ============================================================
   タブレット対応（1083px以下）
============================================================ */

@media screen and (max-width: 1083px) {
    .noside .heading { background-image: none; }
}

/* ============================================================
   アクセシビリティ（JIS X 8341-3:2016）
============================================================ */

/* スクリーンリーダー専用（視覚的に非表示） */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* スキップリンク（フォーカス時のみ表示） */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #003a70;
    color: white;
    padding: 8px 16px;
    z-index: 9999;
    text-decoration: none;
    font-size: 14px;
    border-radius: 0 0 4px 4px;
}
.skip-link:focus {
    top: 0;
}

/* フォーカスの可視化（キーボード操作時） */
:focus-visible {
    outline: 3px solid #005fcc;
    outline-offset: 2px;
}

/* ============================================================
   本番CSS（/common/css/style.css）との競合対策
   詳細度を上げて本番CSSのスタイルを上書き
============================================================ */

/* カスタムCSSの table { width:100%; min-width:900px; } がヘッダーの文字サイズ変更テーブルに波及するのを防ぐ */
.text-changer dd table {
    width: auto;
    min-width: 0;
    background: none;
}

/* 本番CSSの .main table thead th { background-color: #ccc; } を上書き */
.main #labTable thead th {
    background: #004098;
    color: white;
    padding: 12px 8px;
}

/* 本番CSSの .main table th, .main table td { padding/border } を上書き */
.main #labTable td {
    padding: 10px 8px;
    border: 1px solid #dee2e6;
}

/* ============================================================
   英語版専用：モバイルナビ 1カラム化
   html[lang="en"] で英語版ページのみに適用
============================================================ */
@media screen and (max-width: 1083px) {
    html[lang="en"] #navi-global--sp ul li {
        width: 100%;
        float: none;
    }
    html[lang="en"] #navi-global--sp ul li a {
        height: auto;
        min-height: 60px;
        line-height: 1.4;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 10px 15px;
    }
}

/* ============================================================
   カスケードグループ連動表示
============================================================ */
/* 連動グループ最初の行の上に区切り線 */
#dynamicFilters .filter-group.cascade-first {
    border-top: 2px solid #c0cfe8;
}
/* 連動グループのラベル背景をわずかに変える */
#dynamicFilters .filter-group.cascade-group-item strong {
    background: #e8f0f8;
}
/* 連動グループ最後の行の下に区切り線（次に通常フィルターが続く場合） */
#dynamicFilters .filter-group.cascade-last {
    border-bottom: 2px solid #c0cfe8;
}

#pageDescription{
    white-space: pre-line !important;
}