* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: #313b4b;
    background:
        radial-gradient(circle at 90% 15%, rgba(203,168,75,.10), transparent 25%),
        linear-gradient(135deg, #07101c 0%, #101b28 100%);
}

.header {
    width: 100%;
    height: 74px;
    background: #15143f;
    border-bottom: 1px solid rgba(255,255,255,.04);
}

.header-inner {
    width: calc(100% - 40px);
    max-width: 1180px;
    height: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

.brand-logo {
    width: 35px;
    height: 35px;
    border: 2px solid #cba53f;
    border-radius: 50%;
    color: #d3aa40;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: Georgia, serif;
    font-size: 13px;
    font-style: italic;
    font-weight: 700;
}

.nav {
    display: flex;
    align-items: center;
    gap: 37px;
    margin-left: auto;
    margin-right: 70px;
}

.nav a {
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    transition: opacity .2s ease;
}

.nav a:hover {
    opacity: .7;
}

.live-button {
    width: 154px;
    height: 40px;
    background: #d4b665;
    color: #26233a;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    font-size: 13px;
}

.live-button span {
    font-size: 17px;
    font-weight: 700;
}

.mobile-menu {
    display: none;
    margin-left: auto;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 25px;
}

.site-main {
    width: calc(100% - 55px);
    max-width: 1180px;
    margin: 10px auto 0;
    background: #fff;
    min-height: 1100px;
}

.results-panel {
    padding: 12px 28px 0;
}

.results-panel h1 {
    margin: 0 0 25px;
    color: #344258;
    font-size: 21px;
    line-height: 30px;
    font-weight: 700;
}

.market-layout {
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    gap: 40px;
}

.market-info {
    padding-bottom: 25px;
}

.current-price {
    color: #10b981;
    font-size: 29px;
    line-height: 37px;
    font-weight: 700;
    letter-spacing: .2px;
}

.price-change {
    color: #00a95c;
    font-size: 13px;
    font-weight: 700;
    margin-top: 8px;
    margin-bottom: 20px;
}

.info-list {
    width: 100%;
}

.info-row {
    min-height: 34px;
    border-bottom: 1px solid #e7e7e7;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    font-size: 12px;
}

.info-row span {
    color: #666;
}

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

.chart-side {
    min-width: 0;
}

.chart-controls {
    height: 33px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.chart-controls button {
    height: 28px;
    padding: 0 13px;
    border: 1px solid #ccc;
    border-right: 0;
    background: #fff;
    color: #555;
    font-size: 10px;
    cursor: pointer;
}

.chart-controls button:first-child {
    border-radius: 2px 0 0 2px;
}

.chart-controls button:last-child {
    border-right: 1px solid #ccc;
    border-radius: 0 2px 2px 0;
}

.chart-controls button.active {
    border: 1px solid #14932d;
    color: #222;
    font-weight: 700;
}

.chart-wrapper {
    width: 100%;
    height: 260px;
    position: relative;
    border-bottom: 1px solid #ddd;
}

#myChart {
    width: 100% !important;
    height: 100% !important;
}

.result-bar {
    width: 100%;
    height: 34px;
    margin-top: 13px;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 2.1fr .75fr;
    border: 1px solid #c8c8c8;
    background: #fafafa;
}

.result-bar > div {
    border-right: 1px solid #c8c8c8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: #3d4756;
}

.result-bar > div:last-child {
    border-right: 0;
}

.result-value {
    background: #f9f9f9;
    color: #27354a !important;
}

.as-at {
    margin-top: 20px;
    text-align: right;
    color: #999;
    font-size: 9px;
}

.history-section {
    margin-top: 70px;
    padding: 0 8px 48px;
}

.history-section h2 {
    margin: 0 0 16px 5px;
    color: #303030;
    font-size: 21px;
    line-height: 28px;
    font-weight: 700;
}

.history-scroll {
    width: 100%;
    overflow-x: auto;
}

#sgxHistoryTable {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    background: #fff;
}

#sgxHistoryTable th {
    height: 37px;
    border: 1px solid #d3d3d3;
    background: #f1f1f1;
    color: #333;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
}

#sgxHistoryTable td {
    height: 37px;
    border: 1px solid #d5d5d5;
    background: #fff;
    color: #3e3e3e;
    text-align: center;
    font-size: 12px;
}

#sgxHistoryTable tbody tr:hover td {
    background: #fafafa;
}

.footer {
    min-height: 300px;
    background:
        linear-gradient(rgba(247,250,253,.91), rgba(239,244,248,.91)),
        radial-gradient(circle at 50% 80%, #8ca0b1, transparent 40%);
    border-top: 1px solid #e7ebef;
}

.footer-inner {
    width: calc(100% - 40px);
    max-width: 1000px;
    margin: 0 auto;
    padding: 85px 0 50px;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 100px;
}

.footer-brand h2 {
    color: #171747;
    font-size: 20px;
    margin: 10px 0;
}

.footer-logo {
    width: 42px;
    height: 42px;
    border: 2px solid #cba53f;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b68f28;
    font-weight: 700;
}

.footer-brand p {
    max-width: 260px;
    color: #667386;
    font-size: 13px;
    line-height: 1.7;
}

.footer-column {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.footer-column h3 {
    margin: 0 0 20px;
    color: #171747;
    font-size: 17px;
}

.footer-column a {
    margin-bottom: 12px;
    color: #596779;
    text-decoration: none;
    font-size: 13px;
}

@media (max-width: 850px) {
    .nav {
        display: none;
    }

    .live-button {
        margin-left: auto;
        margin-right: 15px;
    }

    .mobile-menu {
        display: block;
    }

    .market-layout {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .chart-wrapper {
        height: 280px;
    }

    .history-section {
        margin-top: 45px;
    }

    .footer-inner {
        grid-template-columns: 1fr 1fr;
        gap: 45px;
    }
}

@media (max-width: 560px) {
    .header {
        height: 65px;
    }

    .header-inner {
        width: calc(100% - 20px);
    }

    .brand span {
        font-size: 12px;
    }

    .live-button {
        width: 115px;
        height: 36px;
        font-size: 11px;
    }

    .site-main {
        width: 100%;
        margin-top: 0;
    }

    .results-panel {
        padding: 14px 14px 0;
    }

    .results-panel h1 {
        font-size: 19px;
    }

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

    .chart-controls {
        justify-content: flex-start;
        overflow-x: auto;
    }

    .chart-controls button {
        flex-shrink: 0;
    }

    .chart-wrapper {
        height: 235px;
    }

    .result-bar {
        grid-template-columns: 1.4fr .7fr .7fr 1fr .7fr;
    }

    .history-section {
        padding: 0 8px 35px;
    }

    .history-section h2 {
        font-size: 19px;
    }

    #sgxHistoryTable {
        min-width: 550px;
    }

    .footer-inner {
        grid-template-columns: 1fr;
        gap: 35px;
        padding-top: 50px;
    }
}