* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: #222;
    font-family: Arial, "Noto Sans JP", sans-serif;
    background:#fff;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
}

.background-layer {
    display: none;
}

.background-layer::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: .14;
    background-image:
        linear-gradient(90deg, transparent 96%, #fff 96%),
        linear-gradient(transparent 96%, #fff 96%);
    background-size: 45px 45px;
}

.site-width {
    width: 1420px;
    max-width: calc(100% - 40px);
    margin: 0 auto;
}

.site-header {
    padding-top: 16px;
}

.top-bar {
    min-height: 30px;
    background: linear-gradient(90deg, #455bcf, #4b5fe0);
    color: #fff;
}

.top-bar .site-width {
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.phone {
    padding-left: 135px;
    font-size: 12px;
    font-style: italic;
}

.top-arrow {
    padding-right: 130px;
    font-size: 17px;
    font-weight: 700;
}

.header-main {
    background: #fff;
    box-shadow: 0 5px 15px rgba(30, 58, 91, .17);
}

.header-inner {
    min-height: 62px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    padding-left: 135px;
    color: #20242b;
    font-size: 27px;
    font-weight: 900;
    letter-spacing: -2px;
}

.logo span {
    margin-right: 3px;
}

.main-nav {
    padding-right: 130px;
    display: flex;
    align-items: center;
    gap: 34px;
}

.main-nav a {
    color: #222;
    font-size: 12px;
}

.main-nav a:hover {
    color: #306ddf;
}

.mobile-menu {
    display: none;
    border: 0;
    background: none;
    font-size: 23px;
    cursor: pointer;
}

.main-card {
    margin-top: 15px;
    margin-bottom: 0;
    padding: 14px 12px 35px;
    background: #fff;
    overflow: hidden;
}

.market-section {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.market-heading h1 {
    margin: 0 0 4px;
    font-size: 18px;
}

.price-line {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.current-price {
    color: #ef4444;
    font-size: 31px;
    font-weight: 500;
}

.change-data {
    color: #ef4444;
    font-size: 14px;
}

.market-status {
    margin-top: 2px;
    padding-bottom: 11px;
    color: #9a9a9a;
    font-size: 10px;
    border-bottom: 1px solid #ddd;
}

.chart-panel {
    width: 100%;
    max-width: 100%;
    padding-top: 10px;
}

.chart-controls {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 1px;
}

.chart-controls button {
    height: 22px;
    border: 1px solid #d1d1d1;
    background: #fff;
    color: #555;
    font-size: 9px;
    cursor: pointer;
}

.chart-controls button.active {
    background: #087cf0;
    border-color: #087cf0;
    color: #fff;
}

.chart-area {
    position: relative;
    width: 100%;
    max-width: 100%;
    height: 295px;
    margin-top: 10px;
}

.chart-area canvas {
    width: 100% !important;
    max-width: 100% !important;
}

.market-info {
    width: 100%;
    margin-top: 15px;
    border-top: 1px solid #ddd;
}

.info-row {
    min-height: 34px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    align-items: center;
    border-bottom: 1px solid #eee;
}

.info-row span,
.info-row strong {
    min-width: 0;
    padding: 0 6px;
    font-size: 10px;
}

.info-row span:nth-child(3),
.info-row strong:nth-child(4) {
    text-align: right;
}

.info-row strong {
    font-weight: 500;
}

.result-table {
    width: 100%;
    max-width: 100%;
    margin-top: 14px;
    display: grid;
    grid-template-columns: 1.25fr .9fr 1.15fr .9fr 1.15fr;
    background: #222;
    border-top: 1px solid #161616;
    border-left: 1px solid #161616;
}

.result-cell {
    min-width: 0;
    min-height: 36px;
    padding: 7px 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid #151515;
    border-bottom: 1px solid #151515;
    background: #282828;
    color: #fff;
    font-size: 11px;
    text-align: center;
    line-height: 1.2;
}

.result-head {
    min-height: 34px;
    background: #343434;
    font-weight: 700;
}

.session {
    font-weight: 700;
}

.result-number {
    color: #ffe400;
    font-size: 13px;
    font-weight: 700;
}

.update-date {
    padding-top: 10px;
    color: #aaa;
    text-align: right;
    font-size: 9px;
}

.details-section {
    padding: 22px 0 28px;
}

.details-section > h2 {
    margin: 0 0 20px;
    color: #008dc6;
    text-align: center;
    font-size: 21px;
}

.detail-grid {
    width: 560px;
    max-width: 100%;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px 42px;
}

.detail-item {
    display: flex;
    gap: 14px;
}

.detail-icon {
    width: 42px;
    flex-shrink: 0;
    color: #0092c7;
    font-size: 38px;
    line-height: 1;
}

.detail-item h3 {
    margin: 0 0 7px;
    font-size: 15px;
}

.detail-item p {
    margin: 0;
    color: #555;
    font-size: 11px;
    line-height: 1.7;
}

.history-section {
    width: 100%;
    max-width: 100%;
    padding-top: 5px;
    overflow: hidden;
}

.section-title {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title span {
    width: 4px;
    height: 25px;
    background: #1583ff;
}

.section-title h2 {
    margin: 0;
    font-size: 18px;
}

#loading-status {
    display: block;
    margin: 20px;
    color: #666;
    text-align: center;
    font-weight: bold;
}

.history-responsive {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

#nikkei-history-table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

#nikkei-history-table th,
#nikkei-history-table td {
    text-align: center;
    vertical-align: middle;
}

#nikkei-history-table th {
    height: 34px;
    padding: 7px 5px;
    border: 1px solid #777;
    background: #262626;
    color: #fff;
    font-size: 10px;
    line-height: 1.25;
}

#nikkei-history-table thead tr:nth-child(2) th {
    background: #373737;
    font-weight: 400;
}

#nikkei-history-table td {
    height: 34px;
    padding: 6px 5px;
    border: 1px solid #ddd;
    color: #555;
    font-size: 10px;
    line-height: 1.25;
}

#nikkei-history-table tbody tr:nth-child(even) {
    background: #fbfbfb;
}

#nikkei-history-table tbody td:first-child {
    background: #f1f2f4;
    color: #3d3d3d;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

#nikkei-history-table .result-value {
    color: #0868c8;
    font-size: 12px;
    font-weight: 700;
}

