/* Intel Hub · Volatility Desk — Unified Desk (GCT tokens) */

/* Keep TV/news chrome collapse when this panel layout is active */
#view-caleco.ih-volatility-desk-layout #ih-mod-tv .ih-tv-chans,
#view-caleco.ih-volatility-desk-layout #ih-mod-tv .ih-tv-brand-foot {
  display: none !important;
  height: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  visibility: hidden !important;
  border: none !important;
}

#view-caleco.ih-volatility-desk-layout #ih-news-chans-page {
  display: none !important;
  height: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  visibility: hidden !important;
}

#ih-panel-volatility-desk {
  --ih-vd-z: 1.55;
}

body.ih-hub-full #ih-panel-volatility-desk {
  --ih-vd-z: 1.72;
}

.ih-vd {
  --ih-vd-bg: #05070a;
  --ih-vd-cyan: #4A9BB1;
  --ih-vd-cyan-hot: #5eb8d0;
  --ih-vd-green: #67E6C9;
  --ih-vd-red: #E77A7A;
  --ih-vd-amber: #E8B44A;
  --ih-vd-dim: #7a8894;
  --ih-vd-mute: #5a6874;
  --ih-vd-text: #e8eef2;
  --ih-vd-border: rgba(74, 155, 177, 0.22);
  --ih-vd-line: rgba(255, 255, 255, 0.07);
  background: var(--ih-vd-bg);
  box-sizing: border-box;
  color: var(--ih-vd-text);
  display: flex;
  flex-direction: column;
  font-family: var(--font-bloomberg, var(--mono), Consolas, monospace);
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.ih-vd *, .ih-vd *::before, .ih-vd *::after { box-sizing: border-box; }

.ih-vd__toolbar {
  align-items: center;
  border-bottom: 1px solid var(--ih-vd-border);
  display: flex;
  flex-shrink: 0;
  gap: 12px;
  justify-content: space-between;
  padding: calc(10px * var(--ih-vd-z, 1)) calc(14px * var(--ih-vd-z, 1));
}

.ih-vd__title {
  color: var(--ih-vd-cyan);
  font-size: calc(13px * var(--ih-vd-z, 1));
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.ih-vd__meta {
  color: var(--ih-vd-dim);
  font-size: calc(12px * var(--ih-vd-z, 1));
  margin-top: 3px;
}

.ih-vd__toolbar-right {
  align-items: center;
  display: flex;
  gap: 10px;
}

.ih-vd__live {
  align-items: center;
  color: var(--ih-vd-green);
  display: inline-flex;
  font-size: calc(11px * var(--ih-vd-z, 1));
  gap: 6px;
  letter-spacing: 0.1em;
}

.ih-vd__live i {
  background: var(--ih-vd-green);
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(116, 222, 198, 0.65);
  display: inline-block;
  height: 6px;
  width: 6px;
}

.ih-vd__refresh {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--ih-vd-line);
  color: var(--ih-vd-cyan);
  cursor: pointer;
  font-size: calc(15px * var(--ih-vd-z, 1));
  padding: calc(6px * var(--ih-vd-z, 1)) calc(10px * var(--ih-vd-z, 1));
}

.ih-vd__err {
  background: rgba(224, 134, 134, 0.1);
  border: 1px solid rgba(224, 134, 134, 0.35);
  color: #ffb0b0;
  flex-shrink: 0;
  font-size: calc(12px * var(--ih-vd-z, 1));
  margin: 6px 14px 0;
  padding: 8px 10px;
}

.ih-vd__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: calc(10px * var(--ih-vd-z, 1)) calc(12px * var(--ih-vd-z, 1));
  scrollbar-width: thin;
}

.ih-vd__foot {
  align-items: center;
  border-top: 1px solid var(--ih-vd-border);
  color: var(--ih-vd-mute);
  display: flex;
  flex-shrink: 0;
  font-size: calc(11px * var(--ih-vd-z, 1));
  justify-content: space-between;
  letter-spacing: 0.08em;
  padding: 6px 14px;
  text-transform: uppercase;
}

.ih-vd-desk {
  display: flex;
  flex-direction: column;
  gap: calc(12px * var(--ih-vd-z, 1));
  min-height: 100%;
}

.ih-vd-zone__hd {
  color: var(--ih-vd-cyan);
  font-size: calc(11px * var(--ih-vd-z, 1));
  font-weight: 700;
  letter-spacing: 0.12em;
  margin-bottom: 8px;
}

