/* Fear & Greed wrapped in .tgal-shell — match other suite modules; strip duplicate outer chrome inside shell. */
/* Fill the parent (e.g. tab panel / column); do not cap with module shell max-width here. */
.tgal-shell.tgal-shell--fear-greed {
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100%;
    max-width: 100% !important;
    box-sizing: border-box;
}

.tgal-shell--fear-greed .bb-fear-greed.bb-fear-greed--in-tgal-shell {
    background: transparent;
    border: none;
    box-shadow: none;
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: none;
    min-width: 0;
}

.tgal-shell--fear-greed .bb-fear-greed--in-tgal-shell::before {
    display: none;
}

.bb-fear-greed {
    --bb-fg-font-scale: 1;
    --bb-fg-font-scale-shell-user: 1;
    --bb-fg-font-scale-title-user: 1;
    --bb-fg-font-scale-score-user: 1;
    --bb-fg-font-scale-body-user: 1;
    --bb-fg-gauge-arc-scale-user: 1;
    --bb-fg-gauge-max-width: 280px;
    --bb-fg-bg-start: #0f172a;
    --bb-fg-bg-end: #111827;
    --bb-fg-border: #22d3ee;
    --bb-fg-text: #e5e7eb;
    --bb-fg-muted: #94a3b8;
    --bb-fg-fear: #f97316;
    --bb-fg-greed: #22c55e;
    --bb-fg-inner-bg-start: #1e293b;
    --bb-fg-inner-bg-end: #0f172a;
    --bb-fg-inner-border: #334155;
    --bb-fg-title: #94a3b8;
    --bb-fg-score: #f8fafc;
    --bb-fg-gauge-s1: #ef4444;
    --bb-fg-gauge-s2: #f97316;
    --bb-fg-gauge-s3: #eab308;
    --bb-fg-gauge-s4: #84cc16;
    --bb-fg-gauge-s5: #22c55e;
    --bb-fg-gauge-needle: #f8fafc;
    --bb-fg-gauge-track: #334155;
    --bb-fg-sparkline-stroke: #67e8f9;
    --bb-fg-sparkline-fill: #67e8f9;
    --bb-fg-chart-axis: #475569;
    box-sizing: border-box;
    width: 100%;
    max-width: min(100%, var(--bb-module-shell-max-width-desktop, 100%));
    min-width: min(100%, var(--bb-module-shell-min-width-desktop, 320px));
    margin: 0 auto;
    padding: calc(18px * var(--bb-fg-font-scale-shell-user, var(--bb-fg-font-scale, 1)));
    border-radius: calc(14px * var(--bb-fg-font-scale-shell-user, var(--bb-fg-font-scale, 1)));
    border: 1px solid color-mix(in srgb, var(--bb-fg-border) 24%, transparent);
    background:
        radial-gradient(
            ellipse 120% 80% at 50% -20%,
            color-mix(in srgb, var(--bb-fg-border) 12%, transparent),
            transparent 50%
        ),
        linear-gradient(180deg, var(--bb-fg-bg-start) 0%, var(--bb-fg-bg-end) 100%);
    color: var(--bb-fg-text);
    position: relative;
    overflow: hidden;
    box-shadow:
        0 0 0 1px color-mix(in srgb, var(--bb-fg-border) 6%, transparent),
        0 24px 64px color-mix(in srgb, #000 45%, transparent);
}

.bb-fear-greed::before {
    background: linear-gradient(
        90deg,
        var(--bb-fg-fear) 0%,
        var(--bb-fg-border) 45%,
        var(--bb-fg-greed) 100%
    );
    content: "";
    height: 5px;
    left: 0;
    pointer-events: none;
    position: absolute;
    right: 0;
    top: 0;
}

.bb-fear-greed--layout-gauge.bb-fear-greed--has-card {
    padding: calc(14px * var(--bb-fg-font-scale-shell-user, var(--bb-fg-font-scale, 1)));
}

.bb-fear-greed__hero {
    padding-bottom: calc(4px * var(--bb-fg-font-scale-shell-user, var(--bb-fg-font-scale, 1)));
}

.bb-fear-greed__meta {
    border-top: 1px solid color-mix(in srgb, var(--bb-fg-inner-border) 35%, transparent);
    margin-top: calc(14px * var(--bb-fg-font-scale-shell-user, var(--bb-fg-font-scale, 1)));
    padding-top: calc(14px * var(--bb-fg-font-scale-shell-user, var(--bb-fg-font-scale, 1)));
}

.bb-fear-greed__score-block {
    align-items: baseline;
    display: flex;
    gap: 0.2em;
    justify-content: center;
    margin: calc(6px * var(--bb-fg-font-scale-shell-user, var(--bb-fg-font-scale, 1))) 0 0;
}

.bb-fear-greed__score-suffix {
    color: var(--bb-fg-muted);
    font-size: calc(1rem * var(--bb-fg-font-scale-body-user, var(--bb-fg-font-scale, 1)));
    font-weight: 600;
    letter-spacing: 0.02em;
    opacity: 0.85;
}

.bb-fear-greed__card {
    box-sizing: border-box;
    padding: calc(16px * var(--bb-fg-font-scale-shell-user, var(--bb-fg-font-scale, 1)))
        calc(14px * var(--bb-fg-font-scale-shell-user, var(--bb-fg-font-scale, 1)))
        calc(18px * var(--bb-fg-font-scale-shell-user, var(--bb-fg-font-scale, 1)));
    border-radius: calc(14px * var(--bb-fg-font-scale-shell-user, var(--bb-fg-font-scale, 1)));
    border: 1px solid color-mix(in srgb, var(--bb-fg-inner-border) 50%, transparent);
    background: linear-gradient(180deg, var(--bb-fg-inner-bg-start) 0%, var(--bb-fg-inner-bg-end) 100%);
    box-shadow:
        0 1px 0 color-mix(in srgb, #fff 6%, transparent) inset,
        0 12px 28px color-mix(in srgb, #000 28%, transparent);
}

@media (min-width: 600px) and (max-width: 959px) {
    .bb-fear-greed {
        max-width: min(100%, var(--bb-module-shell-max-width-tablet, 100%));
    }

    .tgal-shell.tgal-shell--fear-greed {
        max-width: 100% !important;
    }
}

@media (max-width: 599px) {
    .bb-fear-greed {
        max-width: min(100%, var(--bb-module-shell-max-width-mobile, 100%));
        min-width: min(100%, var(--bb-module-shell-min-width-mobile, 0px));
    }

    .tgal-shell.tgal-shell--fear-greed {
        max-width: 100% !important;
    }
}

.bb-fear-greed__title {
    margin: 0 0 6px;
    font-size: calc(0.82rem * var(--bb-fg-font-scale-title-user, var(--bb-fg-font-scale-body-user, var(--bb-fg-font-scale, 1))));
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--bb-fg-title);
    text-transform: none;
}

.bb-fear-greed--layout-gauge .bb-fear-greed__title {
    margin-bottom: 8px;
    text-align: center;
}

.bb-fear-greed__gauge {
    --bb-fg-gauge-tick-stroke: calc(2px * var(--bb-fg-gauge-arc-scale-user, 1));
    --bb-fg-gauge-track-stroke: calc(5px * var(--bb-fg-gauge-arc-scale-user, 1));
    width: 100%;
    max-width: var(--bb-fg-gauge-max-width, 240px);
    margin: 0 auto;
}

.bb-fear-greed__gauge-svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

.bb-fear-greed__gauge-track {
    stroke: var(--bb-fg-gauge-track);
    stroke-width: var(--bb-fg-gauge-track-stroke);
    opacity: 0.22;
}

.bb-fear-greed__gauge-tick {
    stroke-width: var(--bb-fg-gauge-tick-stroke);
    stroke-linecap: round;
    paint-order: stroke fill;
}

.bb-fear-greed__gauge-needle {
    stroke: var(--bb-fg-gauge-needle);
    stroke-width: calc(2.25px * var(--bb-fg-gauge-arc-scale-user, 1));
}

.bb-fear-greed__gauge-pivot {
    fill: var(--bb-fg-gauge-needle);
}

.bb-fear-greed__score-value {
    margin: 0;
    text-align: center;
    font-size: calc(2.65rem * var(--bb-fg-font-scale-score-user, var(--bb-fg-font-scale-body-user, var(--bb-fg-font-scale, 1))));
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.04em;
    color: var(--bb-fg-score);
    text-shadow: 0 1px 0 color-mix(in srgb, #fff 8%, transparent);
}

.bb-fear-greed__gauge-scale {
    fill: var(--bb-fg-muted);
    font-size: 7px;
    font-weight: 600;
}

.bb-fear-greed__band-label {
    margin: 4px 0 0;
    text-align: center;
    font-size: calc(0.74rem * var(--bb-fg-font-scale-body-user, var(--bb-fg-font-scale, 1)));
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--bb-fg-text);
    opacity: 0.92;
}

.bb-fear-greed__trend {
    margin: 0 0 4px;
    text-align: center;
    font-size: calc(0.78rem * var(--bb-fg-font-scale-body-user, var(--bb-fg-font-scale, 1)));
    color: var(--bb-fg-muted);
    line-height: 1.35;
}

.bb-fear-greed__trend--detailed {
    text-align: inherit;
    margin-top: 8px;
}

.bb-fear-greed__sparkline {
    margin: 10px auto 0;
    width: 100%;
    max-width: var(--bb-fg-gauge-max-width, 240px);
    height: 48px;
}

.bb-fear-greed__sparkline--detailed {
    max-width: 100%;
    margin-top: 10px;
}

.bb-fear-greed__stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 10px auto 0;
    width: 100%;
    max-width: var(--bb-fg-gauge-max-width, 240px);
}

.bb-fear-greed__stats-wrap--detailed .bb-fear-greed__stats {
    max-width: 100%;
    margin-top: 10px;
}

.bb-fear-greed__stat-tile {
    text-align: center;
    padding: 10px 8px;
    border-radius: calc(12px * var(--bb-fg-font-scale-shell-user, var(--bb-fg-font-scale, 1)));
    border: 1px solid color-mix(in srgb, var(--bb-fg-inner-border) 45%, transparent);
    background: linear-gradient(180deg, color-mix(in srgb, var(--bb-fg-inner-bg-start) 55%, transparent) 0%, color-mix(in srgb, var(--bb-fg-inner-bg-end) 40%, transparent) 100%);
    box-shadow: 0 1px 0 color-mix(in srgb, #fff 5%, transparent) inset;
}

.bb-fear-greed__stat-label {
    display: block;
    font-size: calc(0.65rem * var(--bb-fg-font-scale-body-user, var(--bb-fg-font-scale, 1)));
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--bb-fg-muted);
    margin-bottom: 4px;
}

.bb-fear-greed__stat-value {
    font-size: calc(1.1rem * var(--bb-fg-font-scale-body-user, var(--bb-fg-font-scale, 1)));
    font-weight: 700;
    color: var(--bb-fg-score);
    letter-spacing: -0.02em;
}

.bb-fear-greed__barchart {
    margin: 10px auto 0;
    width: 100%;
    max-width: var(--bb-fg-gauge-max-width, 240px);
    height: 56px;
}

.bb-fear-greed__barchart--detailed {
    max-width: 100%;
    margin-top: 12px;
    height: 64px;
}

.bb-fear-greed__barchart-svg {
    display: block;
    width: 100%;
    height: 100%;
}

.bb-fear-greed__barchart-axis {
    stroke: var(--bb-fg-chart-axis);
    stroke-width: 0.65;
    vector-effect: non-scaling-stroke;
    opacity: 0.55;
}

.bb-fear-greed__sparkline-svg {
    display: block;
    width: 100%;
    height: 100%;
}

.bb-fear-greed__sparkline-stroke {
    stroke: var(--bb-fg-sparkline-stroke);
    stroke-width: 2.5;
    vector-effect: non-scaling-stroke;
}

.bb-fear-greed__classification {
    margin: 4px 0 0;
    text-align: center;
    font-size: calc(0.75rem * var(--bb-fg-font-scale-body-user, var(--bb-fg-font-scale, 1)));
    color: var(--bb-fg-muted);
}

.bb-fear-greed__source--compact {
    margin: 10px 0 0;
    text-align: center;
    font-size: calc(0.7rem * var(--bb-fg-font-scale-body-user, var(--bb-fg-font-scale, 1)));
    color: var(--bb-fg-muted);
    line-height: 1.35;
}

.bb-fear-greed__provider-link-wrap {
    margin: 6px 0 0;
    text-align: center;
    font-size: calc(0.68rem * var(--bb-fg-font-scale-body-user, var(--bb-fg-font-scale, 1)));
    line-height: 1.35;
}

.bb-fear-greed__provider-link-wrap--detailed {
    margin: 0 0 12px;
    text-align: inherit;
}

.bb-fear-greed__provider-link {
    color: var(--bb-fg-sparkline-stroke);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.bb-fear-greed__provider-link:hover {
    color: color-mix(in srgb, var(--bb-fg-sparkline-stroke) 82%, #fff);
}

.bb-fear-greed__updated--compact {
    margin: 6px 0 0;
    text-align: center;
    font-size: calc(0.68rem * var(--bb-fg-font-scale-body-user, var(--bb-fg-font-scale, 1)));
    color: var(--bb-fg-muted);
}

.bb-fear-greed__source {
    margin: 0 0 12px;
    font-size: calc(0.82rem * var(--bb-fg-font-scale-body-user, var(--bb-fg-font-scale, 1)));
    color: var(--bb-fg-muted);
}

.bb-fear-greed__updated {
    margin: 8px 0 0;
    font-size: calc(0.78rem * var(--bb-fg-font-scale-body-user, var(--bb-fg-font-scale, 1)));
    color: var(--bb-fg-muted);
}

.bb-fear-greed__notice {
    margin: 8px 0 0;
    font-size: calc(0.78rem * var(--bb-fg-font-scale-body-user, var(--bb-fg-font-scale, 1)));
    color: var(--bb-fg-muted);
}

.bb-fear-greed__notice-detail {
    display: inline-block;
    margin-left: 6px;
    opacity: 0.92;
}

.bb-fear-greed__notice--fallback {
    border-left: 3px solid color-mix(in srgb, var(--bb-fg-border) 70%, transparent);
    padding-left: 10px;
}

.bb-fear-greed__meter {
    height: 12px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(148, 163, 184, 0.2);
}

.bb-fear-greed__meter-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--bb-fg-fear) 0%, #facc15 48%, var(--bb-fg-greed) 100%);
}

.bb-fear-greed__score {
    margin: 10px 0 0;
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.bb-fear-greed__score strong {
    font-size: calc(1.35rem * var(--bb-fg-font-scale-body-user, var(--bb-fg-font-scale, 1)));
}

.bb-fear-greed__score--detailed .bb-fear-greed__score-denom {
    opacity: 0.75;
    font-weight: 500;
}

.bb-fear-greed__band {
    margin-left: auto;
    font-weight: 600;
}

.bb-fear-greed__disclaimer {
    margin: 10px 0 0;
    font-size: calc(0.78rem * var(--bb-fg-font-scale-body-user, var(--bb-fg-font-scale, 1)));
    color: var(--bb-fg-muted);
}
