/* ============================================================================
   Currency converter — extends .j-calc with two-side panel + dropdowns.
   Inherits design tokens from main.css / calc.css.
   ============================================================================ */

.fx-shell {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1.2rem;
  align-items: stretch;
  margin: 0 0 1.6rem;
}
@media (max-width: 820px) {
  /* minmax(0,1fr) — not plain 1fr — so the track can shrink below the content's
     min-content. The non-shrinking <select> (long option labels gave it a
     ~287px min-content) was inflating the 1fr track to ~653px and pushing the
     whole converter 309px off the right edge on phones. */
  .fx-shell {
    grid-template-columns: minmax(0, 1fr);
  }
  /* Stack the currency picker above the amount so both stay full-width & usable. */
  .fx-currency-row { flex-direction: column; }
  .fx-currency-row .fx-select,
  .fx-currency-row .fx-amount { width: 100%; min-width: 0; }
  .fx-amount { text-align: left; }
}

.fx-side {
  background: rgba(11, 16, 24, 0.55);
  border: 1px solid rgba(250, 246, 238, 0.10);
  border-left: 3px solid var(--c-gold);
  padding: 1.4rem 1.4rem 1.6rem;
  border-radius: 2px;
  display: flex;
  flex-direction: column;
}

.fx-side-h {
  font-family: var(--f-sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--c-gold);
  margin: 0 0 0.95rem;
}

.fx-currency-row {
  display: flex;
  gap: 0.6rem;
  align-items: stretch;
  margin: 0 0 0.9rem;
}

.fx-select {
  flex: 0 0 auto;
  min-width: 7.2rem;
  font-family: var(--f-sans);
  font-size: 0.98rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--c-bone);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(198, 154, 77, 0.35);
  border-radius: 2px;
  padding: 0.7rem 0.85rem;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--c-gold) 50%),
                    linear-gradient(135deg, var(--c-gold) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 2rem;
}
.fx-select:focus {
  outline: none;
  border-color: var(--c-gold);
  box-shadow: 0 0 0 3px rgba(198, 154, 77, 0.18);
}
.fx-select option {
  background: #4a1119;
  color: var(--c-bone);
}

.fx-amount {
  flex: 1 1 auto;
  font-family: var(--f-display);
  font-size: clamp(1.4rem, 2.4vw, 1.85rem);
  font-weight: 300;
  letter-spacing: -0.005em;
  color: var(--c-bone);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(198, 154, 77, 0.35);
  border-radius: 2px;
  padding: 0.55rem 0.9rem;
  text-align: right;
  min-width: 0;
}
.fx-amount:focus {
  outline: none;
  border-color: var(--c-gold);
  box-shadow: 0 0 0 3px rgba(198, 154, 77, 0.18);
}
.fx-amount[readonly] {
  background: rgba(198, 154, 77, 0.06);
  color: var(--c-gold);
  cursor: default;
}

.fx-words {
  font-family: var(--f-sans);
  font-size: 0.84rem;
  letter-spacing: 0.02em;
  color: rgba(250, 246, 238, 0.55);
  margin: 0;
  line-height: 1.4;
  min-height: 1.2em;
}

.fx-swap-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}
.fx-swap {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: #4a1119;
  border: 1px solid rgba(198, 154, 77, 0.45);
  color: var(--c-gold);
  font-family: var(--f-sans);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.25s ease, background 0.2s ease, border-color 0.2s ease;
}
.fx-swap:hover {
  background: var(--c-gold);
  color: #4a1119;
  border-color: var(--c-gold);
  transform: rotate(180deg);
}
.fx-swap:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(198, 154, 77, 0.18);
}
@media (max-width: 820px) {
  .fx-swap-wrap { padding: 0.2rem 0; }
  .fx-swap { transform: rotate(90deg); }
  .fx-swap:hover { transform: rotate(270deg); }
}

/* ---------- Rate + freshness line ---------- */
.fx-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem 2rem;
  align-items: baseline;
  padding: 1rem 1.2rem;
  background: rgba(0, 0, 0, 0.35);
  border-top: 1px solid rgba(198, 154, 77, 0.22);
  border-bottom: 1px solid rgba(198, 154, 77, 0.22);
  margin: 0 0 2rem;
}
.fx-meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.fx-meta-l {
  font-family: var(--f-sans);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(250, 246, 238, 0.55);
}
.fx-meta-v {
  font-family: var(--f-display);
  font-size: 1.05rem;
  color: var(--c-bone);
  font-weight: 400;
}
.fx-meta-v .dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  margin-right: 0.45rem;
  vertical-align: 1px;
  background: rgba(250, 246, 238, 0.35);
}
.fx-meta-v.is-live   .dot { background: #6cd178; box-shadow: 0 0 0 3px rgba(108, 209, 120, 0.18); }
.fx-meta-v.is-cached .dot { background: var(--c-gold); }

/* ---------- Cross-rate grid (BRL → all) ---------- */
.fx-grid-wrap {
  margin: 0;
}
.fx-grid-h {
  font-family: var(--f-sans);
  font-size: 0.78rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--c-gold);
  margin: 0 0 0.9rem;
}
.fx-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 0.6rem;
}
.fx-grid-cell {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.7rem 0.95rem;
  background: rgba(0, 0, 0, 0.30);
  border: 1px solid rgba(250, 246, 238, 0.08);
  border-left: 2px solid rgba(198, 154, 77, 0.35);
  border-radius: 2px;
}
.fx-grid-cell .l {
  font-family: var(--f-sans);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  color: rgba(250, 246, 238, 0.65);
}
.fx-grid-cell .v {
  font-family: var(--f-display);
  font-size: 1.02rem;
  color: var(--c-bone);
}

/* ---------- Tip line under converter ---------- */
.fx-tip {
  font-family: var(--f-sans);
  font-size: 0.88rem;
  color: rgba(250, 246, 238, 0.62);
  margin: 1.2rem 0 0;
  max-width: 60ch;
  line-height: 1.5;
}