#nikkei-history-table .session-header {
    color: #777;
}

.footer {
    width: 100%;
    margin-top: 0;
    padding: 70px 0 55px;
    background: #126096;
    color: #fff;
}

.footer-content {
    display: grid;
    grid-template-columns: 1.35fr 1fr 0.85fr 0.85fr;
    gap: 90px;
    padding: 0 55px;
    background: transparent;
}


.footer h2 {
    margin: 0 0 22px;
    color: #fff;
    font-size: 29px;
    font-weight: 700;
    line-height: 1.3;
}


.footer h3 {
    margin: 0 0 18px;
    color: #fff;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
}


.footer p {
    margin: 0;
    color: rgba(255, 255, 255, 0.72);
    font-size: 14px;
    line-height: 1.85;
}


.footer-brand p {
    margin: 0;
    color: rgba(255, 255, 255, 0.72);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.85;
}


.footer-column > p + p {
    margin-top: 22px;
}

.copyright {
    margin-top: 75px;
    min-height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #4081ef;
    color: #fff;
    font-size: 10px;
}

.back-top {
    position: fixed;
    right: 18px;
    bottom: 17px;
    width: 25px;
    height: 25px;
    border: 0;
    background: #0875d3;
    color: #fff;
    cursor: pointer;
}

@media (max-width: 900px) {
    .phone,
    .logo {
        padding-left: 20px;
    }

    .top-arrow,
    .main-nav {
        padding-right: 20px;
    }

    .main-nav {
        gap: 15px;
    }

    .chart-controls {
        grid-template-columns: repeat(5, 1fr);
    }

    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 40px 60px;
        padding: 0 30px;
    }
}

