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

:root {
    --navy: #071b33;
    --navy2: #0c294d;
    --blue: #0866d9;
    --blue2: #1683ff;
    --light-blue: #eef6ff;
    --green: #08a879;
    --red: #e84855;
    --text: #172b42;
    --muted: #718096;
    --border: #dce5ef;
    --light: #f5f8fc;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #fff;
    color: var(--text);
}

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

button {
    font-family: inherit;
}

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

.topbar {
    background: var(--navy);
    color: #9cb0c6;
}

.topbar-inner {
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: .5px;
}

.topbar-inner > div {
    display: flex;
    gap: 20px;
}

.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #fff;
    border-bottom: 1px solid var(--border);
}

.header-inner {
    height: 68px;
    display: flex;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 55px;
}

.logo-box {
    width: 37px;
    height: 37px;
    display: grid;
    place-items: center;
    background: var(--blue);
    color: #fff;
    font-size: 20px;
    font-weight: 900;
}

.logo strong {
    display: block;
    color: var(--navy);
    font-size: 18px;
    line-height: 17px;
}

.logo small {
    color: var(--blue);
    font-size: 7px;
    font-weight: 800;
    letter-spacing: 1.2px;
}

nav {
    display: flex;
    align-self: stretch;
    gap: 30px;
}

nav a {
    position: relative;
    display: flex;
    align-items: center;
    color: #55687c;
    font-size: 10px;
    font-weight: 700;
}

nav a.active,
nav a:hover {
    color: var(--blue);
}

nav a.active::after {
    content: "";
    position: absolute;
    height: 3px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--blue);
}

.search-btn {
    width: 34px;
    height: 34px;
    margin-left: auto;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--navy);
    font-size: 20px;
}

.menu-btn {
    display: none;
    margin-left: 8px;
    border: 0;
    background: none;
    color: var(--navy);
    font-size: 22px;
}

.mobile-menu {
    display: none;
}

.ticker {
    border-bottom: 1px solid var(--border);
    background: #f8fafc;
}

.ticker-inner {
    min-height: 42px;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.ticker-label {
    align-self: stretch;
    padding: 0 18px;
    margin-right: 10px;
    display: flex;
    align-items: center;
    background: var(--blue);
    color: #fff;
    font-size: 8px;
    font-weight: 800;
}

.ticker-item {
    min-width: 180px;
    padding: 0 18px;
    display: flex;
    gap: 8px;
    border-right: 1px solid #dce4ed;
    font-size: 9px;
}

.ticker-item strong {
    color: var(--navy);
}

.ticker-item span {
    color: #718096;
}

.ticker-item b {
    font-size: 8px;
}

.up {
    color: var(--green);
}

.down {
    color: var(--red);
}

.news-layout {
    padding: 35px 0 70px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 285px;
    gap: 34px;
}

.main-column {
    min-width: 0;
}

.lead-story {
    padding-bottom: 27px;
    border-bottom: 1px solid var(--border);
}

.category {
    margin-bottom: 11px;
    color: var(--blue);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.5px;
}

.lead-story h1 {
    max-width: 760px;
    color: var(--navy);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 35px;
    line-height: 1.1;
    letter-spacing: -.7px;
}

.lead {
    max-width: 720px;
    margin-top: 13px;
    color: #64758a;
    font-size: 12px;
    line-height: 1.65;
}

.story-meta {
    margin-top: 15px;
    color: #8998a8;
    font-size: 8px;
    font-weight: 700;
}

.story-meta span {
    padding: 0 6px;
}

.market-box {
    margin-top: 28px;
    border-top: 4px solid var(--blue);
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: #fff;
}

.market-box-head {
    padding: 17px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}

.market-small {
    display: block;
    margin-bottom: 3px;
    color: var(--blue);
    font-size: 8px;
    font-weight: 800;
}

.market-box-head h2 {
    color: var(--navy);
    font-size: 17px;
}

.live-status {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #718096;
    font-size: 8px;
    font-weight: 700;
}

.live-status i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 4px rgba(8,168,121,.1);
}

.sgx-price-section {
    display: grid;
    grid-template-columns: 215px minmax(0, 1fr);
}

.sgx-left-data {
    padding: 22px 20px;
    background: #f8fbff;
    border-right: 1px solid var(--border);
}

.index-name {
    color: #78889a;
    font-size: 8px;
    font-weight: 800;
}

.sgx-current-price {
    margin-top: 7px;
    color: var(--green);
    font-size: 28px;
    font-weight: 800;
}

.sgx-change {
    margin-top: 4px;
    display: flex;
    gap: 4px;
    color: var(--green);
    font-size: 9px;
}

.sgx-data-table {
    margin-top: 21px;
}

.sgx-data-row {
    min-height: 35px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e3eaf1;
}

.sgx-label {
    color: #77889b;
    font-size: 9px;
}

