
body {
    line-height: 1.6;
    margin: 20px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: 800px;
    margin: 20px auto;
    font-size: 14px;
}
#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;
}
.table-container {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    margin-bottom: 20px;
    border-bottom: 1px solid #ccc;
}
#elnino_main table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    box-sizing: border-box;
}
#elnino_main thead {
    background-color: #666;
}
#elnino_main th, #elnino_main td {
    border-left: 1px solid #ccc;
    padding: 2px 4px;  
    text-align: left;
    vertical-align: middle;
    box-sizing: border-box;
}
#elnino_main th { 
    color: #fff;
    background-color: #666;
    font-size: 14px;
    font-weight: normal;
    position: sticky;
    top: 0;
    z-index: 99;
}
#elnino_main th:nth-of-type(2) {
    width: 25%;
}
#elnino_main th:nth-of-type(3) {
    width: 20%;
    text-align: right;
}
#elnino_main td:nth-of-type(3) {
    text-align: right;
}
#elnino_main tr {
    cursor: pointer;
    transition: background-color 0.3s ease;
}
#elnino_main tr:hover td:nth-of-type(1),#elnino_main tr:hover td:nth-of-type(3) {
    background-color: #f5f5f5;
}
.elnino {
    background-color: rgba(255,0,0,0.1);
    color: black;
}
.lanina {
    background-color: rgba(0,0,255,0.1);
    color: black;
}
.period-cell {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}
.period-start, .period-end {
    min-width: 80px;
}
.period-separator {
    color: #666;
    margin: 0 16px;
}
.period-months {
    color: #666;
    margin-left: 8px;
}
.note {
    font-size: 14px;
    color: #666;
    margin-top: 20px;
}
.chart-main {
    display: flex;
    align-items: flex-start;
    position: relative;
    user-select: none;

}
.chart-container {
    height: 280px;
    overflow-x: auto;
    overflow-y: hidden;
    position: relative;
    flex-shrink: 0;
    min-width: 0;
    max-width: calc(100% - 60px);
}
.chart-wrapper {
    height: 100%;
    position: relative;
}
.y-axis-container {
    position: sticky;
    left: 0;
    top: 120px; /* 必要に応じて調整 */
    width: 60px;
    height: 280px;
    background-color: white;
    z-index: 10;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.y-axis-label {
    position: absolute;
    left: 0;
    top: 10%;
    writing-mode: vertical-rl;
    transform-origin: left center;
    z-index: 11;
    background-color: white;
    padding: 0 5px;
    white-space: nowrap;
    font-size:14px;
}
.event-boxW {
    fill-opacity: 0.1;
    stroke-width: 1;
    cursor: pointer;
}
.event-boxW {
    transition: fill-opacity 0.3s ease;
}
.event-boxW.elnino {
    fill: red;
}
.event-boxW.lanina {
    fill: blue;
}
.event-boxW.highlight.elnino, .event-boxW.highlight.lanina {
    fill-opacity: 0.5;
}
.event-box.elnino {
    fill-opacity: 0.3;
    fill: red;
}
.event-box.lanina {
    fill-opacity: 0.3;
    fill: blue;
}
.minimap-event-box.elnino {
    fill-opacity: 0.5;
    fill: red;
}
.minimap-event-box.lanina {
    fill-opacity: 0.5;
    fill: blue;
}
.minimap-wrapper {
    height: 70px;
    width: 800px;
    position: relative;
    background: #f5f5f5;
    border-radius: 4px;
    user-select: none;
    margin-top: 10px;
}
.minimap-wrapper svg {
    width: 100%;
    height: 100%;
}
.minimap-viewport {
    fill: rgba(255, 255, 0, 0.1);
    stroke: #FFD700;
    cursor: grab;
}

.chart-container {
    position: relative;
    overflow-x: auto;
    overflow-y: hidden;
}
#elnino_main tr {
    position: relative;
}
#elnino_main td {
    border-left: 1px solid #ccc;
    border-bottom: 1px solid #ccc;
    padding: 6px 4px;
    font-size: 14px;
    text-align: left;
    vertical-align: middle;
}
#elnino_main td:nth-last-of-type() {
    
    border-right: 1px solid #ccc;
}
#elnino_main .highlight .elnino .highlight-border {
    border-color: #f00;
}
#elnino_main .highlight .lanina .highlight-border {
    border-color: #00f;
}
#elnino_main .highlight-border {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 3px solid transparent;
    transition: border-color 0.3s ease;
    pointer-events: none;
}
.dot {
    stroke-width: 1;
    stroke: #fff;
}
.dot.elnino {
    fill: red;
}
.dot.lanina {
    fill: blue;
}
.dot.normal {
    fill: #808080;
}
.threshold-line {
    stroke-width: 1;
}
.threshold-line.elnino {
    stroke: rgba(255, 0, 0, 0.6);
}
.threshold-line.lanina {
    stroke: rgba(0, 0, 255, 0.6);
}
.zero-line {
    stroke: #000;
    stroke-width: 0.5;
}
.axis-line {
    stroke-width: 1;
}
.xgrid-line {
    stroke: #333;
    stroke-width: 1;
    stroke-dasharray: 2,4;
}
.ygrid-line {
    stroke: #ccc;
    stroke-width: 0.5;
}
.ygrid-line-zero {
    stroke: #000;
    stroke-width: 0.5;
}
.axis-text {
    font-size: 12px;
}
#elnino_main tr.highlight.elnino {
    background-color: #fff0f0;
}
#elnino_main tr.highlight.lanina {
    background-color: #eeffff;
}