.ih-vd-empty {
  color: var(--ih-vd-dim);
  font-size: calc(13px * var(--ih-vd-z, 1));
  padding: 12px 4px;
}

.ih-vd-chg--up { color: var(--ih-vd-green) !important; }
.ih-vd-chg--dn { color: var(--ih-vd-red) !important; }
.ih-vd-chg--flat { color: var(--ih-vd-text); }

/* A · KPI */
.ih-vd-kpi {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ih-vd-kpi__cell {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--ih-vd-line);
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: calc(10px * var(--ih-vd-z, 1)) calc(12px * var(--ih-vd-z, 1));
}

.ih-vd-kpi__cell--low { border-color: rgba(116, 222, 198, 0.45); }
.ih-vd-kpi__cell--normal { border-color: rgba(74, 155, 177, 0.4); }
.ih-vd-kpi__cell--elevated { border-color: rgba(232, 180, 74, 0.5); }
.ih-vd-kpi__cell--extreme { border-color: rgba(224, 134, 134, 0.55); }

.ih-vd-kpi__cell i {
  color: var(--ih-vd-mute);
  font-size: calc(10px * var(--ih-vd-z, 1));
  font-style: normal;
  letter-spacing: 0.1em;
}

.ih-vd-kpi__cell b {
  font-size: calc(22px * var(--ih-vd-z, 1));
  font-weight: 700;
}

.ih-vd-kpi__cell span {
  color: var(--ih-vd-dim);
  font-size: calc(12px * var(--ih-vd-z, 1));
}

.ih-vd-kpi__cell span em { font-style: normal; }

/* B · Classes */
.ih-vd-cls {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ih-vd-cls__cell {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--ih-vd-line);
  border-top: 2px solid var(--ih-vd-cyan);
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: calc(10px * var(--ih-vd-z, 1));
}

.ih-vd-cls__cell--equity { border-top-color: var(--ih-vd-red); }
.ih-vd-cls__cell--fx { border-top-color: var(--ih-vd-cyan); }
.ih-vd-cls__cell--commodity { border-top-color: var(--ih-vd-amber); }
.ih-vd-cls__cell--crypto { border-top-color: var(--ih-vd-green); }

.ih-vd-cls__cell i {
  color: var(--ih-vd-mute);
  font-size: calc(10px * var(--ih-vd-z, 1));
  font-style: normal;
  letter-spacing: 0.1em;
}

.ih-vd-cls__cell b {
  font-size: calc(18px * var(--ih-vd-z, 1));
  font-weight: 700;
}

.ih-vd-cls__cell span {
  color: var(--ih-vd-dim);
  font-size: calc(11px * var(--ih-vd-z, 1));
}

/* C · Ledger */
.ih-vd-zone--ledger {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--ih-vd-line);
  padding: 8px 10px 10px;
}

.ih-vd-tbl-wrap {
  overflow: auto;
  scrollbar-width: thin;
}

.ih-vd-tbl {
  border-collapse: collapse;
  font-size: calc(13px * var(--ih-vd-z, 1));
  width: 100%;
}

.ih-vd-tbl th {
  background: #070a0e;
  border-bottom: 1px solid var(--ih-vd-border);
  color: var(--ih-vd-mute);
  font-size: calc(11px * var(--ih-vd-z, 1));
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 8px 8px;
  position: sticky;
  text-align: left;
  top: 0;
  white-space: nowrap;
}

.ih-vd-tbl th.num,
.ih-vd-tbl td.num {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.ih-vd-tbl th.reg,
.ih-vd-tbl td:last-child {
  text-align: right;
}

.ih-vd-tbl td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  padding: 8px;
  white-space: nowrap;
}

.ih-vd-tbl td.name { color: var(--ih-vd-cyan-hot); font-weight: 600; text-align: left; }
.ih-vd-tbl td.mute { color: var(--ih-vd-dim); }

.ih-vd-tbl tbody tr.ih-vd-row--extreme { box-shadow: inset 2px 0 0 var(--ih-vd-red); }
.ih-vd-tbl tbody tr.ih-vd-row--elevated { box-shadow: inset 2px 0 0 var(--ih-vd-amber); }
.ih-vd-tbl tbody tr.ih-vd-row--low { box-shadow: inset 2px 0 0 var(--ih-vd-green); }
.ih-vd-tbl tbody tr.ih-vd-row--normal { box-shadow: inset 2px 0 0 var(--ih-vd-cyan); }
.ih-vd-tbl tbody tr.is-empty { opacity: 0.55; }

