/* /brain/fx-hedge -- USD/INR hedging cost (dashboard/templates/brain_v2/fx_hedge.html.jinja)
   and its tile on Today (home.html.jinja). Method card reuses .reit-method / .reit-formula. */

.fx-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); }
.fx-tile { display: grid; gap: 4px; align-content: start; padding: var(--s4); box-shadow: inset 3px 0 0 var(--accent); }
.fx-tile.is-estimate { box-shadow: inset 3px 0 0 var(--blue); }
.fx-tile .k {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2);
  font-size: var(--text-2xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--faint);
}
.fx-tile .k .pill { text-transform: none; letter-spacing: 0; }
.fx-tile b { font: 700 var(--text-xl)/1.15 var(--font-display); font-variant-numeric: tabular-nums; }
.fx-tile b small { font-size: var(--text-sm); font-weight: 600; color: var(--muted); }
.fx-tile .s { font-size: var(--text-sm); color: var(--text); font-variant-numeric: tabular-nums; }
.fx-tile .src { font-size: var(--text-2xs); color: var(--faint); overflow-wrap: anywhere; }
.fx-spot { margin: var(--s2) 0 0; }

.fx-fii-hero { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); margin-bottom: var(--s3); }
.fx-fii-hero > div { display: grid; gap: 2px; padding: var(--s3) var(--s4); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--panel-2); }
.fx-fii-hero .k { font-size: var(--text-2xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--faint); }
.fx-fii-hero b { font: 700 var(--text-xl)/1.15 var(--font-display); font-variant-numeric: tabular-nums; }
.fx-fii-hero b.down { color: var(--red); }
.fx-fii-hero .s { font-size: var(--text-xs); color: var(--muted); }
.fx-fii-table thead small { display: block; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--faint); }
.fx-fii-table tr.is-sum { background: var(--panel-2); }
.fx-fii-table tr.is-sum th, .fx-fii-table tr.is-sum td { font-weight: 700; }

.fx-card { padding: var(--s4); margin-top: var(--s4); }
.fx-card h2 { font: 700 var(--text-base)/1.3 var(--font-display); margin-bottom: var(--s3); }
.fx-card h3 { font: 700 var(--text-sm)/1.3 var(--font-display); margin: var(--s4) 0 var(--s2); }
.fx-card > p { font-size: var(--text-sm); max-width: 80ch; margin-top: var(--s2); }
.fx-card .callout { margin-bottom: var(--s3); }
.fx-stats { margin-top: var(--s3); }

.table-wrap { overflow-x: auto; max-width: 100%; }
.fx-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.fx-table th, .fx-table td { padding: var(--s2) var(--s3); border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.fx-table thead th { font-size: var(--text-2xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--faint); white-space: nowrap; }
.fx-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fx-table tbody th { font-weight: 600; }
.fx-table tr.is-fit { background: var(--amber-soft); }
.fx-table tr.is-estimate { background: var(--blue-soft); }

.fx-legend { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); margin-bottom: var(--s2); font-size: var(--text-xs); color: var(--muted); }
.fx-legend li { display: inline-flex; align-items: center; gap: 6px; }
.fx-legend li b { color: var(--text); font-variant-numeric: tabular-nums; }
.fx-legend span { display: inline-block; width: 18px; height: 3px; border-radius: 2px; background: currentColor; }
.fx-legend .ln-band span { height: 10px; background: var(--amber-soft); border: 1px solid var(--amber); }

.fx-chart { display: block; width: 100%; height: auto; }
.fx-chart .grid { stroke: var(--border); stroke-width: 1; }
.fx-chart .zero { stroke: var(--border-strong); stroke-width: 1.5; }
.fx-chart .band { fill: var(--amber-soft); stroke: var(--amber); stroke-dasharray: 4 3; stroke-width: 1; }
.fx-chart .tick { fill: var(--faint); font: 500 11px var(--font-body); }
.fx-chart .ln { fill: none; stroke-width: 2; stroke-linejoin: round; }
.fx-chart path.ln-p12 { stroke: var(--accent); }
.fx-chart path.ln-dep { stroke: var(--blue); stroke-width: 1.5; opacity: 0.85; }
.fx-chart path.ln-e2 { stroke: var(--blue); }
.fx-chart path.ln-e3 { stroke: var(--blue); stroke-dasharray: 5 3; }
.fx-chart circle.ln-p12 { fill: var(--accent); }
.fx-chart circle.ln-dep { fill: var(--blue); }
.fx-chart circle.ln-e2, .fx-chart circle.ln-e3 { fill: var(--blue); }
.fx-legend .ln-p12 span { background: var(--accent); }
.fx-legend .ln-dep span { background: var(--blue); }
.fx-legend .ln-e2 span { background: var(--blue); }
.fx-legend .ln-e3 span { background: repeating-linear-gradient(90deg, var(--blue) 0 5px, transparent 5px 8px); }

