.fb-gold {
    --g-gold: #e0a82e;
    --g-gold-2: #f6cf67;
    --g-ink: #0c0f17;
    --g-up: #16a34a;
    --g-down: #e11d48;
    --g-flat: #64748b;
    --g-line: var(--fb-divider, rgba(120, 120, 140, 0.16));
    --g-card: var(--fb-card, rgba(127, 127, 140, 0.04));
    --g-muted: var(--fb-muted, #6b7280);
    margin: 0 0 32px;
    font-family: inherit;
    color: var(--foreground, inherit);
}

.fb-gold * { box-sizing: border-box; }

/* ===== Live price bar ===== */
.fb-gold__bar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 18px 22px;
    border-radius: 18px;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(140% 160% at 100% 0%, rgba(246, 207, 103, 0.30), transparent 52%),
        linear-gradient(135deg, #15120a 0%, #241d0e 48%, #100d08 100%);
    border: 1px solid rgba(224, 168, 46, 0.35);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.30);
}

.fb-gold__bar::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(246, 207, 103, 0.06));
    pointer-events: none;
}

.fb-gold__bar-main {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.fb-gold__badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: linear-gradient(135deg, var(--g-gold), var(--g-gold-2));
    color: #1b1407;
    font-weight: 800;
    font-size: 13px;
    padding: 6px 13px;
    border-radius: 999px;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(224, 168, 46, 0.35);
}

.fb-gold__badge-icon {
    width: 11px;
    height: 11px;
    border-radius: 3px;
    background: #1b1407;
    transform: rotate(45deg);
    opacity: 0.85;
}

