/* S&P500 Fair Value node — styles. Loaded globally by Dash from /assets, so every rule is scoped under .sfv-app.
   The page kit of the main app (assets/app_pages/pages_style.css: .pk-scope, .pk-card, .pk-kpi, .pk-pills) does
   most of the work; these rules lay out the node like Commodities / Market Quality.
   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, good #3fbf7f, bad #e66767, blue #3987e5, teal #3fb6c9, purple #9085e9. */

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

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

/* ---------- control bar ------------------------------------------------------------------ */
.sfv-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 26px; margin: 4px 0 12px; }
.sfv-ctl { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sfv-ctls { display: flex; flex-wrap: wrap; gap: 8px 26px; margin-bottom: 10px; align-items: flex-end; }
.sfv-k { color: #9fb3c8; font-size: .62rem; text-transform: uppercase; letter-spacing: .6px; }
.sfv-asof { margin-left: auto; color: #7f93a6; font-size: .72rem; padding-bottom: 4px; }
.sfv-asof i { color: #f0a030; }
.sfv-app .sfv-dd { width: 210px; font-size: .85rem; }
.sfv-app .sfv-dd .Select-control { background: rgba(0,0,0,0.6); border: 1px solid rgba(240,160,48,0.55);
                                     border-radius: 10px; height: 32px; }
.sfv-app .sfv-dd .Select-value-label, .sfv-app .sfv-dd .Select-placeholder { color: #cfefff !important;
                                                                                 font-weight: 600; line-height: 30px; }
.sfv-app .sfv-dd .Select-menu-outer { background: #0d141c; border: 1px solid rgba(255,255,255,0.12);
                                        border-radius: 10px; z-index: 50; }
.sfv-app .sfv-dd .VirtualizedSelectOption { color: #dfe7ee; }
.sfv-app .sfv-dd .VirtualizedSelectFocusedOption { background: rgba(240,160,48,0.18); }
.sfv-input { width: 80px; height: 30px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.15);
              background: rgba(0,0,0,0.6); color: #cfefff; padding: 0 10px; font-weight: 600; }
.sfv-checks label { margin-right: 0 !important; }

/* ---------- hero: badge + tiles -------------------------------------------------------- */
.sfv-hero { display: grid; grid-template-columns: minmax(300px, 0.8fr) minmax(0, 2fr); gap: 14px; margin-bottom: 14px; }
.sfv-badge { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border-radius: 10px;
              background: linear-gradient(135deg, rgba(0,0,0,0.72), rgba(0,0,0,0.5)); border: 1.5px solid;
              animation: sfv-glow 3.2s ease-in-out infinite; }
@keyframes sfv-glow { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.14); } }
.sfv-badge-ic { flex: 0 0 54px; height: 54px; border-radius: 14px; display: flex; align-items: center;
                 justify-content: center; color: #0b1016; font-size: 1.55rem; box-shadow: 0 6px 18px rgba(0,0,0,0.45); }
.sfv-badge-k { color: #9fb3c8; font-size: .62rem; text-transform: uppercase; letter-spacing: .8px; }
.sfv-badge-v { font-size: 1.55rem; font-weight: 700; line-height: 1.15; color: #cfefff; }
.sfv-badge-s { margin-top: 4px; }
.sfv-badge-l { color: #dfe7ee; font-size: .8rem; line-height: 1.45; margin-top: 6px; }
.sfv-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; align-content: start; }
.sfv-tiles .pk-kpi, .sfv-kpis .pk-kpi { min-width: 0; background: rgba(0,0,0,0.6); border: 1px solid rgba(255,255,255,0.08);
                                          border-radius: 10px; transition: transform .15s, border-color .15s; }
.sfv-tiles .pk-kpi:hover { transform: translateY(-2px); border-color: rgba(240,160,48,0.55); }
.sfv-tiles .pk-kv { font-size: 1.35rem; white-space: nowrap; }
.sfv-app .sfv-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 0 0 10px; }
.sfv-kpis .pk-kv { font-size: 1.25rem; }

/* index bar */
.sfv-ibox { display: inline-flex; align-items: center; gap: 7px; min-width: 92px; }
.sfv-ibar { flex: 1 1 60px; min-width: 52px; height: 7px; border-radius: 6px; background: rgba(255,255,255,0.08); overflow: hidden; }
.sfv-ibar-in { height: 100%; border-radius: 6px; transition: width .6s ease; }
.sfv-ibox span { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 22px; text-align: right; }
.sfv-tiles .sfv-ibox span { font-size: 1.25rem; }

/* screen tabs */
.sfv-tabs { display: flex; flex-wrap: wrap; gap: 4px 24px; margin: 0 0 12px; border-bottom: 1px solid rgba(255,255,255,0.07); }
.sfv-tabs label { display: inline-flex !important; margin: 0 !important; cursor: pointer; padding: 2px 0 8px;
                   color: #7f93a8; font-size: 1rem; font-weight: 600; border-bottom: 3px solid transparent;
                   transition: color .15s, border-color .15s; }
.sfv-tabs label:hover { color: #cfefff; }
.sfv-tabs label:has(input:checked) { color: #cfefff; border-bottom-color: #f0a030; }
.sfv-tabs input { display: none; }
.sfv-wait { color: #9fb3c8; padding: 40px 10px; text-align: center; }
.sfv-wait i { color: #f0a030; }
.sfv-err { color: #f5b3a8; }

/* ---------- cards, grids ------------------------------------------------------------------- */
.sfv-card-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.sfv-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; margin-bottom: 12px; }
.sfv-grid2 > .pk-card { margin-bottom: 0; }
.sfv-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: start; margin-bottom: 12px; }
.sfv-grid3 > .pk-card { margin-bottom: 0; }
.sfv-graph { width: 100%; }
.sfv-say { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 12px; padding: 9px 12px; border-radius: 10px;
            background: rgba(255,255,255,0.05); color: #dfe7ee; font-size: .82rem; line-height: 1.5;
            border-left: 3px solid #f0a030; }
.sfv-say i { color: #f0a030; margin-top: 3px; }
.sfv-note { color: #7f93a6; font-size: .7rem; line-height: 1.45; margin-top: 6px; }
.sfv-muted { color: #7f93a6; }
.sfv-chip { display: inline-block; border: 1px solid; border-radius: 8px; padding: 0 9px; font-size: .68rem;
             font-weight: 700; text-transform: uppercase; letter-spacing: .5px; line-height: 1.75; white-space: nowrap; }
.sfv-trend { font-weight: 600; white-space: nowrap; }
.sfv-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; }

.sfv-headline { background: rgba(0,0,0,0.6); border: 1px solid rgba(255,255,255,0.07); border-left: 4px solid #f0a030;
                 border-radius: 10px; padding: 11px 14px; font-size: .9rem; color: #e8f4ff; line-height: 1.65;
                 margin-bottom: 12px; }
.sfv-headline b { color: #f0a030; }
.sfv-headline-s { color: #9fb3c8; font-size: .8rem; margin-top: 4px; }

/* tables */
.sfv-scroll { overflow-x: auto; }
.sfv-table { width: 100%; border-collapse: collapse; font-size: .78rem; }
.sfv-table th { color: #9fb3c8; font-weight: 500; font-size: .64rem; text-transform: uppercase; letter-spacing: .4px;
                 text-align: right; padding: 5px 8px; border-bottom: 1px solid rgba(255,255,255,0.1); white-space: nowrap; }
.sfv-table th.sfv-unit { text-transform: none; font-size: .62rem; color: #6f8295; padding-top: 0; }
.sfv-table td { padding: 6px 8px; border-bottom: 1px solid rgba(255,255,255,0.05); text-align: right;
                 font-variant-numeric: tabular-nums; color: #e8e8e8; white-space: nowrap; }
.sfv-table th:first-child, .sfv-table td.sfv-left { text-align: left; }
.sfv-table tbody tr:hover td { background: rgba(255,255,255,0.03); }
.sfv-table td.sfv-sec { text-align: left; font-size: .66rem; text-transform: uppercase; letter-spacing: .8px;
                          font-weight: 700; color: #9fb3c8; padding-top: 12px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sfv-table tr.sfv-hl td { background: rgba(240,160,48,0.09); }
.sfv-table tr.sfv-hl td:first-child { box-shadow: inset 3px 0 0 #f0a030; }
.sfv-click { cursor: pointer; }
.sfv-click:hover td { background: rgba(240,160,48,0.08) !important; }

/* verdict */
.sfv-verdict { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: 10px; margin-bottom: 12px;
                background: rgba(0,0,0,0.6); border: 1px solid rgba(255,255,255,0.07); border-left: 4px solid #3fb6c9;
                font-size: .9rem; color: #e8f4ff; line-height: 1.5; }
.sfv-verdict i { color: #3fb6c9; margin-top: 3px; }

/* formulas box */
.sfv-formulas { margin: 4px 0 12px; background: rgba(0,0,0,0.6); border: 1px solid rgba(255,255,255,0.07); border-radius: 10px; }
.sfv-formulas summary { cursor: pointer; padding: 8px 12px; color: #cfefff; font-weight: 600; font-size: .82rem; }
.sfv-formulas summary i { color: #f0a030; }
.sfv-fbox { padding: 2px 12px 10px; }
.sfv-frow { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 10px; padding: 5px 0;
             border-top: 1px solid rgba(255,255,255,0.05); }
.sfv-fk { color: #9fb3c8; font-size: .74rem; }
.sfv-fv { color: #e8e8e8; font-size: .76rem; line-height: 1.5; font-family: "Cambria Math", Georgia, serif; }

.sfv-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); }
.sfv-foot i { color: #9fb3c8; }

/* ---------- narrow screens ---------------------------------------------------------------- */
@media (max-width: 1350px) { .sfv-grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1250px) {
  .sfv-grid2 { grid-template-columns: minmax(0, 1fr); }
  .sfv-hero { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1050px) { .sfv-top { padding-right: 120px; } }
@media (max-width: 760px) {
  .sfv-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sfv-grid3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .sfv-top { padding-right: 0; padding-top: 34px; }
  .sfv-brand > div { display: none; }
  .sfv-tabs { gap: 4px 14px; }
  .sfv-tabs label { font-size: .86rem; }
  .sfv-asof { margin-left: 0; }
  .sfv-tiles .pk-kv, .sfv-tiles .sfv-ibox span { font-size: 1.1rem; }
  .sfv-badge-v { font-size: 1.25rem; }
  .sfv-frow { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .sfv-app .sfv-dd { width: 100%; min-width: 180px; }
}

/* ---------- S&P500 Fair Value: the valuation gauge, the model chips, the two windows ------------------------- */
.sfv-gauge { position: relative; height: 16px; border-radius: 9px; margin: 12px 0 4px;
             background: linear-gradient(90deg, #3fbf7f 0%, #7fbf6a 25%, #6f8295 45%, #6f8295 55%, #e0a040 75%, #e66767 100%);
             box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12); }
.sfv-gauge-mark { position: absolute; top: -7px; width: 4px; height: 30px; margin-left: -2px; border-radius: 3px;
                  background: #ffffff; box-shadow: 0 0 10px rgba(255,255,255,0.9), 0 0 2px #000;
                  transition: left .8s cubic-bezier(.2,.8,.2,1); }
.sfv-gauge-mark.sfv-alt { background: #9fb3c8; box-shadow: 0 0 6px rgba(159,179,200,0.8); height: 22px; top: -3px; width: 3px; }
.sfv-gauge-l { display: flex; justify-content: space-between; color: #9fb3c8; font-size: .64rem; text-transform: uppercase;
               letter-spacing: .6px; }
.sfv-big { font-size: 2.05rem; font-weight: 800; line-height: 1.05; letter-spacing: -.5px; }
.sfv-mchips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.sfv-mchip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 9px; font-size: .72rem;
             background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); white-space: nowrap; }
.sfv-mchip b { font-variant-numeric: tabular-nums; }
.sfv-zbar { display: inline-flex; align-items: center; gap: 7px; min-width: 120px; }
.sfv-zbar-t { position: relative; flex: 1 1 80px; height: 8px; border-radius: 6px; background: rgba(255,255,255,0.08); }
.sfv-zbar-m { position: absolute; top: -2px; width: 3px; height: 12px; margin-left: -1px; background: rgba(255,255,255,0.35); left: 50%; }
.sfv-zbar-f { position: absolute; top: 0; height: 8px; border-radius: 6px; }
.sfv-zbar span { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 40px; text-align: right; }
.sfv-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.sfv-win { padding: 10px 12px; border-radius: 10px; background: rgba(0,0,0,0.6); border: 1px solid rgba(255,255,255,0.08); }
.sfv-win.sfv-on { border-color: rgba(240,160,48,0.75); box-shadow: 0 0 0 1px rgba(240,160,48,0.35), 0 8px 22px rgba(240,160,48,0.12); }
.sfv-win-k { color: #9fb3c8; font-size: .62rem; text-transform: uppercase; letter-spacing: .6px; }
.sfv-win-v { font-size: 1.3rem; font-weight: 700; color: #cfefff; font-variant-numeric: tabular-nums; }
.sfv-win-s { font-size: .76rem; color: #dfe7ee; }
.sfv-verdict-robust { color: #3fbf7f; border-color: #3fbf7f; }
.sfv-verdict-weak { color: #e0b040; border-color: #e0b040; }
.sfv-verdict-none { color: #8a9bab; border-color: #8a9bab; }
.sfv-ctlgrp { display: contents; }
.sfv-limits li { margin-bottom: 6px; line-height: 1.5; color: #dfe7ee; font-size: .8rem; }
.sfv-limits b { color: #cfefff; }
@media (max-width: 760px) { .sfv-two { grid-template-columns: minmax(0, 1fr); } .sfv-big { font-size: 1.6rem; } }
