/* Factor X-Ray node - styles. Loaded globally by Dash from /assets, so every rule is scoped under .fxr-app.
   The page kit of the main app (assets/app_pages/pages_style.css: .pk-scope, .pk-card, .pk-kpis, .pk-pills,
   .pk-chip) does most of the work; these rules lay out the node like Seasonality / the Systematic Investment Plan.
   Tokens: panels rgba(0,0,0,0.6), chips rgba(255,255,255,0.06), radius 10px, text #e8e8e8, muted #9fb3c8,
   headings #cfefff, accent #f0a030. */

.fxr-app { color: #e8e8e8; font-size: 13px; }
.fxr-app * { box-sizing: border-box; }

/* ---------- header (leave ~200px on the right for the app toolbar) ------------------ */
.fxr-top { display: flex; align-items: flex-end; gap: 18px; padding: 0 200px 10px 0; }
.fxr-brand h3 { margin: 0; font-size: 1.3rem; color: #cfefff; font-weight: 600; letter-spacing: .2px; }
.fxr-brand h3 span { color: #9fb3c8; font-weight: 400; font-size: .95rem; }
.fxr-brand > div { color: #9fb3c8; font-size: .78rem; max-width: 980px; line-height: 1.45; }

/* ---------- main grid: rail + screens ------------------------------------------------- */
.fxr-main { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 14px; align-items: start; }
.fxr-rail { display: flex; flex-direction: column; min-width: 0; }
.fxr-rail .pk-card { padding: 9px 11px; margin-bottom: 8px; }
.fxr-field { margin-bottom: 8px; min-width: 0; }
.fxr-k { color: #9fb3c8; font-size: .64rem; text-transform: uppercase; letter-spacing: .6px; margin-bottom: 3px; }
.fxr-app .Select-control { height: 30px; }
.fxr-app .Select--single > .Select-control .Select-value, .fxr-app .Select-placeholder { line-height: 28px !important; }
.fxr-app .Select-value-label { color: #e8e8e8 !important; }
.fxr-uni .uni { margin: 0; }
.fxr-status { margin-top: 6px; font-size: .74rem; }
.fxr-ok { color: #bfe8c4; }
.fxr-ok i { color: #3fbf7f; }
.fxr-err { color: #ffd0cb; }
.fxr-err i { color: #e66767; }

/* screen tabs (the same look as the Seasonality / SIP title tabs) */
.fxr-tabs { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 0 0 10px; border-bottom: 1px solid rgba(255,255,255,0.07); }
.fxr-tabs label { display: inline-flex !important; margin: 0 !important; cursor: pointer; padding: 2px 0 7px;
                  color: #7f93a8; font-size: 1rem; font-weight: 600; border-bottom: 2px solid transparent;
                  transition: color .15s, border-color .15s; }
.fxr-tabs label:hover { color: #cfefff; }
.fxr-tabs label:has(input:checked) { color: #cfefff; border-bottom-color: #f0a030; }
.fxr-tabs input { display: none; }
.fxr-center { min-width: 0; }
.fxr-wait { color: #9fb3c8; padding: 40px 10px; text-align: center; }

/* ---------- cards, grids, kpis ---------------------------------------------------------- */
.fxr-card { border-radius: 10px; }
.fxr-card-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.fxr-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; margin-bottom: 12px; }
.fxr-grid2 > .pk-card { margin-bottom: 0; }
.fxr-graph { width: 100%; }
.fxr-kpis { margin: 0 0 10px; }
.fxr-kpis .pk-kpi { flex: 1 1 130px; background: rgba(0,0,0,0.6); border: 1px solid rgba(255,255,255,0.07); border-radius: 10px; }
.fxr-kpis .pk-kpi.fxr-hero { flex: 1.3 1 170px; border-color: rgba(240,160,48,0.45); background: rgba(240,160,48,0.07); }
.fxr-kpis .pk-kpi.fxr-hero .pk-kv { font-size: 1.45rem; }
.fxr-kpi-s { color: #7f93a6; font-size: .64rem; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* the plain-language summary */
.fxr-sum-card { border-left: 3px solid #f0a030; }
.fxr-summary { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.fxr-sum-row { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 10px; align-items: baseline;
               padding: 5px 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
.fxr-sum-row:last-child { border-bottom: none; }
.fxr-sum-t { color: #cfefff; font-weight: 600; font-size: .74rem; text-transform: uppercase; letter-spacing: .5px; }
.fxr-sum-x { color: #e8f4ff; font-size: .86rem; line-height: 1.55; }
.fxr-say { display: flex; gap: 8px; align-items: flex-start; margin-top: 6px; padding: 7px 10px; border-radius: 10px;
           background: rgba(255,255,255,0.04); color: #dfe7ee; font-size: .78rem; line-height: 1.5; }
.fxr-say i { color: #f0a030; margin-top: 3px; }
.fxr-note { color: #7f93a6; font-size: .7rem; line-height: 1.45; margin-top: 6px; }
.fxr-note.warn { color: #f5d6a3; }
.fxr-notes { margin: 0; padding-left: 18px; color: #c9d5e0; font-size: .78rem; line-height: 1.6; }

/* tables */
.fxr-scroll { overflow-x: auto; }
.fxr-table { width: 100%; border-collapse: collapse; font-size: .76rem; }
.fxr-table th { color: #9fb3c8; font-weight: 500; font-size: .64rem; text-transform: uppercase; letter-spacing: .4px;
                text-align: right; padding: 4px 6px; border-bottom: 1px solid rgba(255,255,255,0.1); vertical-align: bottom;
                white-space: nowrap; }
.fxr-table td { padding: 4px 6px; border-bottom: 1px solid rgba(255,255,255,0.05); text-align: right;
                font-variant-numeric: tabular-nums; color: #e8e8e8; white-space: nowrap; }
.fxr-table th:first-child, .fxr-table td:first-child { text-align: left; }
.fxr-table tbody tr:hover td { background: rgba(255,255,255,0.03); }
.fxr-table.fxr-wrap td { white-space: normal; }
.fxr-table.fxr-names th:nth-child(2), .fxr-table.fxr-names td:nth-child(2) { text-align: left; color: #9fb3c8; }
.fxr-table.fxr-wrap td:nth-child(4) { text-align: left; color: #9fb3c8; font-size: .7rem; min-width: 160px; }

.fxr-foot { color: #6f8295; font-size: .68rem; line-height: 1.45; margin-top: 12px; padding-top: 8px;
            border-top: 1px solid rgba(255,255,255,0.06); }
.fxr-foot i { color: #9fb3c8; }

/* ---------- narrow screens ---------------------------------------------------------------- */
@media (max-width: 1250px) { .fxr-grid2 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 1000px) {
  .fxr-main { grid-template-columns: minmax(0, 1fr); }
  .fxr-top { padding-right: 120px; }
}
@media (max-width: 640px) {
  .fxr-top { padding-right: 0; padding-top: 34px; }
  .fxr-brand > div { display: none; }
  .fxr-tabs { gap: 4px 14px; }
  .fxr-tabs label { font-size: .88rem; }
  .fxr-kpis .pk-kpi { flex: 1 1 45%; }
  .fxr-sum-row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}
