/* Trading Range and Volatility node (EX-12) — styles. Loaded globally by Dash from /assets, so every rule is scoped
   under .trv-app. The page kit of the main app (assets/app_pages/pages_style.css: .pk-scope, .pk-card, .pk-pills)
   does most of the work; these rules lay out the node like Unconditional Statistics (rail + screens + tiles).
   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. */

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

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

/* ---------- main grid: rail + screens ------------------------------------------------- */
.trv-main { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 14px; align-items: start; }
.trv-rail { display: flex; flex-direction: column; min-width: 0; position: sticky; top: 0; }
.trv-rail .pk-card { padding: 9px 11px; margin-bottom: 8px; }
.trv-rail .pk-card-sub { font-size: .68rem; }
.trv-k { color: #9fb3c8; font-size: .62rem; text-transform: uppercase; letter-spacing: .6px; margin-bottom: 3px; }
.trv-status { margin-top: 6px; font-size: .74rem; }
.trv-ok { color: #bfe8c4; }
.trv-ok i { color: #3fbf7f; }
.trv-err { color: #ffd0cb; }
.trv-err i { color: #e66767; }
.trv-railnote { color: #7f93a6; font-size: .7rem; line-height: 1.45; padding: 2px 4px; }
.trv-railnote i { color: #f0a030; }
.trv-center { min-width: 0; }
.trv-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.trv-col > .pk-card { margin-bottom: 0; }

/* ticker box */
.trv-tickrow { display: flex; gap: 6px; margin: 4px 0 7px; }
.trv-input { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.14); border-radius: 10px;
             color: #e8e8e8; padding: 6px 10px; font-size: .9rem; min-width: 0; outline: none; }
.trv-input:focus { border-color: #f0a030; box-shadow: 0 0 0 2px rgba(240,160,48,0.25); }
.trv-tick { flex: 1; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; font-size: 1.05rem; }
.trv-go { background: #f0a030; color: #10151b; border: none; border-radius: 10px; width: 40px; cursor: pointer;
          font-size: 1rem; transition: transform .12s, filter .12s; }
.trv-go:hover { transform: translateY(-1px); filter: brightness(1.1); }
.trv-app .trv-quick label { font-size: .72rem !important; padding: 2px 8px !important; }
.trv-app .trv-gauges label { font-size: .72rem !important; }

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

/* ---------- headline + tiles ------------------------------------------------------------- */
.trv-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: .92rem; color: #e8f4ff; line-height: 1.6; }
.trv-headline > i { color: #f0a030; }
.trv-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 9px; }
.trv-tile { background: rgba(0,0,0,0.6); border: 1px solid rgba(255,255,255,0.08); border-radius: 10px;
            padding: 10px 12px 9px; transition: transform .15s, border-color .15s; min-width: 0; cursor: default; }
.trv-tile:hover { transform: translateY(-2px); border-color: rgba(240,160,48,0.55); }
.trv-tl { color: #9fb3c8; font-size: .64rem; text-transform: uppercase; letter-spacing: .5px;
          white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trv-tv { color: #cfefff; font-size: 1.45rem; font-weight: 700; margin: 2px 0 2px; font-variant-numeric: tabular-nums;
          white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trv-ts { color: #7f93a6; font-size: .66rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trv-hero-tiles { grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); }

/* ---------- cards, grids ------------------------------------------------------------------- */
.trv-card-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.trv-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.trv-grid2 > .pk-card { margin-bottom: 0; }
.trv-graph { width: 100%; }
.trv-say { display: flex; gap: 8px; align-items: flex-start; margin-top: 6px; padding: 8px 11px; border-radius: 10px;
           background: rgba(255,255,255,0.04); color: #dfe7ee; font-size: .79rem; line-height: 1.5; }
.trv-say i { color: #f0a030; margin-top: 3px; }
.trv-note { color: #7f93a6; font-size: .7rem; line-height: 1.45; margin-top: 6px; }
.trv-note.warn { color: #f5d6a3; }
.trv-ctlrow { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: flex-end; margin: 4px 0 8px; }
.trv-ctl { display: flex; flex-direction: column; gap: 3px; }
.trv-ctl .trv-input { width: 140px; }
.trv-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 7px; vertical-align: -1px; }

/* tables */
.trv-scroll { overflow-x: auto; }
.trv-table { width: 100%; border-collapse: collapse; font-size: .77rem; }
.trv-table th { color: #9fb3c8; font-weight: 500; font-size: .63rem; text-transform: uppercase; letter-spacing: .4px;
                text-align: right; padding: 5px 7px; border-bottom: 1px solid rgba(255,255,255,0.1); white-space: nowrap;
                vertical-align: bottom; }
.trv-table td { padding: 5px 7px; border-bottom: 1px solid rgba(255,255,255,0.05); text-align: right;
                font-variant-numeric: tabular-nums; color: #e8e8e8; white-space: nowrap; }
.trv-table th:first-child, .trv-table td:first-child { text-align: left; }
.trv-table tbody tr:hover td { background: rgba(255,255,255,0.03); }
.trv-table td.trv-neg { color: #f19a9a; }
.trv-table td.trv-strong { font-weight: 700; color: #cfefff; }
.trv-table td.trv-muted { color: #7f93a6; }
.trv-table td.trv-open { color: #f0a030; font-weight: 600; }
.trv-table.trv-compact td, .trv-table.trv-compact th { padding: 3px 6px; }

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

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

/* ---------- narrow screens ---------------------------------------------------------------- */
@media (max-width: 1250px) { .trv-grid2 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 1000px) {
  .trv-main { grid-template-columns: minmax(0, 1fr); }
  .trv-rail { position: static; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 8px; }
  .trv-top { padding-right: 120px; }
}
@media (max-width: 760px) { .trv-hero-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .trv-top { padding-right: 0; padding-top: 34px; }
  .trv-brand > div { display: none; }
  .trv-rail { grid-template-columns: minmax(0, 1fr); }
  .trv-tabs { gap: 4px 14px; }
  .trv-tabs label { font-size: .84rem; }
  .trv-tv { font-size: 1.15rem; }
  .trv-frow { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}