.fx-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s3); margin-bottom: var(--s3); }
.fx-form label { display: grid; gap: 4px; font-size: var(--text-xs); font-weight: 700; color: var(--muted); }
.fx-input { display: inline-flex; align-items: center; gap: 4px; color: var(--text); }
.fx-input input {
  width: 160px; min-height: 36px; padding: 0 var(--s2); border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--panel); color: var(--text); font: inherit; font-size: var(--text-sm); font-variant-numeric: tabular-nums;
}

/* Today tile */
.fx-home { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3) var(--s6); margin-top: var(--s4); padding: var(--s3) var(--s4); color: inherit; }
.fx-home:hover { border-color: var(--border-strong); }
.fx-home .fx-home-title { display: grid; gap: 2px; min-width: 180px; }
.fx-home .fx-home-title strong { font: 700 var(--text-sm)/1.3 var(--font-display); }
.fx-home .fx-home-title span { font-size: var(--text-2xs); color: var(--faint); }
.fx-home dl { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s6); }
.fx-home dl div { display: grid; gap: 2px; }
.fx-home dt { font-size: var(--text-2xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--faint); }
.fx-home dd { font: 700 var(--text-lg)/1.2 var(--font-display); font-variant-numeric: tabular-nums; }
.fx-home dd small { font-size: var(--text-xs); font-weight: 600; color: var(--muted); }

@media (max-width: 760px) {
  .fx-tiles, .fx-fii-hero { grid-template-columns: minmax(0, 1fr); }
}

