.singapore-page {
    --sg-ink: #16263a;
    --sg-muted: #5a6d83;
    --sg-bg: #f3f6fb;
    --sg-surface: #ffffff;
    --sg-soft: #eef3f7;
    --sg-soft-warm: #f8f2ed;
    --sg-accent: #d7263d;
    --sg-accent-soft: #ffd8de;
    --sg-secondary: #0f6b6f;
    --sg-border: #d5dfeb;
    --sg-border-strong: #9bb0c8;
    color: var(--sg-ink);
    font-family: "Trebuchet MS", sans-serif;
    position: relative;
}

.singapore-page::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(circle at 9% 12%, rgba(215, 38, 61, 0.08), transparent 34%),
        radial-gradient(circle at 88% 18%, rgba(15, 107, 111, 0.1), transparent 34%),
        linear-gradient(var(--sg-bg), var(--sg-bg));
}

.singapore-page p,
.singapore-page li,
.singapore-page td,
.singapore-page th {
    font-size: 1.02rem;
    line-height: 1.72;
}

.singapore-page h1,
.singapore-page h2,
.singapore-page h3 {
    font-family: "Georgia", serif;
}

.singapore-page section[id] {
    scroll-margin-top: 1rem;
}

.sg-hero {
    position: relative;
    overflow: hidden;
    border-radius: 1.35rem;
    padding: 2.4rem;
    background: linear-gradient(134deg, #13233a 0%, #1e3f67 57%, #ba243c 100%);
    color: #f8fafc;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 20px 42px rgba(17, 32, 54, 0.22);
}

.sg-hero .lead {
    color: rgba(248, 250, 252, 0.93);
    max-width: 44rem;
}

.sg-kicker {
    letter-spacing: 0.18em;
    font-size: 0.72rem;
    text-transform: uppercase;
    margin-bottom: 0.8rem;
    color: #d8ebfb;
}

.sg-meta-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.sg-meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.34rem 0.72rem;
    border-radius: 999px;
    font-size: 0.82rem;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.12);
    color: #f7fbff;
}

.sg-hero-glow {
    position: absolute;
    width: 14rem;
    height: 14rem;
    border-radius: 50%;
    opacity: 0.34;
    filter: blur(5px);
    animation: sgGlowFloat 12s ease-in-out infinite;
}

.sg-hero-glow-a {
    top: -4rem;
    right: -3rem;
    background: #f7fbff;
}

.sg-hero-glow-b {
    left: -4rem;
    bottom: -5rem;
    background: #ef4f67;
    animation-delay: 2.1s;
}

@keyframes sgGlowFloat {
    0% { transform: translate(0, 0); }
    50% { transform: translate(8px, -12px); }
    100% { transform: translate(0, 0); }
}

.sg-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
}

.sg-stat {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 0.9rem;
    padding: 0.85rem;
    backdrop-filter: blur(2px);
}

.sg-stat-value {
    display: block;
    font-size: 1.18rem;
    line-height: 1.1;
    font-weight: 700;
}

.sg-stat-label {
    display: block;
    font-size: 0.78rem;
    opacity: 0.95;
}

.sg-controls,
.sg-section-map,
.sg-evidence-note,
.singapore-page section[id] .sg-section-frame {
    border-radius: 1rem;
    border: 1px solid var(--sg-border);
    box-shadow: 0 14px 28px rgba(19, 39, 62, 0.08);
}

.sg-controls,
.sg-evidence-note {
    padding: 1rem 1.1rem;
}

.sg-controls {
    background: var(--sg-soft);
}

