:root {
    --border-color: #e1e1e1;
    --bg-light: #f9f9f9;
    --text-color: #1a1a1a;
    --subtext-color: #666;
    --heading-color: #000;

    --ad-background-color: #d60000;
    --white: #ffffff;
    --font-xs: 12px;
}

/* =========================
   Scoped subtitle
   ========================= */
.ghu-wrap .subtitle {
    font-size: 0.875rem;
    color: var(--subtext-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0.25rem 0 0;
}

/* =========================
   Table container
   ========================= */
.ghu-wrap .table-container {
    background: #fff;
    border-radius: 8px;
    overflow-x: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

/* =========================
   Gold table
   ========================= */
.ghu-wrap .gold-table,
.ghu-wrap .ghu-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

/* Cells */
.ghu-wrap .gold-table th,
.ghu-wrap .gold-table td,
.ghu-wrap .ghu-table th,
.ghu-wrap .ghu-table td {
    border: 1px solid var(--border-color);
    padding: 0.6rem 0.4rem;
    text-align: center;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* Headers */
.ghu-wrap .gold-table th,
.ghu-wrap .ghu-table th {
    background: linear-gradient(180deg, #f3f4f6, #e5e7eb);
    color: var(--heading-color);
    white-space: normal;
    word-break: normal;
    overflow-wrap: anywhere;
    font-weight: 700;
}

/* First column (Date) */
.ghu-wrap .gold-table th:first-child,
.ghu-wrap .ghu-table th:first-child {
    white-space: nowrap;
}

/* Body cells */
.ghu-wrap .gold-table td,
.ghu-wrap .ghu-table td {
    color: #1f2937;
}

/* Wrap helper */
.ghu-wrap .gold-table td.wrap-text,
.ghu-wrap .ghu-table td.wrap-text {
    white-space: normal;
    overflow-wrap: anywhere;
}

/* Zebra */
.ghu-wrap .gold-table tbody tr:nth-child(even) td,
.ghu-wrap .ghu-table tbody tr:nth-child(even) td {
    background: #fafafa;
}

/* Hover */
.ghu-wrap .gold-table tbody tr:hover td,
.ghu-wrap .ghu-table tbody tr:hover td {
    background: #f3f4f6;
}

/* =========================
   Meta text
   ========================= */
.ghu-wrap .updated,
.ghu-wrap .gold-rate-source {
    text-align: center;
    font-size: 0.75rem;
    color: var(--subtext-color);
    margin-top: 0.75rem;
}

/* =========================
   Error
   ========================= */
.ghu-wrap .error,
.ghu-notice {
    text-align: center;
    color: #dc2626;
    font-weight: 600;
    margin-top: 1.5rem;
}

/* =========================
   LIVE badge (optional)
   ========================= */
.ghu-wrap .live-badge {
    margin-left: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 4px;
    font-size: var(--font-xs);
    color: var(--white);
    background-color: var(--ad-background-color);
    border-radius: 3px;
    line-height: 14px;
    animation: pulseLive 1.5s infinite;
}

@keyframes pulseLive {
    0% { box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.6); }
    70% { box-shadow: 0 0 0 8px rgba(255, 0, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 0, 0, 0); }
}

/* =========================
   Mobile tweaks
   ========================= */
@media (max-width: 600px) {
    .ghu-wrap .gold-table th,
    .ghu-wrap .ghu-table th {
        font-size: 0.72rem;
        padding: 0.45rem 0.3rem;
        line-height: 1.25;
    }

    .ghu-wrap .gold-table td,
    .ghu-wrap .ghu-table td {
        font-size: 0.72rem;
        padding: 0.3rem 0.2rem;
    }

    .ghu-wrap .gold-table th:first-child,
    .ghu-wrap .ghu-table th:first-child {
        font-size: 0.68rem;
    }
}

/* =========================
   Price emphasis (optional)
   ========================= */
.ghu-wrap .price-today { color: #111827; font-weight: 600; }
.ghu-wrap .price-yesterday { color: #6b7280; }

/* =========================
   Change colors (future use)
   ========================= */
.ghu-wrap .change-up { color: #16a34a; }
.ghu-wrap .change-down { color: #dc2626; }
.ghu-wrap .change-flat { color: #6b7280; }


.ghu-range-switcher {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
}

.ghu-range-switcher button {
    border: 1px solid var(--border-color);
    background: #fff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
}

.ghu-range-switcher button.active {
    background: #111;
    color: #fff;
    border-color: #111;
}
/* =========================
   Chart container (FIX)
   ========================= */

.ghu-chart-wrap {
    position: relative;
    height: 280px; /* desktop */
}

@media (max-width: 600px) {
    .ghu-chart-wrap {
        height: 220px; /* mobile */
    }
}

.ghu-chart {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

.ghu-table-wrap {
    margin-top: 50px;
}