/* Reinforcement Learning node - styles. Loaded globally by Dash from /assets, so every rule is scoped under .rl-app.
   The page kit of the main app (assets/app_pages/pages_style.css: .pk-scope, .pk-card, .pk-kpis, .pk-pills, .pk-btn)
   does most of the work; these rules lay out the node, as in the Curve Forecast Lab.
   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; bad #e66767, good #3fbf7f. */

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

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

/* ---------- main grid: rail + screens ---------------------------------------------------------- */
.rl-main { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 14px; align-items: start; }
.rl-rail { display: flex; flex-direction: column; min-width: 0; }
.rl-rail .pk-card { padding: 9px 11px; margin-bottom: 8px; }
.rl-field { margin-bottom: 8px; min-width: 0; }
.rl-k { color: #9fb3c8; font-size: .64rem; text-transform: uppercase; letter-spacing: .6px; margin-bottom: 3px; }
.rl-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; }
.rl-chipbox { margin-bottom: 8px; }
.rl-app .Select-control { min-height: 30px; }
.rl-app .Select--single > .Select-control { height: 30px; }
.rl-app .Select--single > .Select-control .Select-value, .rl-app .Select-placeholder { line-height: 28px !important; }
.rl-app .Select-value-label { color: #e8e8e8 !important; }
.rl-app .Select--multi .Select-value { font-size: .7rem; margin-top: 3px; }
.rl-app .VirtualizedSelectOption { white-space: normal; line-height: 1.25; }
.rl-app .Select-menu-outer { z-index: 30; }
.rl-checks { display: flex; flex-direction: column; gap: 1px; }
.rl-checks label { user-select: none; display: flex !important; align-items: baseline; gap: 6px; margin: 0 !important;
                     font-size: .78rem; color: #dfe7ee; cursor: pointer; }
.rl-grp { color: #7f93a6; font-size: .62rem; text-transform: uppercase; letter-spacing: .6px; margin: 6px 0 2px; }
.rl-grp:first-child { margin-top: 0; }
.rl-actions { margin: 2px 0 6px; }
.rl-app .rl-run { font-weight: 600; padding: 6px 18px; }
.rl-status { font-size: .74rem; line-height: 1.45; }
.rl-ok { color: #bfe8c4; }
.rl-ok i { color: #3fbf7f; }
.rl-err { color: #ffd0cb; }
.rl-err i { color: #e66767; }

/* screen tabs (the same look as the other idea apps) */
.rl-tabs { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 0 0 8px; border-bottom: 1px solid rgba(255,255,255,0.07); }
.rl-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; }
.rl-tabs label:hover { color: #cfefff; }
.rl-tabs label:has(input:checked) { color: #cfefff; border-bottom-color: #f0a030; }
.rl-tabs input { display: none; }
.rl-center { min-width: 0; }
.rl-wait { color: #9fb3c8; padding: 40px 10px; text-align: center; }
.rl-wait.rl-err { color: #ffd0cb; }

/* the bar of what is shown */
.rl-bar { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: flex-end; margin: 0 0 10px; padding: 7px 10px;
            background: rgba(255,255,255,0.04); border-radius: 10px; }
.rl-bar > div { min-width: 0; }
.rl-bar .rl-dd { min-width: 210px; }
.rl-bar .rl-dd.wide { min-width: 380px; max-width: 760px; }

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

.rl-summary { background: rgba(0,0,0,0.6); border: 1px solid rgba(255,255,255,0.07); border-left: 3px solid #f0a030;
                border-radius: 10px; padding: 10px 14px; font-size: .86rem; color: #e8f4ff; line-height: 1.55; margin-bottom: 10px; }
.rl-summary > b { font-weight: 600; }
.rl-summary > div { margin-top: 3px; color: #dfe7ee; font-size: .82rem; }
.rl-say { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 10px; padding: 8px 11px; border-radius: 10px;
            background: rgba(255,255,255,0.04); color: #dfe7ee; font-size: .8rem; line-height: 1.5; }
.rl-say i { color: #f0a030; margin-top: 3px; }
.rl-say.warn { background: rgba(230,103,103,0.09); border: 1px solid rgba(230,103,103,0.3); color: #ffe1dd; }
.rl-say.warn i { color: #e66767; }
.rl-note { color: #7f93a6; font-size: .7rem; line-height: 1.45; margin-top: 6px; }
.rl-app ul.rl-list { margin: 4px 0 0; padding-left: 20px; color: #dfe7ee; font-size: .78rem; line-height: 1.55; }
.rl-list li { margin-bottom: 5px; }
.rl-list.dim li { color: #9fb3c8; font-size: .74rem; }
.rl-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: baseline; }
.rl-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.rl-chip { background: rgba(255,255,255,0.06); border-radius: 10px; padding: 3px 9px; font-size: .74rem; color: #dfe7ee; }
.rl-chip b { color: #cfefff; font-weight: 600; }

/* controls row above a screen */
.rl-ctrls { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: flex-end; margin: 2px 0 10px; }
.rl-ctrls > div { min-width: 0; }
.rl-app input.rl-in { height: 32px; width: 100%; background: rgba(255,255,255,0.06); color: #e8e8e8;
                          border: 1px solid rgba(255,255,255,0.15); border-radius: 10px; padding: 0 10px;
                          text-transform: uppercase; }

/* ---------- tables ------------------------------------------------------------------------------- */
.rl-scroll { overflow-x: auto; }
.rl-table { width: 100%; border-collapse: collapse; font-size: .76rem; }
.rl-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; }
.rl-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; }
.rl-table th:first-child, .rl-table td:first-child { text-align: left; white-space: normal; }
.rl-table tbody tr:hover td { background: rgba(255,255,255,0.03); }
.rl-table td.good { color: #8fe0b0; }
.rl-table td.mid { color: #ffd27a; }
.rl-table td.bad { color: #ff9d94; }
.rl-table td.dim, .rl-table tr.dim td { color: #7f93a6; }
.rl-score td.good, .rl-score td.mid, .rl-score td.bad { font-weight: 600; }
.rl-score td:first-child { min-width: 150px; white-space: nowrap; }
.rl-score td:first-child .rl-se { display: block; margin-left: 15px; }
.rl-score th { white-space: normal; min-width: 62px; }
.rl-score td.good { background: rgba(63,191,127,0.10); }
.rl-score td.mid { background: rgba(240,160,48,0.09); }
.rl-score td.bad { background: rgba(230,103,103,0.10); }
.rl-table.txt th, .rl-table.txt td, .rl-table td.txt { text-align: left; white-space: normal; line-height: 1.45; vertical-align: top; }
.rl-table.txt td:first-child { color: #cfefff; padding-right: 12px; white-space: nowrap; }
.rl-se { color: #7f93a6; font-size: .68rem; }

.rl-step { display: flex; gap: 10px; align-items: flex-start; margin-top: 8px; font-size: .78rem; line-height: 1.5; color: #dfe7ee; }
.rl-step b { color: #e8f4ff; }
.rl-step-n { flex: 0 0 22px; height: 22px; border-radius: 50%; border: 1px solid rgba(240,160,48,0.6); color: #f5d6a3;
               display: inline-flex; align-items: center; justify-content: center; font-size: .72rem; font-weight: 600; }

/* ---------- spot the real one -------------------------------------------------------------------- */
.rl-game { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.rl-game-cell { position: relative; border: 1px solid rgba(255,255,255,0.08); border-radius: 10px; padding: 4px;
                  background: rgba(0,0,0,0.35); transition: border-color .2s, box-shadow .2s; }
.rl-game-cell.real { border-color: #3fbf7f; box-shadow: 0 0 0 2px rgba(63,191,127,0.35), 0 0 18px rgba(63,191,127,0.25); }
.rl-game-cell.wrong { border-color: #e66767; box-shadow: 0 0 0 2px rgba(230,103,103,0.35); }
.rl-game-l { position: absolute; top: 6px; right: 10px; z-index: 2; color: #f5d6a3; font-weight: 700; font-size: .95rem; }
.rl-game-pick label { min-width: 46px; justify-content: center; font-weight: 700; }

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

/* ---------- narrow screens ----------------------------------------------------------------------- */
@media (max-width: 1320px) { .rl-grid2 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 1000px) {
  .rl-main { grid-template-columns: minmax(0, 1fr); }
  .rl-top { padding-right: 120px; }
  .rl-game { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .rl-top { padding-right: 0; padding-top: 34px; }
  .rl-brand > div { display: none; }
  .rl-tabs { gap: 4px 14px; }
  .rl-tabs label { font-size: .88rem; }
  .rl-bar .rl-dd, .rl-bar .rl-dd.wide { min-width: 0; width: 100%; }
  .rl-bar > div, .rl-ctrls > div { flex: 1 1 100% !important; }
  .rl-kpis .pk-kpi { flex: 1 1 45%; }
}

/* ---------- RL-specific ------------------------------------------------------------------------- */
.rl-problems { display: flex; flex-direction: column; gap: 6px; }
.rl-problems label { justify-content: flex-start; width: 100%; }
.rl-col { display: flex; flex-direction: column; gap: 5px; }
.rl-col label { justify-content: flex-start; width: 100%; }
.rl-bar .rl-dd { min-width: 320px; }
.rl-dot { border: 2px solid transparent; }
.rl-dot.hollow { background: transparent !important; }
.rl-table tr.rule td { color: #c8d6e3; }
.rl-table td.rule { color: #c8d6e3; }
.rl-table td.strong { color: #ffd27a; font-weight: 600; }
.rl-table.txt2 td .txt { white-space: normal; display: inline-block; max-width: 420px; text-align: left; }
.rl-field .pk-pills label { font-size: .74rem; }