.sgx-value {
    color: #253b54;
    font-size: 9px;
    font-weight: 700;
}

.sgx-chart-area {
    min-width: 0;
    padding: 20px;
}

.chart-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chart-top strong {
    display: block;
    color: var(--navy);
    font-size: 11px;
}

.chart-top > div:first-child span {
    display: block;
    margin-top: 3px;
    color: #8998a9;
    font-size: 8px;
}

.sgx-chart-controls {
    display: flex;
    gap: 3px;
}

.sgx-chart-controls button {
    height: 25px;
    padding: 0 8px;
    border: 1px solid #d5dee8;
    background: #fff;
    color: #67788c;
    font-size: 7px;
    cursor: pointer;
}

.sgx-chart-controls .day-active {
    border-color: var(--blue);
    background: var(--blue);
    color: #fff;
}

#chart-container {
    height: 285px;
    margin-top: 13px;
}

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

.market-result {
    margin-top: 15px;
    display: grid;
    grid-template-columns: 1fr 130px 130px;
    border: 1px solid var(--border);
}

.result-title {
    padding: 12px 15px;
}

.result-title span {
    display: block;
    color: var(--navy);
    font-size: 8px;
    font-weight: 800;
}

.result-title small {
    display: block;
    margin-top: 3px;
    color: #8b99a9;
    font-size: 7px;
}

.result-number {
    padding: 9px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-left: 1px solid var(--border);
}

.result-number span {
    color: #718196;
    font-size: 8px;
    font-weight: 700;
}

.result-number strong {
    color: var(--blue);
    font-size: 18px;
}

.sgx-bottom-data-row {
    margin-top: 8px;
    color: #95a2b1;
    font-size: 7px;
    text-align: right;
}

.market-brief {
    margin-top: 38px;
}

.section-heading {
    margin-bottom: 17px;
    display: flex;
    align-items: center;
    gap: 9px;
}

.section-heading > span {
    width: 4px;
    height: 23px;
    background: var(--blue);
}

.section-heading h2 {
    color: var(--navy);
    font-size: 18px;
}

.brief-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 13px;
}

.brief-main {
    grid-row: span 2;
    display: grid;
    grid-template-columns: 43% 57%;
    border: 1px solid var(--border);
}

.brief-visual {
    min-height: 190px;
    padding: 25px;
    display: flex;
    align-items: flex-end;
    background:
        linear-gradient(135deg, #061a33, #0b58a8);
}

.bars {
    width: 100%;
    height: 100px;
    display: flex;
    align-items: flex-end;
    gap: 7px;
}

.bars i {
    flex: 1;
    background: rgba(255,255,255,.85);
}

.bars i:nth-child(1) { height: 30%; }
.bars i:nth-child(2) { height: 48%; }
.bars i:nth-child(3) { height: 41%; }
.bars i:nth-child(4) { height: 67%; }
.bars i:nth-child(5) { height: 57%; }
.bars i:nth-child(6) { height: 79%; }
.bars i:nth-child(7) { height: 94%; }

.brief-content {
    padding: 24px;
}

.brief-content > span,
.brief-small span {
    color: var(--blue);
    font-size: 7px;
    font-weight: 800;
    letter-spacing: .8px;
}

.brief-content h3 {
    margin-top: 9px;
    color: var(--navy);
    font-family: Georgia, serif;
    font-size: 19px;
    line-height: 1.2;
}

.brief-content p {
    margin-top: 12px;
    color: #718096;
    font-size: 9px;
    line-height: 1.6;
}

.brief-small {
    padding: 18px;
    display: flex;
    gap: 13px;
    border: 1px solid var(--border);
}

.news-icon {
    flex: 0 0 36px;
    height: 36px;
    display: grid;
    place-items: center;
    background: var(--light-blue);
    color: var(--blue);
    font-size: 9px;
    font-weight: 800;
}

.brief-small h3 {
    margin-top: 5px;
    color: var(--navy);
    font-size: 11px;
    line-height: 1.35;
}

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

.history-heading {
    align-items: center;
}

.history-heading p {
    margin-top: 3px;
    color: #8997a7;
    font-size: 8px;
}

.history-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-top: 3px solid var(--blue);
}

.sgx-history-table {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
    text-align: center;
}

.sgx-history-table th {
    padding: 12px 10px;
    background: #f0f5fa;
    border-bottom: 1px solid #d9e2ec;
    color: #51657b;
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
}

.sgx-history-table td {
    padding: 11px;
    border-bottom: 1px solid #e4eaf0;
    color: #244b78;
    font-size: 9px;
    font-weight: 600;
}

.sgx-history-table tbody tr:nth-child(even) {
    background: #fafcff;
}

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

.sgx-history-table tbody tr:last-child td {
    border-bottom: 0;
}

.sidebar {
    border-left: 1px solid var(--border);
    padding-left: 24px;
}

