* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #ffffff;
    color: #17213b;
}

.site-width {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
}

.topbar {
    background: #111238;
    color: #ffffff;
    font-size: 11px;
}

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

.contact-info {
    display: flex;
    align-items: center;
    gap: 25px;
}

.social-links {
    display: flex;
    gap: 12px;
}

.navbar {
    background: #ffffff;
    border-bottom: 1px solid #eeeeee;
}

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

.logo {
    font-size: 13px;
    font-weight: 700;
    color: #121536;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-links a {
    text-decoration: none;
    color: #555b6d;
    font-size: 10px;
    transition: 0.2s;
}

.nav-links a:hover {
    color: #111238;
}

.main-content {
    padding-top: 55px;
    padding-bottom: 150px;
}

.hero-pattern {
    height: 90px;
    background:
        linear-gradient(135deg, transparent 49%, #ececec 50%, transparent 51%),
        linear-gradient(45deg, transparent 49%, #f1f1f1 50%, transparent 51%);
    background-size: 80px 80px;
    background-color: #fafafa;
    margin-bottom: 35px;
    position: relative;
    overflow: hidden;
}

.hero-shape {
    position: absolute;
    width: 45px;
    height: 45px;
    background: #e8e8e8;
    transform: rotate(45deg);
    left: 50%;
    top: 22px;
}

.market-section {
    padding: 0 15px;
}

.market-title {
    font-size: 18px;
    color: #26324b;
    margin-bottom: 25px;
}

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

.sgx-current-price {
    font-size: 31px;
    line-height: 1;
    font-weight: 700;
    color: #ef4444;
    margin-bottom: 10px;
}

.sgx-change {
    font-size: 12px;
    font-weight: 600;
    color: #ef4444;
    margin-bottom: 27px;
}

.market-stats {
    width: 100%;
}

.stat-row {
    min-height: 39px;
    border-bottom: 1px solid #e4e7ec;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    font-size: 11px;
}

.stat-row span {
    color: #7a8190;
}

.stat-row strong {
    color: #556070;
    font-weight: 400;
}

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

.chart-controls {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

.chart-controls button {
    height: 29px;
    min-width: 58px;
    padding: 0 10px;
    background: #ffffff;
    border: 1px solid #9ca3af;
    color: #424b5f;
    font-size: 9px;
    cursor: pointer;
}

.chart-controls button + button {
    border-left: 0;
}

.chart-controls button.active {
    color: #168a34;
    border: 2px solid #16a34a;
    font-weight: 700;
}

#chart-container {
    position: relative;
    width: 100%;
    height: 300px;
}

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

.result-bar {
    width: 100%;
    margin-top: 12px;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    border: 1px solid #aeb4bf;
}

.result-item {
    min-height: 38px;
    border-right: 1px solid #aeb4bf;
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 12px;
    font-size: 10px;
    text-transform: lowercase;
}

.result-item:last-child {
    border-right: 0;
}

.result-item strong {
    font-size: 11px;
}

.result-closed {
    justify-content: center;
}

.chart-date {
    text-align: right;
    color: #9ca3af;
    font-size: 9px;
    margin-top: 22px;
}

.about-section {
    margin-top: 90px;
    padding: 0 15px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 100px;
    align-items: center;
}

.about-text {
    max-width: 480px;
}

.small-line {
    display: block;
    width: 2px;
    height: 18px;
    background: #17213b;
    margin-bottom: 10px;
}

.about-text h2 {
    font-size: 18px;
    margin-bottom: 22px;
}

.about-text p {
    color: #737b8b;
    font-size: 12px;
    line-height: 1.8;
}

.about-image {
    display: flex;
    justify-content: flex-end;
}

.image-placeholder {
    width: 100%;
    max-width: 460px;
    aspect-ratio: 16 / 9;
    background:
        linear-gradient(
            to bottom,
            rgba(232, 99, 93, 0.7),
            rgba(82, 55, 113, 0.8)
        ),
        linear-gradient(
            160deg,
            #d16c67,
            #7c4d75 45%,
            #251947
        );
}

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

.history-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.history-heading span {
    width: 2px;
    height: 18px;
    background: #17213b;
}

.history-heading h2 {
    font-size: 17px;
    font-weight: 700;
}

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

.sgx-history-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    border: 1px solid #9ca8ba;
}

.sgx-history-table th {
    height: 42px;
    padding: 8px 15px;
    background: #fafbfc;
    border: 1px solid #9ca8ba;
    color: #33405b;
    text-transform: uppercase;
    font-size: 9px;
    letter-spacing: 0.4px;
    font-weight: 600;
    text-align: center;
}

.sgx-history-table td {
    height: 42px;
    padding: 8px 15px;
    border: 1px solid #aeb7c5;
    color: #142b59;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
}

.sgx-history-table tbody tr:hover {
    background: #f7f9fc;
}

.error-text {
    color: #dc2626 !important;
}

.no-data-text {
    color: #7a8190 !important;
}

.footer {
    background: #111238;
    color: #ffffff;
    padding: 70px 0 55px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr 1fr;
    gap: 70px;
}

.footer h3 {
    font-size: 11px;
    margin-bottom: 20px;
    letter-spacing: 0.5px;
}

.footer p,
.footer a {
    display: block;
    color: #aaaec1;
    font-size: 10px;
    line-height: 1.8;
    text-decoration: none;
}

.footer a:hover {
    color: #ffffff;
}

@media (max-width: 900px) {
    .nav-links {
        gap: 15px;
    }

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

    .about-section {
        gap: 45px;
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 700px) {
    .site-width {
        width: min(100% - 24px, 1180px);
    }

    .topbar-inner {
        min-height: 40px;
    }

    .contact-info span:nth-child(2),
    .contact-info span:nth-child(3),
    .social-links {
        display: none;
    }

    .navbar-inner {
        min-height: 55px;
    }

    .nav-links {
        display: none;
    }

    .main-content {
        padding-top: 25px;
        padding-bottom: 80px;
    }

    .hero-pattern {
        height: 65px;
        margin-bottom: 25px;
    }

    .market-section {
        padding: 0;
    }

    .market-layout {
        display: block;
    }

    .market-info {
        margin-bottom: 35px;
    }

    .sgx-current-price {
        font-size: 28px;
    }

    .stat-row {
        min-height: 36px;
    }

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

    .chart-controls button {
        flex: 1;
        min-width: 55px;
    }

    #chart-container {
        height: 250px;
    }

    .about-section {
        margin-top: 60px;
        padding: 0;
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .about-image {
        justify-content: flex-start;
    }

    .image-placeholder {
        max-width: none;
    }

    .history-section {
        margin-top: 60px;
        padding: 0;
    }

    .sgx-history-table {
        min-width: 520px;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 40px 25px;
    }
}

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

    .market-title {
        font-size: 16px;
    }

    #chart-container {
        height: 220px;
    }

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

    .result-item {
        min-height: 35px;
        font-size: 9px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }
}