#sub_header {
    width: 800px;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
    margin-bottom: 10px;
}

#sub_header > h2 {
    margin: 0;
    font-size: 1.25em;
}

#sub_header > a {
    font-size: 1.25em;
    color: #36f;
    text-decoration: none;
    display: flex;
}

#summary {
    border-collapse: collapse;
    width: 800px;
    font-size: 14px;
    border: 1px solid #ccc;
    margin-top: 0;
    margin-bottom: 10px;
}

#summary > thead {
    position: sticky;
    top: 65px; /* 分類選択部分の高さ分下に配置 */
    z-index: 2;
}

#summary > thead > tr > th {
    border: 1px solid #ccc;
    background: #666;
    color: #fff;
    width: 34px;
    padding: 8px 4px;
}

#summary > thead > tr > th:nth-of-type(1) {
    width: 50px;
}

#summary > thead > tr > th:nth-of-type(2) {
    width: auto;
    text-align: left;
    padding-left: 10px;
}

#summary > thead > tr > th:last-of-type {
    width: 60px;
}

#summary > thead > tr > th > div {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}
#summary > thead > tr > th span {
    margin-right: 5px;
}

#summary > thead > tr > th,
#summary > tbody > tr > td{
    font-weight: normal;
    padding: 2px 4px;
    text-align: center;
    vertical-align: top;
    border: 1px solid #ccc;
}

#summary > tbody > tr > td {
    padding: 6px 4px;
    vertical-align: middle;
}

#summary > tbody > tr > td.type {
    text-align: left;
    padding-left: 10px;
}

#summary > tbody > tr > td.type .sub-label {
    font-size: 0.75em;
}

#summary > tbody > tr:hover {
    background-color: #f5f5f5;
}

#summary > tbody > tr > td.year-header {
    background-color: #f8f8f8;
    font-weight: bold;
}

#summary > tbody > tr > td:last-child {
    background-color: #f8f8f8;
    font-weight: bold;
}

#summary > tbody > tr > td.year-header[rowspan]:not([rowspan="1"]),
#summary > tbody > tr.year-divider > td {
    border-bottom: 1px solid #333;
}

#summary > tbody > tr:nth-of-type(1) td:nth-of-type(1) {
    border-top: 1px solid #ccc;
}

#summary > tbody > tr > td.last-of-year {
    border-bottom: 1px solid #ccc;
}

#summary > tbody > tr.alternate > td {
    background-color: #f9f9f9;
}

#summary > tbody > tr.multi10 > td {
    border-bottom: 1px solid #333;
}

#grouping-container {
    position: sticky;
    top: 0;
    z-index: 10;
    background: white;
    height: 65px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#grouping {
    font-size: 14px;
    padding: 8px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 800px; /* テーブルと同じ幅 */
}

#grouping > span {
    font-weight: bold;
}

#buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

#grouping .toggle-label {
    display: flex;
    flex-direction: column;
    margin: 0 5px;
    border: 1px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
    background: #f9f9f9;
    user-select: none;
    width: 120px;
    padding: 5px 0;
}

#grouping .toggle-label .label-container {
    display: flex;
    align-items: center;
}

#grouping .toggle-label input[type="checkbox"] {
    width: 30%;
    margin: 0;
    display: flex;
    justify-content: center;
}

#grouping .toggle-label .main-label {
    width: 70%;
    text-align: left;
    padding-left: 5px;
}

#grouping .toggle-label .sub-label {
    font-size: 0.65em;
    padding: 0 10px;
}

#grouping .toggle-label.checked {
    background: #36c;
    color: white;
    border-color: #36c;
}

#grouping .toggle-label.checked input[type="checkbox"] {
    accent-color: white;
}

/* 分類に基づく背景色 */
/* 発生 */
#summary > tbody > tr:has(td.type:contains("発生")) {
    background-color: rgba(255, 240, 240, 0.7); /* 薄い赤 */
}
/* 接近（全国） */
#summary > tbody > tr:has(td.type:contains("接近（全国）")) {
    background-color: rgba(240, 255, 240, 0.7); /* 薄い緑 */
}
/* 接近（本土） */
#summary > tbody > tr:has(td.type:contains("接近（本土）")) {
    background-color: rgba(240, 240, 255, 0.7); /* 薄い青 */
}
/* 接近（沖縄・奄美） */
#summary > tbody > tr:has(td.type:contains("接近（沖縄・奄美）")) {
    background-color: rgba(255, 255, 240, 0.7); /* 薄い黄色 */
}
/* 上陸数 */
#summary > tbody > tr:has(td.type:contains("上陸数")) {
    background-color: rgba(255, 240, 255, 0.7); /* 薄い紫 */
}

.info-icon {
    cursor: pointer;
    vertical-align: middle;
}

.info-tooltip {
    display: none;
    position: absolute;
    padding: 5px 10px;
    font-size: 12px;
    z-index: 1000;
    white-space: nowrap;
    background-color: #fff;
    color: #000;
    border : 1px solid #333;
}