.fb-gold__price-wrap {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.fb-gold__price-value {
    font-size: 40px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -1px;
    font-variant-numeric: tabular-nums;
    color: #fbe9b8;
    transition: color 0.35s ease, transform 0.35s ease;
}

.fb-gold__price-value.is-up { color: #6ee7a8; }
.fb-gold__price-value.is-down { color: #fca5a5; }

.fb-gold__price-unit { font-size: 13px; color: #d9c79a; opacity: 0.85; white-space: nowrap; }

.fb-gold__change {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 13px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 15px;
    font-variant-numeric: tabular-nums;
}

.fb-gold__change--up { background: rgba(22, 163, 74, 0.20); color: #7ef0b0; }
.fb-gold__change--down { background: rgba(225, 29, 72, 0.20); color: #fca5b5; }
.fb-gold__change--flat { background: rgba(148, 163, 184, 0.18); color: #cbd5e1; }

.fb-gold__bar-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    position: relative;
    z-index: 1;
    font-size: 12px;
    color: #d9c79a;
}

.fb-gold__live { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }

.fb-gold__dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7);
    animation: fb-gold-pulse 1.8s infinite;
}

@keyframes fb-gold-pulse {
    0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6); }
    70% { box-shadow: 0 0 0 9px rgba(52, 211, 153, 0); }
    100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

@media (max-width: 560px) {
    .fb-gold__bar { padding: 16px; }
    .fb-gold__price-value { font-size: 32px; }
    .fb-gold__bar-meta { align-items: flex-start; }
}

/* ===== Stats row ===== */
.fb-gold__stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.fb-gold__stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 11px 13px;
    border: 1px solid var(--g-line);
    border-radius: 12px;
    background: var(--g-card);
}

.fb-gold__stat-k { font-size: 11px; color: var(--g-muted); }
.fb-gold__stat-v { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.fb-gold__stat-v--up { color: var(--g-up); }
.fb-gold__stat-v--down { color: var(--g-down); }

/* ===== Analysis card ===== */
.fb-gold__card {
    margin-top: 16px;
    border: 1px solid var(--g-line);
    border-radius: 20px;
    padding: 22px;
    background: var(--g-card);
    position: relative;
}

.fb-gold__card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.fb-gold__card-titlewrap { display: flex; flex-direction: column; gap: 4px; }

.fb-gold__card-title {
    margin: 0;
    font-size: 21px;
    font-weight: 800;
    position: relative;
    padding-right: 14px;
    line-height: 1.3;
}

.fb-gold__card-title::before {
    content: "";
    position: absolute;
    right: 0; top: 4px;
    width: 5px; height: 22px;
    border-radius: 4px;
    background: linear-gradient(var(--g-gold), var(--g-gold-2));
}

.fb-gold__card-sub { font-size: 12.5px; color: var(--g-muted); padding-right: 14px; }

.fb-gold__tags { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.fb-gold__trend { font-size: 13px; font-weight: 800; padding: 4px 12px; border-radius: 999px; white-space: nowrap; }
.fb-gold__trend--up { background: rgba(22, 163, 74, 0.14); color: var(--g-up); }
.fb-gold__trend--down { background: rgba(225, 29, 72, 0.14); color: var(--g-down); }
.fb-gold__trend--flat { background: rgba(100, 116, 139, 0.16); color: var(--g-flat); }

.fb-gold__pattern {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--g-gold);
    background: rgba(224, 168, 46, 0.12);
    border: 1px solid rgba(224, 168, 46, 0.3);
    padding: 4px 12px;
    border-radius: 999px;
}

/* Chart (the real image, prominent) */
.fb-gold__chart {
    margin: 0 0 18px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: #0b0f17;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.fb-gold__chart img { width: 100%; height: auto; display: block; }

.fb-gold__chart figcaption {
    padding: 10px 14px;
    font-size: 12px;
    color: #94a3b8;
    text-align: center;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.fb-gold__summary {
    font-size: 16.5px;
    font-weight: 700;
    line-height: 2;
    margin: 0 0 16px;
    padding: 14px 16px;
    border-radius: 12px;
    background: rgba(224, 168, 46, 0.08);
    border-right: 3px solid var(--g-gold);
}

.fb-gold__levels {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.fb-gold__level {
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    border: 1px solid var(--g-line);
    background: rgba(127, 127, 140, 0.05);
    position: relative;
    overflow: hidden;
}

.fb-gold__level::before {
    content: "";
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: 4px;
}

.fb-gold__level-label { font-size: 12px; color: var(--g-muted); }
.fb-gold__level-price { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.fb-gold__level-price small { font-size: 11px; font-weight: 600; opacity: 0.7; }

.fb-gold__level--support::before { background: var(--g-up); }
.fb-gold__level--support .fb-gold__level-price { color: var(--g-up); }
.fb-gold__level--resistance::before { background: var(--g-down); }
.fb-gold__level--resistance .fb-gold__level-price { color: var(--g-down); }
.fb-gold__level--target::before { background: #0ea5e9; }
.fb-gold__level--target .fb-gold__level-price { color: #0ea5e9; }
.fb-gold__level--stop::before { background: #f59e0b; }
.fb-gold__level--stop .fb-gold__level-price { color: #f59e0b; }

/* Analysis body */
.fb-gold__analysis { line-height: 2.15; font-size: 15.5px; }
.fb-gold__analysis p { margin: 0 0 15px; }
.fb-gold__analysis h3 {
    font-weight: 800;
    font-size: 17px;
    margin: 22px 0 10px;
    padding-right: 12px;
    position: relative;
}
.fb-gold__analysis h3::before {
    content: "";
    position: absolute;
    right: 0; top: 50%;
    transform: translateY(-50%);
    width: 4px; height: 16px;
    border-radius: 3px;
    background: var(--g-gold);
}
.fb-gold__analysis ul { margin: 0 0 15px; padding-right: 20px; }
.fb-gold__analysis li { margin-bottom: 6px; }
.fb-gold__analysis strong { color: var(--g-gold); }

/* Long-term block */
.fb-gold__longterm {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 2px dashed var(--g-line);
}

.fb-gold__longterm-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.fb-gold__longterm-title {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    position: relative;
    padding-right: 13px;
}

.fb-gold__longterm-title::before {
    content: "";
    position: absolute;
    right: 0; top: 50%;
    transform: translateY(-50%);
    width: 5px; height: 18px;
    border-radius: 4px;
    background: linear-gradient(#0ea5e9, #38bdf8);
}

.fb-gold__chart--long { box-shadow: 0 8px 24px rgba(14, 165, 233, 0.12); }

/* Price forecasts */
.fb-gold__forecasts {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 2px dashed rgba(224, 168, 46, 0.35);
}

.fb-gold__forecasts-head { margin-bottom: 14px; }

.fb-gold__forecasts-title {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 800;
    position: relative;
    padding-right: 13px;
}

.fb-gold__forecasts-title::before {
    content: "";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 18px;
    border-radius: 4px;
    background: linear-gradient(var(--g-gold), var(--g-gold-2));
}

.fb-gold__forecasts-sub {
    margin: 0;
    font-size: 12.5px;
    color: var(--g-muted);
}

.fb-gold__forecast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.fb-gold__forecast {
    border-radius: 14px;
    padding: 14px 16px;
    border: 1px solid rgba(224, 168, 46, 0.22);
    background:
        radial-gradient(120% 120% at 100% 0%, rgba(246, 207, 103, 0.10), transparent 55%),
        rgba(127, 127, 140, 0.04);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fb-gold__forecast-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.fb-gold__forecast-horizon {
    font-size: 14px;
    font-weight: 800;
    color: var(--g-gold);
}

.fb-gold__forecast-target {
    font-size: 24px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

.fb-gold__forecast-target small {
    font-size: 11px;
    font-weight: 600;
    opacity: 0.75;
    margin-right: 4px;
}

.fb-gold__forecast-range {
    font-size: 12.5px;
    color: var(--g-muted);
    font-variant-numeric: tabular-nums;
}

.fb-gold__forecast-change {
    font-size: 13px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.fb-gold__forecast-change--up { color: var(--g-up); }
.fb-gold__forecast-change--down { color: var(--g-down); }
.fb-gold__forecast-change--flat { color: var(--g-flat); }

.fb-gold__forecast-note {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.8;
    color: inherit;
    opacity: 0.9;
}

.fb-gold__forecast-conf {
    font-size: 11.5px;
    color: var(--g-muted);
    background: rgba(127, 127, 140, 0.08);
    border-radius: 999px;
    padding: 3px 10px;
    align-self: flex-start;
}

.fb-gold__disclaimer {
    margin: 20px 0 0;
    font-size: 12px;
    color: var(--g-muted);
    text-align: center;
    padding-top: 14px;
    border-top: 1px dashed var(--g-line);
}

/* Empty state */
.fb-gold__empty {
    margin-top: 16px;
    border: 1px dashed var(--g-line);
    border-radius: 16px;
    padding: 32px 20px;
    text-align: center;
    background: var(--g-card);
}
.fb-gold__empty-icon {
    display: inline-block;
    width: 40px; height: 40px;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--g-gold), var(--g-gold-2));
    transform: rotate(45deg);
    margin-bottom: 14px;
    opacity: 0.8;
}
.fb-gold__empty p { margin: 0; color: var(--g-muted); }

/* ===== History timeline ===== */
.fb-gold__history { margin-top: 24px; }

.fb-gold__history-title {
    margin: 0 0 14px;
    font-size: 19px;
    font-weight: 800;
    position: relative;
    padding-right: 14px;
}
.fb-gold__history-title::before {
    content: "";
    position: absolute;
    right: 0; top: 50%;
    transform: translateY(-50%);
    width: 5px; height: 20px;
    border-radius: 4px;
    background: linear-gradient(var(--g-gold), var(--g-gold-2));
}

.fb-gold__timeline { display: flex; flex-direction: column; gap: 10px; }

.fb-gold__item {
    border: 1px solid var(--g-line);
    border-radius: 14px;
    overflow: hidden;
    background: var(--g-card);
    transition: border-color 0.2s ease;
}
.fb-gold__item[open] { border-color: rgba(224, 168, 46, 0.4); }

.fb-gold__item-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 16px;
    cursor: pointer;
    list-style: none;
    user-select: none;
}
.fb-gold__item-head::-webkit-details-marker { display: none; }

.fb-gold__item-date { font-weight: 800; font-size: 14px; }
.fb-gold__item-price {
    margin-right: auto;
    font-weight: 800;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    color: var(--g-gold);
}
.fb-gold__item-chevron { transition: transform 0.2s ease; font-size: 18px; opacity: 0.6; }
.fb-gold__item[open] .fb-gold__item-chevron { transform: rotate(180deg); }

.fb-gold__item-body { padding: 0 16px 16px; animation: fb-gold-fade 0.25s ease; }

@keyframes fb-gold-fade {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.fb-gold__item-chart { width: 100%; height: auto; border-radius: 12px; margin-bottom: 12px; }
.fb-gold__item-summary { font-weight: 700; margin: 0 0 10px; }

/* ===== Two-column layout: dated timeline sidebar + accordion feed ===== */
.fb-gold__layout {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
    margin-top: 18px;
}

.fb-gold__timeline {
    /* Re-declare palette: this block lives in the theme sidebar, outside .fb-gold. */
    --g-gold: #e0a82e;
    --g-gold-2: #f6cf67;
    --g-up: #16a34a;
    --g-down: #e11d48;
    --g-flat: #64748b;
    --g-line: var(--fb-divider, rgba(120, 120, 140, 0.16));
    --g-card: var(--fb-card, rgba(127, 127, 140, 0.04));
    --g-muted: var(--fb-muted, #6b7280);
    color: var(--foreground, inherit);
    position: sticky;
    top: 16px;
    align-self: start;
    width: 100%;
    font-family: inherit;
}
.fb-gold__timeline-inner {
    background: var(--g-card);
    border: 1px solid var(--g-line);
    border-radius: 16px;
    overflow: hidden;
}
.fb-gold__timeline-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--g-line);
}
.fb-gold__timeline-head h2 { font-size: 14px; font-weight: 800; margin: 0; }
.fb-gold__timeline-count {
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--g-gold), var(--g-gold-2));
    color: #1b1407;
    font-size: 12px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.fb-gold__timeline-scroll { max-height: min(70vh, 640px); overflow-y: auto; }
.fb-gold__timeline-scroll ol { list-style: none; margin: 0; padding: 8px; }
.fb-gold__timeline-scroll li { margin: 0; }
.fb-gold__timeline-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 10px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--foreground, inherit);
    cursor: pointer;
    text-align: right;
    transition: background .15s ease;
}
.fb-gold__timeline-btn:hover { background: rgba(224, 168, 46, 0.08); }
.fb-gold__timeline-btn.is-active { background: rgba(224, 168, 46, 0.14); }
.fb-gold__timeline-node {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    border: 1px solid var(--g-line);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    color: var(--g-muted);
}
.fb-gold__timeline-btn.is-active .fb-gold__timeline-node {
    border-color: var(--g-gold);
    color: var(--g-gold);
}
.fb-gold__timeline-label { flex: 1 1 auto; font-size: 12.5px; font-weight: 700; }
.fb-gold__timeline-price { font-size: 11px; color: var(--g-muted); white-space: nowrap; }
.fb-gold__timeline-trend { flex: 0 0 auto; font-size: 11px; padding: 2px 6px; border-radius: 6px; }

/* ===== Accordion entries ===== */
.fb-gold__feed { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.fb-gold__entry { scroll-margin-top: 16px; }
.fb-gold__entry-toggle {
    cursor: pointer;
    user-select: none;
    width: 100%;
}
.fb-gold__entry-chevron {
    display: inline-flex;
    font-size: 18px;
    line-height: 1;
    color: var(--g-muted);
    transition: transform .2s ease;
}
.fb-gold__entry[data-open="1"] .fb-gold__entry-chevron { transform: rotate(180deg); }
.fb-gold__entry-panel { margin-top: 14px; }
.fb-gold__entry-panel[hidden] { display: none; }
.fb-gold__entry:not(.is-latest) { opacity: 0.98; }

/* ===== Chart: clickable to zoom ===== */
.fb-gold__chart img[data-fb-zoomable="1"] { cursor: zoom-in; }

/* ===== Lightbox ===== */
.fb-gold-lightbox {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
    background: rgba(6, 8, 14, 0.88);
    backdrop-filter: blur(2px);
}
.fb-gold-lightbox[hidden] { display: none !important; }
body.fb-gold-lightbox-open { overflow: hidden; }
.fb-gold-lightbox__img {
    max-width: 96vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
    cursor: zoom-in;
    transition: transform .2s ease;
}
.fb-gold-lightbox__img.is-zoomed {
    transform: scale(1.6);
    cursor: zoom-out;
    max-width: none;
    max-height: none;
}
.fb-gold-lightbox__close {
    position: absolute;
    top: 16px;
    inset-inline-start: 16px;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}
.fb-gold-lightbox__close:hover { background: rgba(255, 255, 255, 0.22); }

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .fb-gold__layout { grid-template-columns: 1fr; }
    .fb-gold__timeline { position: static; }
    .fb-gold__timeline-scroll { max-height: 280px; }
}
