/* =================================================================
   ForexChart — homepage finance widget
   Sits in the right column above the spor slider.
   CLS-safe: card has predictable heights via fixed children.
================================================================= */

.fx-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow:
    0 1px 2px rgba(15, 20, 35, 0.04),
    0 8px 22px -12px rgba(15, 20, 35, 0.10);
  position: relative;
  font-family: var(--font-sans);
}

/* === TABS === */
.fx-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: oklch(96% 0.005 250);
  padding: 4px;
  border-radius: 10px;
  gap: 2px;
  height: 40px;
  overflow: hidden;
  align-items: stretch;
}
.fx-tab {
  background: transparent;
  border: 0;
  color: oklch(50% 0.012 265);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0 4px;
  border-radius: 7px;
  cursor: pointer;
  transition: background .18s ease, color .18s ease;
  white-space: nowrap;
  font-family: var(--font-sans);
  min-width: 0;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.fx-tab:hover { color: var(--ink); }
.fx-tab.is-active {
  background: #fff;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px oklch(91% 0.006 250);
}

/* === DATA ROWS === */
.fx-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 2px 4px;
}
.fx-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13.5px;
  letter-spacing: -0.005em;
  height: 22px;
}
.fx-row-label {
  color: oklch(48% 0.010 265);
  font-weight: 500;
}
.fx-row-val {
  font-weight: 800;
  font-family: var(--font-sans);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.015em;
  font-size: 15px;
}
.fx-row-val.fx-down { color: oklch(56% 0.22 25); }
.fx-row-val.fx-up   { color: oklch(56% 0.16 152); }
.fx-row-val.fx-flat { color: oklch(48% 0.010 265); }

/* === CHART === */
.fx-chart {
  background:
    radial-gradient(120% 100% at 50% 0%, oklch(98% 0.004 250) 0%, oklch(96% 0.005 250) 100%);
  border-radius: 12px;
  padding: 12px;
  position: relative;
  height: 200px;
  overflow: hidden;
}
.fx-chart-up   { box-shadow: inset 0 0 0 1px oklch(92% 0.04 152); }
.fx-chart-down { box-shadow: inset 0 0 0 1px oklch(92% 0.04 25); }
.fx-chart-flat { box-shadow: inset 0 0 0 1px oklch(92% 0.005 250); }

.fx-svg {
  width: 100%;
  height: 100%;
  display: block;
}
.fx-trend {
  position: absolute;
  top: 12px;
  right: 14px;
  color: oklch(45% 0.012 265);
  opacity: 0.75;
  transition: transform .18s ease, opacity .18s ease;
}
.fx-chart-up .fx-trend   { color: oklch(50% 0.16 152); }
.fx-chart-down .fx-trend { color: oklch(50% 0.22 25); }
.fx-card:hover .fx-trend { transform: translateX(2px) translateY(-2px); opacity: 1; }

/* === FOOTER STATS === */
.fx-foot {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  align-items: center;
  gap: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  height: 64px;
}
.fx-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.fx-stat-r { align-items: flex-end; }
.fx-stat-divider {
  width: 1px;
  height: 32px;
  background: var(--line);
  align-self: center;
}
.fx-stat-label {
  font-size: 11px;
  font-weight: 700;
  color: oklch(50% 0.010 265);
  letter-spacing: 0.06em;
  line-height: 14px;
}
.fx-stat-val {
  font-size: 19px;
  font-weight: 800;
  color: var(--ink);
  font-family: var(--font-sans);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.022em;
  line-height: 22px;
}

/* === Compact tweaks for narrow columns === */
@media (max-width: 1280px) {
  .fx-stat-val { font-size: 17px; }
  .fx-tab { font-size: 10.5px; letter-spacing: 0.03em; }
}
@media (max-width: 720px) {
  .fx-card { padding: 14px; gap: 12px; border-radius: 14px; }
  .fx-chart { height: 170px; }
  .fx-stat-val { font-size: 16px; }
}