/* One-year FII screen (usd-inr-screener-mock, 23-Oct-2026). */
.fxh-line { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s2); margin: 0 0 var(--s4); font-size: var(--text-xs); color: var(--muted); }
.fxh-line b { color: var(--text); font-weight: 600; }
.fxh-hero { display: grid; grid-template-columns: 1fr 1.05fr; overflow: hidden; margin-bottom: var(--s3); min-width: 0; }
.fxh-cost, .fxh-signal { padding: var(--s5); }
.fxh-cost { border-right: 1px solid var(--border); }
.fxh-title { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); }
.fxh-title h2 { font: 700 var(--text-base)/1.3 var(--font-display); }
.fxh-big { margin: var(--s3) 0 0; font: 800 var(--text-xl)/1.1 var(--font-display); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.fxh-big small { font-size: var(--text-sm); font-weight: 500; color: var(--muted); margin-left: var(--s2); }
.fxh-signal .fxh-big { color: var(--fxh, var(--amber)); }
.fxh-caption, .fxh-note, .fxh-read { font-size: var(--text-sm); color: var(--muted); margin-top: var(--s2); max-width: 62ch; }
.fxh-note { font-size: var(--text-xs); }
.fxh-formula { display: grid; grid-template-columns: 1fr 32px 1fr; align-items: center; gap: var(--s2); margin-top: var(--s4); }
.fxh-formula > div { padding: var(--s3); background: var(--panel-2); border-radius: var(--r-md); }
.fxh-formula strong { display: block; font-size: var(--text-lg); font-variant-numeric: tabular-nums; }
.fxh-formula span { display: block; font-size: var(--text-xs); color: var(--muted); }
.fxh-plus { text-align: center; color: var(--muted); }
.fxh-stack { display: flex; gap: 2px; height: 8px; margin-top: var(--s3); border-radius: 999px; overflow: hidden; }
.fxh-stack span:first-child { background: var(--accent); }
.fxh-stack span:last-child { background: color-mix(in oklch, var(--accent) 45%, var(--panel)); }
.fxh-gauge { position: relative; margin-top: var(--s5); padding-top: var(--s6); }
.fxh-gbar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; height: 12px; }
.fxh-gbar span { border-radius: 3px; }
.fxh-gbar span:nth-child(1) { background: var(--red); }
.fxh-gbar span:nth-child(2) { background: #bd8232; }
.fxh-gbar span:nth-child(3) { background: #96a66a; }
.fxh-gbar span:nth-child(4) { background: var(--accent); }
.fxh-cursor { position: absolute; top: 0; left: 45%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; transition: left 0.4s cubic-bezier(.16, 1, .3, 1); }
.fxh-cursor b { font-size: var(--text-xs); padding: 2px 6px; background: var(--text); color: var(--panel); border-radius: var(--r-sm); white-space: nowrap; }
.fxh-cursor::after { content: ""; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 6px solid var(--text); }
.fxh-glabels { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: var(--s2); font-size: var(--text-xs); color: var(--muted); }
.fxh-glabels span:last-child { text-align: right; }
.fxh-hero.is-neg { --fxh: var(--red); }
.fxh-hero.is-weak { --fxh: var(--amber); }
.fxh-hero.is-sel, .fxh-hero.is-strong { --fxh: var(--accent); }
.fxh-hero.is-neg #signal-badge { background: var(--red-soft); color: var(--red); }
.fxh-hero.is-weak #signal-badge { background: var(--amber-soft); color: var(--amber); }
.fxh-hero.is-sel #signal-badge, .fxh-hero.is-strong #signal-badge { background: var(--accent-soft); color: var(--accent-text); }
.fxh-context { margin: var(--s3) 0 var(--s4); padding: var(--s3) var(--s4); background: var(--amber-soft); color: var(--amber); border-radius: var(--r-md); font-size: var(--text-sm); }
.fxh-scenario { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3) var(--s4); padding: var(--s3) var(--s4); margin-bottom: var(--s4); }
.fxh-scenario-main, .fxh-scenario-side, .fxh-assumptions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); }
.fxh-scenario label { font-size: var(--text-sm); font-weight: 700; }
.fxh-field { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--panel-2); padding-right: var(--s2); }
.fxh-field input, .fxh-assumptions input { width: 84px; min-height: 44px; border: 0; background: none; color: var(--text); font: inherit; font-variant-numeric: tabular-nums; padding: 0 var(--s2); }
.fxh-assumptions input { border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--panel); }
.fxh-scenario input[type=range] { accent-color: var(--accent); width: 130px; min-height: 44px; }
.fxh-assumptions { flex-basis: 100%; border-top: 1px solid var(--border); padding-top: var(--s3); }
.fxh-assumptions[hidden] { display: none; }
.fxh-error { display: none; flex-basis: 100%; color: var(--red); font-size: var(--text-xs); }
.fxh-scenario.is-invalid .fxh-error { display: block; }
.fxh-scenario.is-invalid .fxh-field { border-color: var(--red); }
.fxh-readouts { display: grid; grid-template-columns: 1fr 1fr 1.35fr; gap: var(--s4); margin: 0 0 var(--s6); }
.fxh-readouts article { padding-right: var(--s4); border-right: 1px solid var(--border); }
.fxh-readouts article:last-child { border: 0; }
.fxh-readouts span { display: block; font-size: var(--text-xs); color: var(--muted); }
.fxh-readouts b { display: block; margin: var(--s1) 0; font-size: var(--text-lg); font-variant-numeric: tabular-nums; }
.fxh-green { color: var(--accent-text); }
.fxh-charts { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(220px, 1fr); gap: var(--s4); margin-bottom: var(--s6); min-width: 0; }
.fxh-chart, .fxh-context-card { padding: var(--s4); }
.fxh-legend { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); margin: var(--s3) 0; }
.fxh-legend button { display: inline-flex; align-items: center; gap: var(--s2); min-height: 44px; font-size: var(--text-xs); color: var(--muted); background: none; border: 0; cursor: pointer; }
.fxh-legend button[aria-pressed="false"] { opacity: 0.4; }
.fxh-legend .swatch { width: 20px; height: 3px; background: var(--accent); }
.fxh-legend .swatch.ln-dep { background: var(--blue); }
.fxh-percentile { position: relative; height: 8px; margin: var(--s3) 0 var(--s2); border-radius: 999px; background: var(--panel-3); }
.fxh-percentile i { position: absolute; top: -4px; width: 3px; height: 16px; background: var(--amber); }
.fxh-percentile-ends, .fxh-context-values { display: flex; justify-content: space-between; font-size: var(--text-xs); color: var(--muted); }
.fxh-context-values { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); margin-top: var(--s3); padding-top: var(--s3); border-top: 1px solid var(--border); }
.fxh-context-values dd { font: 700 var(--text-base)/1.2 var(--font-display); color: var(--text); font-variant-numeric: tabular-nums; }
.fxh-history { margin-bottom: var(--s6); }
.fxh-section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s3); margin-bottom: var(--s3); }
.fxh-then { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: var(--s4); min-width: 0; }
.fxh-table-note, .fx-table thead small { display: block; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--faint); }
.fx-table tr.is-sum { background: var(--panel-2); }
.fx-table tr.is-sum th, .fx-table tr.is-sum td, .fx-table tr.fxh-hi th, .fx-table tr.fxh-hi td { font-weight: 700; }
.fx-table tr.fxh-hi { background: color-mix(in oklch, var(--accent) 8%, var(--panel)); }
.fxh-diff { padding: var(--s4); display: flex; flex-direction: column; gap: var(--s3); }
.fxh-diff h3 { font: 700 var(--text-sm)/1.3 var(--font-display); }
.fxh-bars { display: grid; gap: var(--s3); }
.fxh-bars > div { display: grid; grid-template-columns: 48px minmax(0, 1fr) 72px; align-items: center; gap: var(--s2); font-size: var(--text-sm); }
.fxh-bars i { display: block; height: 10px; background: var(--panel-3); border-radius: 999px; overflow: hidden; }
.fxh-bars b { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.fxh-bars .is-now b { background: var(--amber); }
.fxh-bars > div > b { text-align: right; font-variant-numeric: tabular-nums; height: auto; background: none; }
.fxh-delta { font-size: var(--text-sm); color: var(--muted); padding-top: var(--s3); border-top: 1px solid var(--border); }
.fxh-delta b { display: block; font-size: var(--text-lg); color: var(--text); font-variant-numeric: tabular-nums; }
.fxh-target { padding: var(--s3); background: var(--panel-2); border-radius: var(--r-md); font-size: var(--text-sm); }
.fxh-target strong { color: var(--accent-text); }
.fxh-callout { margin: 0; padding: var(--s3) var(--s4); border-top: 1px solid var(--border); background: var(--panel-2); font-size: var(--text-sm); color: var(--muted); }
.fxh-acc { margin-bottom: var(--s3); overflow: hidden; }
.fxh-acc summary { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); min-height: 64px; padding: var(--s3) var(--s4); font-weight: 700; font-size: var(--text-sm); cursor: pointer; }
.fxh-acc summary span { font-size: var(--text-xs); font-weight: 500; color: var(--muted); text-align: right; }
.fxh-acc-body { border-top: 1px solid var(--border); padding: var(--s4); font-size: var(--text-sm); }
.fxh-acc-body p + p, .fxh-acc-body ul { margin-top: var(--s3); }
.fxh-acc-body li { margin-bottom: var(--s2); }
.fxh-toast { position: fixed; right: var(--s4); bottom: var(--s4); padding: var(--s2) var(--s3); border-radius: var(--r-md); background: var(--text); color: var(--panel); font-size: var(--text-sm); opacity: 0; pointer-events: none; }
.fxh-toast.is-on { opacity: 1; }
@media (max-width: 850px) {
  .fxh-hero, .fxh-charts, .fxh-then { grid-template-columns: 1fr; }
  .fxh-cost { border-right: 0; border-bottom: 1px solid var(--border); }
  .fxh-readouts { grid-template-columns: 1fr 1fr; }
  .fxh-readouts article:nth-child(2) { border: 0; }
  .fxh-readouts article:last-child { grid-column: 1 / -1; border: 0; padding: var(--s3); background: var(--panel-2); border-radius: var(--r-md); }
  .fxh-scenario input[type=range] { width: 90px; }
}
@media (max-width: 420px) {
  .fxh-formula { grid-template-columns: 1fr; }
  .fxh-plus { display: none; }
  .fxh-readouts { grid-template-columns: 1fr; }
  .fxh-readouts article { border: 0; padding: 0; }
}
