/* fear and greed board */
.fg-top { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; align-items: stretch; }
.fg-now, .fg-pastp { display: flex; flex-direction: column; }
.fg-now .panel-f, .fg-pastp .panel-f { margin-top: auto; }
.fg-now .panel-f .i { width: 15px; height: 15px; }

/* gauge */
.fg-gauge { position: relative; flex: 1 1 auto; min-height: 236px; margin: 12px 18px 0; }
.fg-gauge canvas { position: absolute; inset: 0; }
.fg-gauge canvas { display: block; width: 100%; height: 100%; }
.fg-read { position: absolute; left: 50%; top: 40%; transform: translateX(-50%); display: grid; justify-items: center; gap: 4px; text-align: center; pointer-events: none; }
.fg-val { font-size: 60px; font-weight: 700; letter-spacing: -.035em; line-height: 1; }
.fg-cls { font-size: 16px; font-weight: 650; white-space: nowrap; }
.fg-key { justify-content: center; padding: 14px 18px 16px; }
.fg-key i { border-radius: 50%; }

/* past readings */
.fg-past { list-style: none; margin: 0; padding: 6px 18px 10px; display: grid; }
.fg-past li { display: grid; grid-template-columns: minmax(0, 1fr) auto 56px; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.fg-past li:last-child { border-bottom: 0; }
.fg-pl { display: grid; gap: 1px; font-size: 14.5px; font-weight: 620; }
.fg-pl small { font-size: 12px; font-weight: 500; color: var(--text-3); font-variant-numeric: tabular-nums; }
.fg-pv { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-2); white-space: nowrap; }
.fg-pv b { font-size: 20px; font-weight: 680; min-width: 2ch; text-align: right; font-variant-numeric: tabular-nums; }
.fg-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--bg-sunk); flex: none; }
.fg-pdiff { text-align: right; font-weight: 650; font-size: 14px; }