@media (max-width: 650px) {
    body {
        width: 100%;
        overflow-x: hidden;
    }

    .site-width {
        width: 100%;
        max-width: calc(100% - 8px);
    }

    .top-bar {
        display: none;
    }

    .site-header {
        padding-top: 0;
    }

    .header-inner {
        position: relative;
    }

    .logo {
        padding-left: 4px;
        font-size: 20px;
        letter-spacing: -1.5px;
    }

    .mobile-menu {
        display: block;
    }

    .main-nav {
        position: absolute;
        top: 62px;
        right: 4px;
        z-index: 50;
        width: 200px;
        padding: 8px;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: #fff;
        box-shadow: 0 5px 20px rgba(0, 0, 0, .15);
    }

    .main-nav.show {
        display: flex;
    }

    .main-nav a {
        padding: 12px;
        border-bottom: 1px solid #eee;
    }

    .main-card {
        width: 100%;
        max-width: 100%;
        margin-top: 5px;
        padding: 9px 4px 20px;
        overflow: hidden;
    }

    .market-section {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    .market-heading h1 {
        font-size: 14px;
    }

    .price-line {
        gap: 6px;
        flex-wrap: wrap;
    }

    .current-price {
        font-size: 23px;
    }

    .change-data {
        font-size: 10px;
    }

    .market-status {
        font-size: 8px;
        line-height: 1.4;
    }

    .chart-controls {
        grid-template-columns: repeat(3, 1fr);
    }

    .chart-controls button {
        height: 29px;
        padding: 2px;
        font-size: 8px;
    }

    .chart-area {
        width: 100%;
        height: 220px;
    }

    .info-row {
        grid-template-columns: 1fr 1fr;
        padding: 4px 0;
    }

    .info-row span,
    .info-row strong {
        padding: 3px 4px;
        font-size: 8px;
    }

    .info-row span:nth-child(3),
    .info-row strong:nth-child(4) {
        text-align: left;
    }

    .result-table {
        width: 100%;
        max-width: 100%;
        margin-top: 10px;
        grid-template-columns: 1.05fr .8fr 1fr .8fr 1fr;
    }

    .result-cell {
        min-width: 0;
        min-height: 40px;
        padding: 5px 1px;
        font-size: 7.5px;
        line-height: 1.2;
        white-space: normal;
    }

    .result-head {
        min-height: 38px;
        font-size: 7.5px;
    }

    .session {
        font-size: 8.5px;
    }

    .result-number {
        font-size: 11px;
    }

    .update-date {
        padding: 7px 2px 0;
        font-size: 7.5px;
    }

    .details-section {
        padding: 18px 4px 22px;
    }

    .details-section > h2 {
        font-size: 18px;
    }

    .detail-grid {
        width: 100%;
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .detail-icon {
        width: 35px;
        font-size: 31px;
    }

    .detail-item h3 {
        font-size: 13px;
    }

    .detail-item p {
        font-size: 9px;
    }

    .history-section {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
        padding: 0;
    }

    .section-title {
        gap: 7px;
        margin-bottom: 8px;
    }

    .section-title span {
        width: 3px;
        height: 20px;
    }

    .section-title h2 {
        font-size: 14px;
    }

    #loading-status {
        margin: 12px 0;
        font-size: 10px;
    }

    .history-responsive {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    #nikkei-history-table {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        table-layout: auto;
    }

    #nikkei-history-table th,
    #nikkei-history-table td {
        min-width: 0;
        padding-left: 1px;
        padding-right: 1px;
        overflow: hidden;
        text-overflow: clip;
        white-space: normal;
        word-break: normal;
    }

    #nikkei-history-table thead tr:first-child th:first-child {
        width: 12%;
        min-width: 12%;
        max-width: 12%;
    }

    #nikkei-history-table thead tr:first-child th:nth-child(2),
    #nikkei-history-table thead tr:first-child th:nth-child(3) {
        width: 44%;
    }

    #nikkei-history-table thead tr:nth-child(2) th:nth-child(1),
    #nikkei-history-table thead tr:nth-child(2) th:nth-child(3),
    #nikkei-history-table thead tr:nth-child(2) th:nth-child(5),
    #nikkei-history-table thead tr:nth-child(2) th:nth-child(7) {
        width: 8%;
    }

    #nikkei-history-table thead tr:nth-child(2) th:nth-child(2),
    #nikkei-history-table thead tr:nth-child(2) th:nth-child(4),
    #nikkei-history-table thead tr:nth-child(2) th:nth-child(6),
    #nikkei-history-table thead tr:nth-child(2) th:nth-child(8) {
        width: 14%;
    }

    #nikkei-history-table th {
        height: auto;
        padding-top: 5px;
        padding-bottom: 5px;
        font-size: 6px;
        line-height: 1.1;
    }

    #nikkei-history-table td {
        height: 34px;
        padding-top: 4px;
        padding-bottom: 4px;
        font-size: 6px;
        line-height: 1.1;
    }

    #nikkei-history-table tbody td:first-child {
        width: 12%;
        max-width: 12%;
        padding-left: 0;
        padding-right: 0;
        font-size: 5.5px;
        font-weight: 700;
        letter-spacing: -.25px;
        white-space: nowrap;
    }

    #nikkei-history-table tbody td:nth-child(2),
    #nikkei-history-table tbody td:nth-child(4),
    #nikkei-history-table tbody td:nth-child(6),
    #nikkei-history-table tbody td:nth-child(8) {
        width: 8%;
        max-width: 8%;
        font-size: 5.2px;
    }

    #nikkei-history-table tbody td:nth-child(3),
    #nikkei-history-table tbody td:nth-child(5),
    #nikkei-history-table tbody td:nth-child(7),
    #nikkei-history-table tbody td:nth-child(9) {
        width: 14%;
        max-width: 14%;
    }

    #nikkei-history-table .session-header {
        color: #777;
        font-size: 5.2px;
    }

    #nikkei-history-table .result-value {
        color: #0868c8;
        font-size: 7px;
        font-weight: 700;
        white-space: nowrap;
    }

    .footer {
        padding-top: 30px;
    }

    .footer-content {
        width: 100%;
        padding: 20px 15px;
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .footer h2 {
        font-size: 18px;
    }

    .footer h3 {
        font-size: 14px;
    }

    .footer p,
    .footer a {
        font-size: 10px;
    }

    .footer-brand p {
        margin-top: 15px;
        font-size: 12px;
    }

    .copyright {
        margin-top: 30px;
        padding: 5px 10px;
        text-align: center;
        font-size: 8px;
    }

    .back-top {
        right: 8px;
        bottom: 8px;
    }
}

@media (max-width: 390px) {
    .site-width {
        max-width: calc(100% - 4px);
    }

    .main-card {
        padding-left: 2px;
        padding-right: 2px;
    }

    .logo {
        font-size: 18px;
    }

    .current-price {
        font-size: 21px;
    }

    .result-cell,
    .result-head {
        font-size: 7px;
    }

    .result-number {
        font-size: 10px;
    }

    #nikkei-history-table thead tr:first-child th:first-child {
        width: 11%;
        min-width: 11%;
        max-width: 11%;
    }

    #nikkei-history-table thead tr:first-child th:nth-child(2),
    #nikkei-history-table thead tr:first-child th:nth-child(3) {
        width: 44.5%;
    }

    #nikkei-history-table th {
        padding: 4px 1px;
        font-size: 5.2px;
    }

    #nikkei-history-table td {
        height: 32px;
        padding: 3px 1px;
        font-size: 5.2px;
    }

    #nikkei-history-table tbody td:first-child {
        width: 11%;
        max-width: 11%;
        font-size: 4.8px;
        letter-spacing: -.35px;
    }

    #nikkei-history-table .session-header {
        font-size: 4.8px;
    }

    #nikkei-history-table .result-value {
        font-size: 6.4px;
    }
}