/* Options Lab node — styles. Loaded globally by Dash from /assets, so every rule is scoped under .opl-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 Rates & Bond Lab (rbl_style.css).
   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, profit #3fbf7f, loss #e66767. */

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

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

/* ---------- main grid: rail + center -------------------------------------------------- */
.opl-main { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 14px; align-items: start; }
.opl-rail { display: flex; flex-direction: column; min-width: 0; }
.opl-rail .pk-card { padding: 9px 11px; margin-bottom: 8px; }
.opl-field { margin-bottom: 9px; min-width: 0; }
.opl-k { color: #9fb3c8; font-size: .64rem; text-transform: uppercase; letter-spacing: .6px; margin-bottom: 3px; }
.opl-q { margin-left: 5px; color: #6f8295; cursor: help; font-size: .7rem; }
.opl-q:hover { color: #f0a030; }
.opl-app .Select-control { height: 30px; }
.opl-app .Select--single > .Select-control .Select-value, .opl-app .Select-placeholder { line-height: 28px !important; }
.opl-app .Select-value-label { color: #e8e8e8 !important; }
.opl-app .Select-menu-outer { z-index: 40; }
.opl-app .VirtualizedSelectOption { font-size: .8rem; }
.opl-app .VirtualizedSelectDisabledOption { color: #f0a030 !important; font-size: .68rem; text-transform: uppercase;
                                            letter-spacing: .5px; opacity: .85; }
.opl-slider { padding: 2px 0 0 !important; }
.opl-field:has(.rc-slider) { margin-bottom: 22px; }
.opl-app .rc-slider-track { background-color: #f0a030; }
.opl-app .rc-slider-handle { border-color: #f0a030; background: #1d242b; }
.opl-app .rc-slider-rail { background-color: rgba(255,255,255,0.12); }
.opl-app .rc-slider-mark-text { color: #7f93a6; font-size: .62rem; }
.opl-app input.opl-num { width: 100%; height: 30px; background: rgba(255,255,255,0.06); color: #e8e8e8;
                         border: 1px solid rgba(255,255,255,0.12); border-radius: 10px; padding: 2px 8px; }
.opl-app input.opl-num::placeholder { color: #7f93a6; }
.opl-app input.opl-num:focus { outline: none; border-color: rgba(240,160,48,0.7); }

.opl-mkt > div { display: flex; justify-content: space-between; gap: 8px; font-size: .76rem; padding: 2px 0;
                 border-bottom: 1px solid rgba(255,255,255,0.04); }
.opl-mkt > div > span { color: #9fb3c8; }
.opl-mkt > div > b { color: #e8e8e8; font-weight: 600; font-variant-numeric: tabular-nums; }
.opl-mkt > div.opl-ok, .opl-mkt > div.opl-info { display: block; border: 0; margin-top: 6px; font-size: .72rem; line-height: 1.4; }
.opl-ok { color: #bfe8c4; } .opl-ok i { color: #3fbf7f; }
.opl-info { color: #f5d6a3; } .opl-info i { color: #f0a030; }

/* ---------- legs editor ------------------------------------------------------------------ */
.opl-center { min-width: 0; }
.opl-legs { padding: 10px 12px; }
.opl-leg { display: grid; grid-template-columns: 70px 104px 150px 96px 74px 84px minmax(110px, 1fr) 30px;
           gap: 6px; align-items: center; padding: 3px 0; }
.opl-leg-h { color: #9fb3c8; font-size: .62rem; text-transform: uppercase; letter-spacing: .5px; padding-bottom: 2px;
             border-bottom: 1px solid rgba(255,255,255,0.08); margin-bottom: 3px; }
.opl-leg-h > div[title] { cursor: help; text-decoration: underline dotted rgba(159,179,200,0.5); }
.opl-qty input, .opl-app input.opl-qty { font-weight: 700; text-align: center; }
.opl-used { font-size: .74rem; color: #9fb3c8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opl-used b { color: #e8e8e8; font-variant-numeric: tabular-nums; }
.opl-src-mid b, .opl-src-natural b { color: #cfefff; }
.opl-src-model b { color: #f5d6a3; }
.opl-src-user b { color: #f0a030; }
.opl-del { width: 28px; height: 28px; border-radius: 10px; border: 1px solid rgba(230,103,103,0.35);
           background: rgba(230,103,103,0.08); color: #e66767; cursor: pointer; padding: 0; }
.opl-del:hover { background: rgba(230,103,103,0.25); }
.opl-legs-foot { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.opl-add { border-radius: 10px; border: 1px solid rgba(240,160,48,0.55); background: rgba(240,160,48,0.10);
           color: #f0a030; font-weight: 600; font-size: .78rem; padding: 4px 12px; cursor: pointer; }
.opl-add:hover { background: rgba(240,160,48,0.22); }

/* ---------- headline + kpis -------------------------------------------------------------- */
.opl-summary { 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: 10px 14px; font-size: .9rem; color: #e8f4ff; line-height: 1.55; margin: 2px 0 10px; }
.opl-summary b { color: #f0a030; }
.opl-app .opl-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; margin: 0 0 12px; }
.opl-kpis .pk-kpi { min-width: 0; background: rgba(0,0,0,0.6); border: 1px solid rgba(255,255,255,0.07); }
.opl-kpis .pk-kpi .pk-kv { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opl-kpis .pk-kpi.opl-hero { border-color: rgba(240,160,48,0.55); background: rgba(240,160,48,0.08); }
.opl-kpis .pk-kpi.opl-hero .pk-kv { font-size: 1.4rem; }
.opl-kpis .pk-kpi.opl-wide { grid-column: span 2; }
.opl-kpis .pk-kpi.opl-wide .pk-kv { font-size: 1.05rem; }
.opl-kpis .pk-kpi[title] { cursor: help; }
.opl-kpi-s { color: #7f93a6; font-size: .64rem; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* screen tabs (as Rates & Bond Lab / Seasonality) */
.opl-tabs { display: flex; flex-wrap: wrap; gap: 4px 22px; margin: 0 0 10px; border-bottom: 1px solid rgba(255,255,255,0.07); }
.opl-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: 3px solid transparent;
                  transition: color .15s, border-color .15s; }
.opl-tabs label:hover { color: #cfefff; }
.opl-tabs label:has(input:checked) { color: #cfefff; border-bottom-color: #f0a030; }
.opl-tabs input { display: none; }
.opl-wait { color: #9fb3c8; padding: 40px 10px; text-align: center; }

/* ---------- cards, grids ------------------------------------------------------------------- */
.opl-card-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.opl-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; margin-bottom: 12px; }
.opl-grid2 > .pk-card { margin-bottom: 0; }
.opl-graph { width: 100%; }
.opl-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; }
.opl-say i { color: #f0a030; margin-top: 3px; }
.opl-note { color: #7f93a6; font-size: .7rem; line-height: 1.45; margin-top: 6px; }
.opl-note.warn { color: #f5d6a3; background: rgba(240,160,48,0.06); border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; }
.opl-ctrls { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: flex-end; margin-bottom: 8px; }
.opl-dd-s { flex: 0 0 240px; min-width: 200px; max-width: 280px; }

/* tables */
.opl-scroll { overflow-x: auto; }
.opl-table { width: 100%; border-collapse: collapse; font-size: .76rem; }
.opl-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; }
.opl-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; }
.opl-table th:first-child, .opl-table td:first-child, .opl-table td.opl-left { text-align: left; }
.opl-table td.opl-left { white-space: normal; color: #9fb3c8; font-size: .7rem; min-width: 200px; }
.opl-table tbody tr:hover td { background: rgba(255,255,255,0.03); }
.opl-table.opl-narrow { max-width: 360px; }
.opl-chain th, .opl-chain td { text-align: right !important; }
.opl-chain .opl-mid { text-align: center !important; color: #cfefff; font-weight: 700; background: rgba(255,255,255,0.04); }
.opl-chain .opl-th-grp th { text-align: center !important; color: #cfefff; font-size: .7rem; border-bottom: 0; }
.opl-chain tr.opl-atm td { border-top: 1px solid rgba(240,160,48,0.6); border-bottom: 1px solid rgba(240,160,48,0.6); }
.opl-chain td.opl-hit { background: rgba(240,160,48,0.18); color: #ffd79a; font-weight: 600; }

/* formulas box */
.opl-formulas { margin: 4px 0 12px; background: rgba(0,0,0,0.6); border: 1px solid rgba(255,255,255,0.07); border-radius: 10px; }
.opl-formulas summary { cursor: pointer; padding: 8px 12px; color: #cfefff; font-weight: 600; font-size: .82rem; }
.opl-formulas summary i { color: #f0a030; }
.opl-fbox { padding: 2px 12px 10px; }
.opl-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); }
.opl-fk { color: #9fb3c8; font-size: .74rem; }
.opl-fv { color: #e8e8e8; font-size: .76rem; line-height: 1.5; font-family: "Cambria Math", Georgia, serif; }

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

/* ---------- narrow screens ---------------------------------------------------------------- */
@media (max-width: 1250px) { .opl-grid2 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 1050px) {
  .opl-main { grid-template-columns: minmax(0, 1fr); }
  .opl-top { padding-right: 120px; }
  .opl-legs { overflow-x: auto; }
  .opl-leg { min-width: 760px; }
}
@media (max-width: 640px) {
  .opl-top { padding-right: 0; padding-top: 34px; }
  .opl-brand > div { display: none; }
  .opl-tabs { gap: 4px 14px; }
  .opl-tabs label { font-size: .88rem; }
  .opl-kpis .pk-kpi { flex: 1 1 45%; }
  .opl-frow { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .opl-dd-s { flex: 1 1 100%; max-width: none; }
}