.sidebar-title {
    padding-bottom: 11px;
    border-bottom: 3px solid var(--blue);
    color: var(--navy);
    font-size: 14px;
    font-weight: 800;
}

.side-feature {
    padding: 18px 0;
    border-bottom: 1px solid var(--border);
}

.side-image {
    height: 145px;
    padding: 15px;
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(135deg, #071d38, #0c63b9);
    color: #fff;
}

.side-image > span {
    font-size: 21px;
    font-weight: 900;
}

.mini-chart {
    position: absolute;
    left: 20px;
    right: 20px;
    bottom: 28px;
    height: 45px;
    border-bottom: 1px solid rgba(255,255,255,.3);
}

.mini-chart i {
    display: block;
    width: 100%;
    height: 100%;
    border-top: 2px solid #66c3ff;
    transform: skewY(-7deg);
}

.side-feature h3 {
    margin-top: 13px;
    color: var(--navy);
    font-family: Georgia, serif;
    font-size: 16px;
    line-height: 1.25;
}

.side-feature p {
    margin-top: 8px;
    color: #7c8b9c;
    font-size: 9px;
    line-height: 1.5;
}

.side-news article {
    padding: 16px 0;
    display: flex;
    gap: 12px;
    border-bottom: 1px solid var(--border);
}

.number {
    color: #b6c6d8;
    font-size: 18px;
    font-weight: 800;
}

.side-news small {
    color: var(--blue);
    font-size: 7px;
    font-weight: 800;
}

.side-news h4 {
    margin-top: 4px;
    color: #293d55;
    font-size: 10px;
    line-height: 1.4;
}

.newsletter {
    margin-top: 25px;
    padding: 23px;
    background: var(--navy);
    color: #fff;
}

.newsletter > span {
    color: #57adff;
    font-size: 7px;
    font-weight: 800;
    letter-spacing: 1px;
}

.newsletter h3 {
    margin-top: 9px;
    font-family: Georgia, serif;
    font-size: 18px;
}

.newsletter p {
    margin-top: 9px;
    color: #8ea3ba;
    font-size: 9px;
    line-height: 1.5;
}

.newsletter button {
    width: 100%;
    margin-top: 17px;
    padding: 10px;
    border: 0;
    background: var(--blue);
    color: #fff;
    font-size: 8px;
    font-weight: 800;
}

footer {
    background: var(--navy);
    color: #fff;
}

.footer-content {
    padding: 42px 0;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 45px;
}

.footer-brand strong {
    display: block;
    font-size: 21px;
}

.footer-brand > span {
    color: #4da7ff;
    font-size: 8px;
    letter-spacing: 1px;
}

.footer-brand p {
    max-width: 260px;
    margin-top: 13px;
    color: #8398ae;
    font-size: 9px;
    line-height: 1.6;
}

footer h4 {
    margin-bottom: 13px;
    font-size: 8px;
}

footer a {
    display: block;
    margin-bottom: 8px;
    color: #8297ae;
    font-size: 8px;
}

.copyright {
    padding: 15px;
    border-top: 1px solid rgba(255,255,255,.08);
    color: #667f99;
    font-size: 7px;
    text-align: center;
}

.error-text {
    color: var(--red) !important;
}

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

@media (max-width: 950px) {
    .news-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        padding-left: 0;
        border-left: 0;
    }

    nav {
        display: none;
    }

    .menu-btn {
        display: block;
    }

    .mobile-menu.show {
        padding: 5px 20px 17px;
        display: flex;
        flex-direction: column;
    }

    .mobile-menu a {
        padding: 10px 0;
        border-bottom: 1px solid var(--border);
        color: #566b82;
        font-size: 10px;
    }
}

@media (max-width: 700px) {
    .container {
        width: calc(100% - 24px);
    }

    .topbar {
        display: none;
    }

    .header-inner {
        height: 60px;
    }

    .logo {
        margin-right: 0;
    }

    .ticker-item {
        min-width: 150px;
    }

    .lead-story h1 {
        font-size: 28px;
    }

    .sgx-price-section {
        grid-template-columns: 1fr;
    }

    .sgx-left-data {
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .chart-top {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .sgx-chart-controls {
        width: 100%;
    }

    .sgx-chart-controls button {
        flex: 1;
        padding: 0 3px;
    }

    #chart-container {
        height: 240px;
    }

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

    .result-title {
        grid-column: 1 / -1;
        border-bottom: 1px solid var(--border);
    }

    .result-number:nth-child(2) {
        border-left: 0;
    }

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

    .brief-main {
        grid-row: auto;
        grid-template-columns: 1fr;
    }

    .brief-visual {
        min-height: 160px;
    }

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

@media (max-width: 450px) {
    .lead-story h1 {
        font-size: 24px;
    }

    .sgx-chart-area,
    .sgx-left-data {
        padding: 15px;
    }

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