.ih-vd-g--equity { color: var(--ih-vd-red) !important; }
.ih-vd-g--fx { color: var(--ih-vd-cyan-hot) !important; }
.ih-vd-g--commodity { color: var(--ih-vd-amber) !important; }
.ih-vd-g--crypto { color: var(--ih-vd-green) !important; }
.ih-vd-g--vol { color: var(--ih-vd-cyan) !important; }

.ih-vd-badge {
  border: 1px solid var(--ih-vd-line);
  display: inline-block;
  font-size: calc(10px * var(--ih-vd-z, 1));
  letter-spacing: 0.06em;
  padding: 2px 6px;
}

.ih-vd-badge--extreme { border-color: rgba(224, 134, 134, 0.5); color: var(--ih-vd-red); }
.ih-vd-badge--elevated { border-color: rgba(232, 180, 74, 0.5); color: var(--ih-vd-amber); }
.ih-vd-badge--low { border-color: rgba(116, 222, 198, 0.5); color: var(--ih-vd-green); }
.ih-vd-badge--normal { border-color: rgba(74, 155, 177, 0.45); color: var(--ih-vd-cyan-hot); }
.ih-vd-badge--neutral { color: var(--ih-vd-dim); }

/* D · Ranking */
.ih-vd-rank {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ih-vd-rank__row {
  align-items: center;
  border-top: 1px solid var(--ih-vd-line);
  display: grid;
  gap: 12px;
  /* # · ativo+classe · barra · % · regime */
  grid-template-columns: 36px minmax(120px, 168px) minmax(0, 1fr) 84px 100px;
  padding: 7px 0;
}

.ih-vd-rank__n {
  color: var(--ih-vd-mute);
  font-size: calc(12px * var(--ih-vd-z, 1));
}

.ih-vd-rank__asset {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ih-vd-rank__sym {
  color: var(--ih-vd-text);
  font-size: calc(13px * var(--ih-vd-z, 1));
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ih-vd-rank__cls {
  font-size: calc(10px * var(--ih-vd-z, 1));
  letter-spacing: 0.06em;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ih-vd-rank__bar {
  background: rgba(255, 255, 255, 0.06);
  box-sizing: border-box;
  height: calc(10px * var(--ih-vd-z, 1));
  min-width: 0;
  overflow: hidden;
  padding-right: 12px;
}

.ih-vd-rank__fill {
  display: block;
  height: 100%;
  max-width: 100%;
}

.ih-vd-rank__fill--equity { background: linear-gradient(90deg, rgba(224, 134, 134,0.35), var(--ih-vd-red)); }
.ih-vd-rank__fill--fx { background: linear-gradient(90deg, rgba(74,155,177,0.35), var(--ih-vd-cyan)); }
.ih-vd-rank__fill--commodity { background: linear-gradient(90deg, rgba(232,180,74,0.35), var(--ih-vd-amber)); }
.ih-vd-rank__fill--crypto { background: linear-gradient(90deg, rgba(116, 222, 198,0.35), var(--ih-vd-green)); }
.ih-vd-rank__fill--vol { background: linear-gradient(90deg, rgba(74,155,177,0.35), var(--ih-vd-cyan-hot)); }

.ih-vd-rank__val {
  font-size: calc(13px * var(--ih-vd-z, 1));
  font-variant-numeric: tabular-nums;
  margin-right: 4px;
  min-width: 76px;
  padding-right: 12px;
  text-align: right;
}

.ih-vd-rank__reg {
  justify-self: end;
  min-width: 92px;
  text-align: right;
}

.ih-vd-rank__reg .ih-vd-badge {
  display: inline-block;
  min-width: 78px;
  text-align: center;
}

@media (max-width: 1100px) {
  .ih-vd-kpi { grid-template-columns: 1fr; }
  .ih-vd-cls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ih-vd-rank__row {
    grid-template-columns: 32px minmax(96px, 1fr) minmax(0, 1.2fr) 72px;
  }
  .ih-vd-rank__cls,
  .ih-vd-rank__reg { display: none; }
}
