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

    --ad-background-color: #d60000; /* LIVE badge */
    --white: #ffffff;
    --font-xs: 12px;
}

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

/* ========================= Tables (shared styles) ========================= */
.table-container {
    background: #fff;
    border-radius: 8px;
    overflow-x: hidden; /* no horizontal scroll */
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.gold-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto; /* natural sizing */
}

.gold-table th, .gold-table td {
    border: 1px solid var(--border-color);
    padding: 0.6rem 0.4rem;
    text-align: center;
}

/* Headers: allow wrapping, keep neat */
.gold-table th {
    background: #f1f1f1;
    color: var(--heading-color);
    white-space: normal; /* headers may wrap */
    word-break: normal;
    overflow-wrap: anywhere; /* prevent overflow on long words */
}

/* Keep "Karat" header on one line */
.gold-table th:first-child {
    white-space: nowrap;
}

/* Cells: numbers single-line by default */
.gold-table td {
    white-space: nowrap; /* numbers won't wrap */
    word-break: keep-all;
}

/* If you need text to wrap (e.g., descriptions), add class="wrap-text" to that <td> */
.gold-table td.wrap-text {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
}

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

.gold-table tbody tr:hover td {
    background: #f0f4f8;
}

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

.error {
    text-align: center;
    color: red;
    font-weight: 600;
    margin-top: 2rem;
}

/* LIVE badge */
.live-badge {
    margin-left: 10px;
    align-items: center;
    background-color: var(--ad-background-color);
    border-radius: 3px;
    color: var(--white);
    font-size: var(--font-xs);
    justify-content: center;
    line-height: 14px;
    padding: 2px 4px;
    display: inline-flex;
    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);
    }
}



/* Stars */
.star-rating {
    font-size: 1.6rem;
    color: gold;
    margin-top: 0.3rem;
    letter-spacing: 2px;
}

/* ========================= Mobile tweaks ========================= */
@media (max-width: 600px) {
    body {
        font-size: 14px;
    }

    header h1 {
        font-size: 1.25rem;
    }

    .subtitle {
        font-size: 0.75rem;
    }

    .gold-table th {
        font-size: 0.72rem;
        padding: 0.45rem 0.3rem;
        line-height: 1.25;
    }

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

    /* Slightly smaller for first header cell so "Karat" never breaks */
    .gold-table th:first-child {
        font-size: 0.68rem;
    }
}

/* ===== Gold Calculator – improved look ===== */
.gc-title {
    margin: 0 0 0.75rem 0;
    padding: 1rem;
    border-radius: 10px;
    background: linear-gradient(180deg, #fff, #f6f6f6);
    border: 1px solid var(--border-color);
    text-align: center;
}

.gc-title-main {
    display: block;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 0.2px;
    color: var(--heading-color);
}

.gc-title-sub {
    display: block;
    margin-top: 4px;
    font-size: 0.82rem;
    color: var(--subtext-color);
}

.gold-calculator {
    padding: 1rem;
    margin-top: 1rem;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.gc-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
    padding: 0.75rem 0 0.25rem;
}

.gc-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.gc-field span {
    font-size: 0.85rem;
    color: var(--subtext-color);
}

.gc-field select, .gc-field input {
    padding: 0.65rem 0.7rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: #fff;
    outline: none;
}

.gc-field select:focus, .gc-field input:focus {
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.18);
}

.gc-actions {
    display: flex;
    gap: 0.6rem;
    align-items: end;
    justify-content: flex-start;
}

.gc-btn {
    padding: 0.7rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: #111;
    color: #fff;
    cursor: pointer;
    font-weight: 600;
}

.gc-btn:hover {
    filter: brightness(1.05);
}

.gc-btn.ghost {
    background: transparent;
    color: #111;
}

.gc-note {
    grid-column: 1 / -1;
    font-size: 0.82rem;
    color: var(--subtext-color);
}

.gc-result {
    padding-top: 0.75rem;
}

.gc-result-box {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
}

.gc-line {
    margin-bottom: 0.4rem;
}

.gc-total {
    margin-top: 0.6rem;
    font-size: 1.15rem;
    font-weight: 800;
}

/* Responsive */
@media (max-width: 720px) {
    .gc-grid {
        grid-template-columns: 1fr 1fr;
    }

    .gc-actions {
        grid-column: 1 / -1;
    }
}

@media (max-width: 420px) {
    .gc-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================
   Ticker – Session Indicators
   ========================= */
/* =========================
   Gold Market Ticker (JS-driven)
   ========================= */

.ticker-container {
    overflow: hidden;
    background: linear-gradient(180deg, #0b0f19, #070b14);
    border-top: 1px solid #1f2937;
    border-bottom: 1px solid #1f2937;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    padding: 8px 0;
    position: relative;
}

/* Track = hover & clipping layer */
.ticker-track {
    width: 100%;
    overflow: hidden;
    pointer-events: auto;
}

/* Content = moved ONLY by JS */
.ticker-content {
    display: flex;
    align-items: center;
    width: max-content;

    /* absolutely critical for smooth JS movement */
    will-change: transform;
    transform: translateX(0);

    /* ❌ NO animation here */
}

/* =========================
   Ticker items
   ========================= */

.ticker-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 28px;
    white-space: nowrap;
    border-right: 1px solid #1f2937;
}

.ticker-symbol {
    font-weight: 700;
    color: #f1c40f;
    letter-spacing: 0.3px;
}

.ticker-price {
    color: #e5e7eb;
    font-weight: 500;
}

.ticker-delta {
    font-weight: 600;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* =========================
   Trend colors (finance standard)
   ========================= */

.trend-up .ticker-delta {
    color: #22c55e;
}

.trend-down .ticker-delta {
    color: #ef4444;
}

.trend-flat .ticker-delta {
    color: #9ca3af;
}

/* =========================
   Hover pause feedback (JS-controlled)
   ========================= */

.ticker-container.is-paused {
    cursor: grab;
}

.ticker-container.is-paused .ticker-item {
    opacity: 0.9;
}

/* =========================
   Mobile
   ========================= */

@media (max-width: 600px) {
    .ticker-item {
        padding: 0 16px;
        font-size: 12px;
    }

    .ticker-delta {
        font-size: 12px;
    }
}



/* =========================
   Gold Table – Color Enhancements Only
   (NO size / layout changes)
   ========================= */

/* Header background & text */
.gold-table th {
    background: linear-gradient(180deg, #f3f4f6, #e5e7eb);
    color: #111827;
}

/* Body text */
.gold-table td {
    color: #1f2937;
}

/* Zebra rows – subtle */
.gold-table tbody tr:nth-child(even) td {
    background-color: #fafafa;
}

/* Hover – very light */
.gold-table tbody tr:hover td {
    background-color: #f3f4f6;
}

/* =========================
   Price emphasis
   ========================= */

.price-today {
    color: #111827;
}

.price-yesterday {
    color: #6b7280;
}

/* =========================
   Change column (market colors)
   ========================= */

.change-up {
    color: #16a34a!important; /* green */
}

.change-down {
    color: #dc2626!important; /* red */
}

.change-flat {
    color: #6b7280!important; /* neutral */
}

/* Arrow color inherits change color */
.change-arrow {
    color: inherit;
}

/* =========================
   Currency & numbers
   ========================= */

.gold-table td span,
.gold-table td {
    color: inherit;
}

table.gold-table {
    margin: 0;
}