.sg-section-map {
    padding: 1rem 1.1rem;
    background: linear-gradient(145deg, #f9f3ef, #f2f8fc);
}

.sg-evidence-note {
    background: linear-gradient(145deg, #fff7f1, #f6fafc);
}

.sg-note {
    font-size: 0.88rem;
    color: var(--sg-muted);
}

.sg-empty-state {
    color: #8c2231;
    font-weight: 600;
}

.sg-chip {
    border: 1px solid #b9c7d9;
    border-radius: 999px;
    background: #fff;
    color: var(--sg-ink);
    text-decoration: none;
    font-size: 0.84rem;
    font-weight: 600;
    padding: 0.36rem 0.76rem;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.sg-chip:hover,
.sg-chip.is-active {
    background: var(--sg-secondary);
    border-color: var(--sg-secondary);
    color: #fff;
    transform: translateY(-1px);
}

.sg-chip[hidden] {
    display: none !important;
}

.singapore-page section[id] .sg-section-frame {
    padding: 1.12rem 1.25rem;
    background: linear-gradient(160deg, #fff 0%, #fbfdff 100%);
    transition: border-color 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.singapore-page section[id].is-filtered-out {
    display: none !important;
}

.sg-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.sg-section-dek {
    color: var(--sg-muted);
    max-width: 44rem;
}

.sg-section-toggle {
    flex-shrink: 0;
    border: 1px solid var(--sg-border-strong);
    background: #fff;
    color: var(--sg-ink);
    border-radius: 999px;
    padding: 0.42rem 0.82rem;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.sg-section-toggle:hover,
.sg-section-toggle[aria-expanded="false"] {
    background: var(--sg-soft);
}

.sg-section-body[hidden] {
    display: none !important;
}

.singapore-page section[id].is-collapsed .sg-section-frame {
    border-color: var(--sg-border-strong);
}

.singapore-page section[id].section-match-pulse .sg-section-frame {
    border-color: #8ba0be;
    transform: translateY(-2px);
}

.singapore-page section[id].reveal-ready .sg-section-frame {
    opacity: 0;
    transform: translateY(12px);
}

.singapore-page section[id].reveal-ready.reveal-visible .sg-section-frame {
    opacity: 1;
    transform: translateY(0);
}

.sg-snapshot-card {
    height: 100%;
    border: 1px solid #d8e3ee;
    border-radius: 0.95rem;
    padding: 1rem;
    background: linear-gradient(180deg, #fff 0%, #f7fbff 100%);
}

.sg-snapshot-title {
    font-size: 1rem;
    margin-bottom: 0.45rem;
    color: var(--sg-secondary);
}

.singapore-page .table {
    border-color: #cfd9e6;
}

.singapore-page .table caption {
    color: var(--sg-muted);
}

.singapore-page .table-dark {
    --bs-table-bg: #1f3958;
    --bs-table-striped-bg: #284667;
}

.singapore-page .table thead th {
    font-size: 0.92rem;
    letter-spacing: 0.02em;
}

.singapore-page .list-group-item {
    background-color: #fff;
    border-color: #dbe4ef;
}

.sg-footnote {
    margin-left: 0.1rem;
}

.sg-footnote a {
    font-size: 0.76rem;
    text-decoration: none;
    color: var(--sg-accent);
    font-weight: 700;
}

.sg-footnote a:hover {
    color: #a61c2f;
}

.sg-hero .sg-footnote a,
.sg-stat .sg-footnote a {
    color: #fdf8f9;
}

.citations-list {
    margin: 0;
    padding-left: 1.15rem;
}

.citations-list li {
    margin-bottom: 1rem;
    color: #2b3647;
}

.citations-list a {
    color: var(--sg-secondary);
    word-break: break-word;
}

.citations-list a:hover {
    color: var(--sg-accent);
}

.citation-number {
    font-weight: 700;
}

.citation-source-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.18rem 0.5rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #14324e;
    background: #e3edf8;
}

.citation-back-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.citation-back-link {
    font-size: 0.8rem;
}

#sg-progress {
    position: fixed;
    right: 1rem;
    bottom: 1.2rem;
    z-index: 1040;
    width: 3rem;
    height: 3rem;
    border-radius: 999px;
    border: 0;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #1c4268, #c32038);
    box-shadow: 0 10px 18px rgba(14, 34, 58, 0.25);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

#sg-progress.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.sg-chip:focus-visible,
.sg-section-toggle:focus-visible,
#sg-progress:focus-visible,
.sg-footnote a:focus-visible {
    outline: 3px solid rgba(15, 107, 111, 0.24);
    outline-offset: 2px;
}

@media (max-width: 991.98px) {
    .sg-hero {
        padding: 1.7rem;
    }

    .sg-stat-grid {
        grid-template-columns: 1fr;
    }

    .sg-section-header {
        flex-direction: column;
        align-items: stretch;
    }

    .singapore-page section[id] .sg-section-frame {
        padding: 1rem;
    }
}

@media (max-width: 575.98px) {
    .singapore-page p,
    .singapore-page li,
    .singapore-page td,
    .singapore-page th {
        font-size: 0.97rem;
    }

    .sg-meta-pill {
        width: 100%;
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sg-hero-glow {
        animation: none;
    }

    .sg-chip,
    .sg-section-toggle,
    .singapore-page section[id] .sg-section-frame,
    #sg-progress {
        transition: none;
    }

    .singapore-page section[id].reveal-ready .sg-section-frame,
    .singapore-page section[id].reveal-ready.reveal-visible .sg-section-frame {
        opacity: 1;
        transform: none;
    }
}