.fg-stats { margin: 16px 0; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.fg-stats .sv { font-size: 22px; }
.fg-stats .ss { overflow-wrap: anywhere; }

/* history chart */
.fg-hist .panel-h { flex-wrap: wrap; row-gap: 10px; }
.fg-hist .chip .i { width: 15px; height: 15px; }
.fg-hover { display: flex; flex-wrap: wrap; gap: 4px 18px; padding: 12px 18px 0; font-size: 13.5px; color: var(--text-2); min-height: 33px; font-variant-numeric: tabular-nums; }
.fg-hover b { font-weight: 680; }
.fg-hd { color: var(--text); font-weight: 620; }
.lg-fg { background: var(--amber-deep); }
.lg-btc { background: var(--text-3); height: 2px !important; vertical-align: 3px !important; }

/* zones and forward returns */
.fg-pair { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); align-items: start; }
.fg-zbar, .fg-yb { display: flex; height: 14px; border-radius: 5px; overflow: hidden; background: var(--bg-sunk); }
.fg-zbar { height: 18px; }
.fg-zbar i, .fg-yb i { display: block; height: 100%; flex: none; }
.fg-zlist { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.fg-zlist li { display: grid; grid-template-columns: 12px minmax(0, 1fr) 64px 64px; align-items: center; gap: 10px; font-size: 14px; }
.fg-zlist li i { width: 12px; height: 12px; border-radius: 3px; }
.fg-zlist li b { font-weight: 650; text-align: right; }
.fg-zlist li span:last-child { text-align: right; font-size: 13px; }
.fg-sub { font-size: 13.5px; font-weight: 650; color: var(--text-2); margin: 22px 0 10px; padding-top: 16px; border-top: 1px solid var(--line); }
.fg-years { display: grid; gap: 8px; }
.fg-yr { display: grid; grid-template-columns: 44px minmax(0, 1fr) 30px; align-items: center; gap: 10px; font-size: 13px; }
.fg-yl { color: var(--text-2); font-weight: 600; }
.fg-ya { text-align: right; font-weight: 650; }

.fg-tbl th.c { text-align: center; }
.fg-tbl th.fg-hg { border-bottom: 1px solid var(--line); color: var(--text-2); }
.fg-tbl thead tr:first-child th { position: static; }
.fg-tbl thead tr + tr th { position: static; }
.fg-tbl td { padding-top: 9px; padding-bottom: 9px; }
.fg-tbl .pill { min-width: 62px; justify-content: center; }
.fg-zc { display: inline-flex; align-items: center; gap: 8px; font-weight: 620; }
.fg-zc i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.fg-tag { font-size: 11.5px; font-weight: 650; color: var(--accent-ink); border: 1px solid var(--line-strong); border-radius: 5px; padding: 0 5px; line-height: 1.5; }
.fg-tbl tr.cur { background: var(--bg-sunk); }
.fg-tbl tr.fg-base td { border-top: 1px solid var(--line-strong); color: var(--text-2); font-weight: 600; }

/* spread of 30-day returns after each zone */
.fg-rng { padding: 16px 18px 6px; border-top: 1px solid var(--line); }
.fg-rng h3 { font-size: 13.5px; font-weight: 650; color: var(--text-2); margin: 0 0 12px; }
.fg-rr { display: grid; grid-template-columns: 92px minmax(0, 1fr); align-items: center; gap: 12px; height: 26px; font-size: 13px; }
.fg-rr > span:first-child { color: var(--text-2); font-weight: 600; white-space: nowrap; }
.fg-rt { position: relative; height: 100%; }
.fg-rt .zero { position: absolute; top: 2px; bottom: 2px; width: 1px; background: var(--line-strong); }
.fg-rt .w { position: absolute; top: 11px; height: 4px; border-radius: 2px; opacity: .45; }
.fg-rt .q { position: absolute; top: 7px; height: 12px; border-radius: 3px; }
.fg-rt .m { position: absolute; top: 4px; height: 18px; width: 2px; margin-left: -1px; background: var(--text); border-radius: 1px; }
.fg-rax { position: relative; height: 18px; margin-left: 104px; font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.fg-rax span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.fg-rt .fg-allc { background: var(--text-3); }
.fg-rkey { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--text-3); padding: 8px 0 6px; }
.fg-rkey i { display: inline-block; vertical-align: -1px; margin-right: 6px; background: var(--text-3); }
.fg-rkey .k1 { width: 14px; height: 4px; opacity: .45; border-radius: 2px; vertical-align: 2px; }
.fg-rkey .k2 { width: 14px; height: 10px; border-radius: 3px; }
.fg-rkey .k3 { width: 2px; height: 12px; background: var(--text); }

/* zone colours: fear follows the down colour, greed the up colour, neutral the amber.
   Kept last so they win over the neutral fills above (dots, bars). */
.z0 { background: var(--down); }
.z1 { background: color-mix(in oklab, var(--down) 55%, var(--bg-sunk)); }
.z2 { background: var(--amber-deep); }
.z3 { background: color-mix(in oklab, var(--up) 55%, var(--bg-sunk)); }
.z4 { background: var(--up); }
.zt0 { color: var(--down); }
.zt1 { color: color-mix(in oklab, var(--down) 72%, var(--text)); }
.zt2 { color: var(--accent-ink); }
.zt3 { color: color-mix(in oklab, var(--up) 72%, var(--text)); }
.zt4 { color: var(--up); }
.lg-zone i, .chart-legend .lg-zone i { margin-right: 0; border-radius: 2px; }
.lg-zone i:last-of-type { margin-right: 6px; }

@media (max-width: 1180px) {
  .fg-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fg-pair { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .fg-top { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .fg-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fg-stats .sv { font-size: 19px; }
  .fg-gauge { height: 200px; margin: 8px 8px 0; }
  .fg-val { font-size: 48px; }
  .fg-hist .panel-h .sp { margin-left: 0; flex-wrap: wrap; }
  .fg-fwd .panel-h { flex-wrap: wrap; row-gap: 10px; }
  .fg-fwd .panel-h .sp { margin-left: 0; }
  .fg-tbl .fg-md { display: none; }
  .fg-tbl th, .fg-tbl td { padding-left: 7px; padding-right: 7px; }
  .fg-tbl .pill { min-width: 0; }
  .fg-zlist li { grid-template-columns: 12px minmax(0, 1fr) 56px 54px; }
  .fg-past li { grid-template-columns: minmax(0, 1fr) auto 44px; gap: 8px; }
  .fg-rr { grid-template-columns: 76px minmax(0, 1fr); gap: 8px; }
  .fg-rax { margin-left: 84px; }
  .fg-rng { padding-left: 12px; padding-right: 12px; }
}
