/* Data Simulator node - styles. Loaded globally by Dash from /assets, so every rule is scoped under .dsim-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. */

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

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

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

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

/* the bar of what is shown */
.dsim-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; }
.dsim-bar > div { min-width: 0; }
.dsim-bar .dsim-dd { min-width: 210px; }
.dsim-bar .dsim-dd.wide { min-width: 380px; max-width: 760px; }

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

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

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

.dsim-step { display: flex; gap: 10px; align-items: flex-start; margin-top: 8px; font-size: .78rem; line-height: 1.5; color: #dfe7ee; }
.dsim-step b { color: #e8f4ff; }
.dsim-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 -------------------------------------------------------------------- */
.dsim-game { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.dsim-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; }
.dsim-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); }
.dsim-game-cell.wrong { border-color: #e66767; box-shadow: 0 0 0 2px rgba(230,103,103,0.35); }
.dsim-game-l { position: absolute; top: 6px; right: 10px; z-index: 2; color: #f5d6a3; font-weight: 700; font-size: .95rem; }
.dsim-game-pick label { min-width: 46px; justify-content: center; font-weight: 700; }

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

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