/* ─────────────────────────────────────────────────────────────
   Harga Emas IDR — Widget Styles
   Themes: light (default) | dark | gold
   ───────────────────────────────────────────────────────────── */

/* ── Reset & Base ── */
.hei-widget *,
.hei-widget *::before,
.hei-widget *::after {
    box-sizing: border-box;
}

/* ── CSS Custom Properties (overridden by Tampilan & Gaya customizer) ── */
.hei-widget {
    /* Typography */
    --hei-font:             -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --hei-font-size:        14px;
    /* Accent */
    --hei-accent:           #C9960C;
    /* Price direction */
    --hei-up:               #4CAF50;
    --hei-down:             #f44336;
    /* Antam */
    --hei-antam-sell:       #c62828;
    --hei-antam-buyback:    #2e7d32;
    /* Layout */
    --hei-radius:           12px;
    --hei-padding:          20px;
    --hei-max-width:        520px;
    /* Light theme surfaces */
    --hei-bg-light:         #ffffff;
    --hei-text-light:       #2d2d2d;
    --hei-border-light:     #e8e4d6;
}
@media (max-width: 480px) {
    .hei-widget { --hei-font-size: 13px; }
}

.hei-widget {
    font-family: var(--hei-font);
    font-size:   var(--hei-font-size);
    border-radius: var(--hei-radius);
    padding: var(--hei-padding) calc(var(--hei-padding) * 1.2);
    max-width: var(--hei-max-width);
    width: 100%;
    transition: box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

/* ── Light Theme (default) ── */
.hei-theme-light {
    background: var(--hei-bg-light);
    border: 1px solid var(--hei-border-light);
    color: var(--hei-text-light);
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
}

/* ── Dark Theme ── */
.hei-theme-dark {
    background: #1a1a2e;
    border: 1px solid #2d2d44;
    color: #e0e0e0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

/* ── Gold Premium Theme ── */
.hei-theme-gold {
    background: linear-gradient(135deg, #1a1200 0%, #2d2000 100%);
    border: 1px solid #7a5c00;
    color: #fde9a0;
    box-shadow: 0 4px 24px rgba(201,150,12,0.25);
}

/* ── Header ── */
.hei-widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--hei-accent);
}

.hei-theme-dark .hei-widget-header { border-bottom-color: #FFD700; }
.hei-theme-gold .hei-widget-header { border-bottom-color: #FFD700; }

.hei-widget-title {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.75;
}

.hei-icon {
    margin-right: 6px;
    font-size: 14px;
    color: var(--hei-accent);
}
.hei-theme-dark .hei-icon,
.hei-theme-gold .hei-icon { color: #FFD700; }

/* ── Badge ── */
.hei-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: 0.3px;
}

.hei-badge-up   { background: var(--hei-up);   color: #fff; }
.hei-badge-down { background: var(--hei-down); color: #fff; }

/* ── Price Block ── */
.hei-price-block {
    margin-bottom: 14px;
}

.hei-price-main {
    font-size: 36px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.5px;
}

.hei-accent { color: var(--hei-accent); }
.hei-theme-dark .hei-accent { color: #FFD700; }
.hei-theme-gold .hei-accent { color: #FFD700; }

.hei-price-sub {
    font-size: 12px;
    opacity: 0.6;
    margin-top: 2px;
}

.hei-price-secondary {
    font-size: 13px;
    margin-top: 4px;
    opacity: 0.55;
}

.hei-change {
    margin-top: 8px;
    font-size: 13px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    display: inline-block;
}

.hei-change-up   { background: rgba(76,175,80,0.12); color: var(--hei-antam-buyback); }
.hei-change-down { background: rgba(244,67,54,0.12); color: var(--hei-antam-sell); }

.hei-theme-dark .hei-change-up   { background: rgba(76,175,80,0.18); color: #81c784; }
.hei-theme-dark .hei-change-down { background: rgba(244,67,54,0.18); color: #ef9a9a; }
.hei-theme-gold .hei-change-up   { color: #a5d6a7; background: rgba(76,175,80,0.15); }
.hei-theme-gold .hei-change-down { color: #ef9a9a; background: rgba(244,67,54,0.15); }

/* ── Meta Row ── */
.hei-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.hei-meta-item {
    background: rgba(0,0,0,0.04);
    border-radius: 8px;
    padding: 6px 12px;
    flex: 1;
    min-width: 120px;
}

.hei-theme-dark .hei-meta-item { background: rgba(255,255,255,0.06); }
.hei-theme-gold .hei-meta-item { background: rgba(255,215,0,0.08); border: 1px solid rgba(255,215,0,0.15); }

.hei-meta-label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    opacity: 0.55;
    letter-spacing: 0.4px;
}

.hei-meta-value {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-top: 2px;
}

/* ── Chart ── */
.hei-chart-wrap {
    margin-bottom: 12px;
}

.hei-chart-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 10px;
}

.hei-tab {
    background: rgba(0,0,0,0.05);
    border: none;
    border-radius: 6px;
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    color: inherit;
    opacity: 0.65;
}

.hei-tab:hover { opacity: 1; }

.hei-tab-active {
    background: var(--hei-accent);
    color: #fff !important;
    opacity: 1;
}

.hei-theme-dark .hei-tab { background: rgba(255,255,255,0.08); }
.hei-theme-dark .hei-tab-active { background: #FFD700; color: #111 !important; }
.hei-theme-gold .hei-tab { background: rgba(255,215,0,0.1); }
.hei-theme-gold .hei-tab-active { background: #FFD700; color: #111 !important; }

.hei-chart-canvas {
    width: 100% !important;
    transition: opacity 0.2s ease;
}

/* ── Antam LM Section ── */
.hei-antam-section {
    background: rgba(201,150,12,0.06);
    border: 1px solid rgba(201,150,12,0.2);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 14px;
}

.hei-theme-dark .hei-antam-section {
    background: rgba(255,215,0,0.07);
    border-color: rgba(255,215,0,0.2);
}

.hei-theme-gold .hei-antam-section {
    background: rgba(255,215,0,0.05);
    border-color: rgba(255,215,0,0.3);
}

.hei-antam-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.hei-antam-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

.hei-antam-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.hei-antam-badge-live { background: rgba(76,175,80,0.15); color: #2e7d32; border: 1px solid rgba(76,175,80,0.3); }
.hei-antam-badge-est  { background: rgba(255,152,0,0.15);  color: #e65100; border: 1px solid rgba(255,152,0,0.3); }

.hei-theme-dark .hei-antam-badge-live { color: #81c784; }
.hei-theme-dark .hei-antam-badge-est  { color: #ffb74d; }
.hei-theme-gold .hei-antam-badge-live { color: #a5d6a7; }
.hei-theme-gold .hei-antam-badge-est  { color: #ffb74d; }

.hei-antam-row {
    display: flex;
    align-items: stretch;
    gap: 0;
    margin-bottom: 10px;
}

.hei-antam-divider {
    width: 1px;
    background: rgba(201,150,12,0.2);
    margin: 0 14px;
    align-self: stretch;
}

.hei-theme-dark .hei-antam-divider { background: rgba(255,215,0,0.15); }

.hei-antam-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.hei-antam-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    opacity: 0.55;
    letter-spacing: 0.4px;
}

.hei-antam-value {
    font-size: 18px;
    font-weight: 800;
    line-height: 1.1;
}

.hei-antam-value small { font-size: 11px; font-weight: 400; opacity: 0.7; margin-left: 2px; }

.hei-antam-sell .hei-antam-value   { color: var(--hei-antam-sell); }
.hei-antam-buyback .hei-antam-value { color: var(--hei-antam-buyback); }

.hei-theme-dark .hei-antam-sell .hei-antam-value    { color: #ef9a9a; }
.hei-theme-dark .hei-antam-buyback .hei-antam-value { color: #a5d6a7; }
.hei-theme-gold .hei-antam-sell .hei-antam-value    { color: #ef9a9a; }
.hei-theme-gold .hei-antam-buyback .hei-antam-value { color: #a5d6a7; }

.hei-antam-sub {
    font-size: 10px;
    opacity: 0.5;
}

.hei-antam-spread {
    font-size: 11px;
    opacity: 0.65;
    padding-top: 6px;
    border-top: 1px solid rgba(201,150,12,0.15);
}

.hei-theme-dark .hei-antam-spread,
.hei-theme-gold .hei-antam-spread { border-top-color: rgba(255,215,0,0.1); }

/* ── Footer ── */
.hei-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10px;
    opacity: 0.45;
    margin-top: 8px;
}

.hei-refresh-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
}

.hei-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4CAF50;
    animation: hei-pulse 1.5s infinite;
    display: inline-block;
}

@keyframes hei-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.4; transform: scale(0.8); }
}

/* ── No-data ── */
.hei-no-data {
    text-align: center;
    padding: 24px;
    opacity: 0.5;
    font-size: 13px;
}

/* ── Compact Mode ── */
.hei-compact .hei-price-main { font-size: 26px; }
.hei-compact.hei-widget { padding: 14px 18px; }

/* ── Responsive ── */
@media (max-width: 480px) {
    .hei-price-main { font-size: 28px; }
    .hei-widget { padding: 16px; }
    .hei-meta-item { min-width: 100px; }
}

/* ─────────────────────────────────────────────────────────────
   Calculator Widget (.hei-calc)
   ───────────────────────────────────────────────────────────── */

/* ── Inputs ── */
.hei-calc-inputs {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.hei-calc-field {
    flex: 1;
    min-width: 130px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.hei-calc-field-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    opacity: 0.55;
}

.hei-calc-weight-row {
    display: flex;
    gap: 6px;
}

.hei-calc-weight {
    flex: 1;
    min-width: 0;
    padding: 9px 12px;
    border-radius: 8px;
    border: 1px solid #ddd;
    background: transparent;
    color: inherit;
    font-size: 15px;
    font-weight: 700;
    outline: none;
    transition: border-color 0.15s;
}
.hei-calc-weight:focus { border-color: var(--hei-accent); }

.hei-calc-unit,
.hei-calc-karat {
    padding: 9px 10px;
    border-radius: 8px;
    border: 1px solid #ddd;
    background: transparent;
    color: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s;
    appearance: auto;
}
.hei-calc-unit:focus,
.hei-calc-karat:focus { border-color: var(--hei-accent); }

.hei-calc-karat { width: 100%; }

.hei-theme-dark .hei-calc-weight,
.hei-theme-dark .hei-calc-unit,
.hei-theme-dark .hei-calc-karat {
    border-color: rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.05);
    color: #e0e0e0;
}
.hei-theme-gold .hei-calc-weight,
.hei-theme-gold .hei-calc-unit,
.hei-theme-gold .hei-calc-karat {
    border-color: rgba(255,215,0,0.25);
    background: rgba(255,215,0,0.07);
    color: #fde9a0;
}

/* ── Result box ── */
.hei-calc-result {
    background: rgba(201,150,12,0.07);
    border: 1px solid rgba(201,150,12,0.2);
    border-radius: 10px;
    padding: 16px 18px;
    text-align: center;
    margin-bottom: 14px;
}

.hei-theme-dark .hei-calc-result {
    background: rgba(255,215,0,0.08);
    border-color: rgba(255,215,0,0.2);
}
.hei-theme-gold .hei-calc-result {
    background: rgba(255,215,0,0.07);
    border-color: rgba(255,215,0,0.3);
}

.hei-calc-result-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.55;
    margin-bottom: 6px;
}

.hei-calc-result-amount {
    font-size: 32px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.5px;
    transition: opacity 0.15s;
}

.hei-calc-result-formula {
    font-size: 11px;
    opacity: 0.5;
    margin-top: 5px;
}

/* ── Antam comparison section ── */
.hei-calc-antam {
    background: rgba(201,150,12,0.04);
    border: 1px solid rgba(201,150,12,0.18);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 14px;
}

.hei-theme-dark .hei-calc-antam {
    background: rgba(255,215,0,0.06);
    border-color: rgba(255,215,0,0.18);
}
.hei-theme-gold .hei-calc-antam {
    background: rgba(255,215,0,0.05);
    border-color: rgba(255,215,0,0.25);
}

.hei-calc-antam-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.hei-calc-antam-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    opacity: 0.7;
}

.hei-calc-antam-body {
    display: flex;
    align-items: center;
    gap: 0;
}

.hei-calc-antam-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.hei-calc-antam-sep {
    width: 1px;
    height: 36px;
    background: rgba(201,150,12,0.18);
    margin: 0 14px;
}
.hei-theme-dark .hei-calc-antam-sep { background: rgba(255,215,0,0.15); }

.hei-calc-antam-lbl {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    opacity: 0.5;
    letter-spacing: 0.3px;
}

.hei-calc-antam-val {
    font-size: 16px;
    font-weight: 800;
    line-height: 1.15;
}

.hei-theme-dark .hei-calc-antam-sell-val    { color: #ef9a9a; }
.hei-theme-dark .hei-calc-antam-buyback-val { color: #a5d6a7; }
.hei-theme-gold .hei-calc-antam-sell-val    { color: #ef9a9a; }
.hei-theme-gold .hei-calc-antam-buyback-val { color: #a5d6a7; }

.hei-calc-antam-note {
    font-size: 10px;
    opacity: 0.4;
    margin-top: 8px;
}

/* ─────────────────────────────────────────────────────────────
   Multi-karat Price Table (.hei-karat-table-wrap)
   ───────────────────────────────────────────────────────────── */

.hei-karat-table-wrap {
    margin-bottom: 14px;
}

.hei-karat-table-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    opacity: 0.55;
    margin-bottom: 8px;
}

.hei-karat-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.hei-karat-table th,
.hei-karat-table td {
    padding: 6px 10px;
    text-align: left;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.hei-theme-dark .hei-karat-table th,
.hei-theme-dark .hei-karat-table td {
    border-bottom-color: rgba(255,255,255,0.07);
}
.hei-theme-gold .hei-karat-table th,
.hei-theme-gold .hei-karat-table td {
    border-bottom-color: rgba(255,215,0,0.1);
}

.hei-karat-table th {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    opacity: 0.5;
    padding-bottom: 8px;
}

.hei-karat-table td:last-child {
    text-align: right;
}

.hei-karat-highlight td {
    background: rgba(201,150,12,0.07);
}
.hei-theme-dark .hei-karat-highlight td { background: rgba(255,215,0,0.08); }
.hei-theme-gold .hei-karat-highlight td { background: rgba(255,215,0,0.07); }

.hei-karat-highlight strong { color: var(--hei-accent); }
.hei-theme-dark .hei-karat-highlight strong { color: #FFD700; }
.hei-theme-gold .hei-karat-highlight strong { color: #FFD700; }

/* ── Responsive ── */
@media (max-width: 480px) {
    .hei-calc-inputs { flex-direction: column; gap: 10px; }
    .hei-calc-result-amount { font-size: 26px; }
}

/* ═══════════════════════════════════════════════════════
   INVESTMENT CALCULATOR  —  .hei-inv
   ═══════════════════════════════════════════════════════ */

/* ── Spot label in header ── */
.hei-inv-spot-label {
    font-size: 12px;
    color: #888;
    white-space: nowrap;
}
.hei-inv-spot-label strong {
    color: var(--hei-accent);
}
.hei-theme-dark .hei-inv-spot-label strong { color: #FFD700; }
.hei-theme-gold .hei-inv-spot-label strong { color: #FFD700; }

/* ── Mode tabs ── */
.hei-inv-tabs {
    display: flex;
    gap: 6px;
    margin: 14px 0 16px;
    flex-wrap: wrap;
}

.hei-inv-tab {
    flex: 1;
    min-width: 90px;
    padding: 7px 10px;
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 20px;
    background: transparent;
    font-size: 12px;
    font-weight: 600;
    color: #888;
    cursor: pointer;
    text-align: center;
    transition: all 0.18s;
    line-height: 1.3;
}
.hei-inv-tab:hover {
    border-color: var(--hei-accent);
    color: var(--hei-accent);
}
.hei-inv-tab-active {
    background: var(--hei-accent);
    border-color: var(--hei-accent);
    color: #fff !important;
}

.hei-theme-dark .hei-inv-tab {
    border-color: rgba(255,255,255,0.15);
    color: #aaa;
}
.hei-theme-dark .hei-inv-tab:hover {
    border-color: #FFD700;
    color: #FFD700;
}
.hei-theme-dark .hei-inv-tab-active {
    background: #FFD700;
    border-color: #FFD700;
    color: #1a1a1a !important;
}

.hei-theme-gold .hei-inv-tab-active {
    background: var(--hei-accent);
    border-color: var(--hei-accent);
}

/* ── Panel description ── */
.hei-inv-desc {
    font-size: 12px;
    color: #888;
    margin: 0 0 14px;
    line-height: 1.5;
}
.hei-theme-dark .hei-inv-desc { color: #aaa; }

/* ── Input fields ── */
.hei-inv-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 14px;
}

.hei-inv-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    cursor: default;
}

.hei-inv-field-label {
    font-size: 11px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.hei-theme-dark .hei-inv-field-label { color: #aaa; }

.hei-inv-input-wrap {
    display: flex;
    align-items: center;
    border: 1px solid rgba(0,0,0,0.14);
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    transition: border-color 0.15s;
}
.hei-inv-input-wrap:focus-within {
    border-color: var(--hei-accent);
    box-shadow: 0 0 0 2px rgba(201,150,12,0.12);
}

.hei-theme-dark .hei-inv-input-wrap {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.12);
}
.hei-theme-dark .hei-inv-input-wrap:focus-within {
    border-color: #FFD700;
    box-shadow: 0 0 0 2px rgba(255,215,0,0.12);
}

.hei-inv-prefix,
.hei-inv-suffix {
    padding: 0 7px;
    font-size: 11px;
    font-weight: 700;
    color: #888;
    background: rgba(0,0,0,0.03);
    white-space: nowrap;
    align-self: stretch;
    display: flex;
    align-items: center;
    border-right: 1px solid rgba(0,0,0,0.08);
}
.hei-inv-suffix {
    border-right: none;
    border-left: 1px solid rgba(0,0,0,0.08);
}
.hei-theme-dark .hei-inv-prefix,
.hei-theme-dark .hei-inv-suffix {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.08);
    color: #aaa;
}

.hei-inv-input-wrap input[type=number] {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    padding: 7px 8px;
    font-size: 13px;
    background: transparent;
    color: inherit;
    -moz-appearance: textfield;
    appearance: textfield;
}
.hei-inv-input-wrap input[type=number]::-webkit-inner-spin-button,
.hei-inv-input-wrap input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.hei-theme-dark .hei-inv-input-wrap input[type=number] {
    color: #e0e0e0;
}

/* ── Result card ── */
.hei-inv-result {
    margin-top: 4px;
}

.hei-inv-result-card {
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 8px;
    overflow: hidden;
}
.hei-theme-dark .hei-inv-result-card {
    border-color: rgba(255,255,255,0.1);
}

.hei-inv-result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 14px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    font-size: 13px;
    gap: 8px;
}
.hei-inv-result-row:last-child {
    border-bottom: none;
}
.hei-theme-dark .hei-inv-result-row {
    border-bottom-color: rgba(255,255,255,0.06);
}

.hei-inv-result-label {
    color: #888;
    font-size: 12px;
    flex-shrink: 0;
}
.hei-theme-dark .hei-inv-result-label { color: #aaa; }

.hei-inv-result-value {
    font-weight: 600;
    font-size: 13px;
    text-align: right;
    word-break: break-all;
}

/* Highlighted row */
.hei-inv-result-highlight {
    background: rgba(201,150,12,0.07);
}
.hei-inv-result-highlight .hei-inv-result-label {
    color: #555;
    font-weight: 700;
}
.hei-inv-result-highlight .hei-inv-result-value {
    font-size: 16px;
    color: var(--hei-accent);
}

.hei-theme-dark .hei-inv-result-highlight {
    background: rgba(255,215,0,0.08);
}
.hei-theme-dark .hei-inv-result-highlight .hei-inv-result-label { color: #ccc; }
.hei-theme-dark .hei-inv-result-highlight .hei-inv-result-value { color: #FFD700; }

.hei-theme-gold .hei-inv-result-highlight .hei-inv-result-value { color: #FFD700; }

/* Direction cues for P&L */
.hei-inv-result-up .hei-inv-result-value    { color: var(--hei-up)   !important; }
.hei-inv-result-down .hei-inv-result-value  { color: var(--hei-down) !important; }

/* ═══════════════════════════════════════════════════════
   CHART LEGEND  (dual-line: Spot + Antam)
   ═══════════════════════════════════════════════════════ */

/* Chart.js renders legend inside the canvas — no extra wrapper needed.
   These rules style the wrap area and provide breathing room. */
.hei-chart-wrap canvas.hei-chart-canvas {
    /* Slight extra height when legend is visible (JS adds it automatically) */
    min-height: 160px;
}

/* ── Responsive (investment calc) ── */
@media (max-width: 520px) {
    .hei-inv-fields { grid-template-columns: 1fr; }
    .hei-inv-tabs   { flex-wrap: wrap; }
    .hei-inv-tab    { flex: 1 1 auto; min-width: 80px; }
}

/* ── Stale-data notice ──────────────────────────────────────────────────── */
/* Shown when today's scheduled fetch hasn't run yet (e.g. first install).  */
.hei-stale-notice {
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 6px;
    color: #795548;
    font-size: 12px;
    padding: 6px 12px;
    margin-bottom: 10px;
    text-align: center;
}
.hei-theme-dark .hei-stale-notice,
.hei-theme-gold .hei-stale-notice {
    background: #3e3a2a;
    border-color: #7a6b2a;
    color: #d4b96a;
}

/* ═══════════════════════════════════════════════════════════
   INLINE TEXT-ONLY SHORTCODES
   [emas_spot] [emas_perubahan] [emas_antam] [emas_antam_perubahan]
   These shortcodes output a bare <span> — no wrapper, no background,
   no table, no attribution. Colours are overridden by the Customizer
   and can also be set per-shortcode via the color= attribute.
   ═══════════════════════════════════════════════════════════ */

.hei-inline {
    display: inline;
    /* Inherit font from surrounding content by default */
}

/* Default direction colours — overridden by Customizer <style> block
   and also by per-shortcode color_up= / color_down= inline style. */
.hei-inline-up   { color: #4CAF50; }
.hei-inline-down { color: #f44336; }

/* ═══════════════════════════════════════════════════════
   BRAND PRICE TABLE  —  [harga_emas_brand]  (.hei-brand)
   ═══════════════════════════════════════════════════════ */
.hei-brand .hei-brand-table th:not(:first-child),
.hei-brand .hei-brand-table td:not(:first-child) {
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.hei-brand-date {
    font-size: 11px;
    opacity: 0.6;
    white-space: nowrap;
}
.hei-brand-empty {
    font-size: 13px;
    opacity: 0.7;
    margin: 12px 0;
}
.hei-brand .hei-footer a { color: inherit; }
.hei-brand-error {
    color: #c62828;
    font-size: 13px;
}
