/* Mobile shell — SIMULATOR home + run / optimizer results (mshell/simulator.js).
   Supersedes the "Mobile web-shell SIMULATOR" skin in styles.css inside
   .mwsim pages. */
@media (max-width: 979px) {
  html.web-shell .mwsim-htitle { font-weight: 800; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  html.web-shell .mwsim { min-width: 0; }
  html.web-shell .mwsim * { box-sizing: border-box; }

  /* ------------------------------------------------ NEW RUN card */
  html.web-shell .mwsim-new { gap: 13px; }
  html.web-shell .mwsim-pick { display: flex; align-items: center; gap: 12px; min-height: 40px; font-size: 13px; }
  html.web-shell .mwsim-pick .l { color: var(--mws-ink-2); flex-shrink: 0; }
  html.web-shell .mwsim-pill {
    position: relative; margin-left: auto; min-width: 0; max-width: 72%;
    display: inline-flex; align-items: center; gap: 7px;
    height: 40px; padding: 0 13px; border-radius: 10px;
    background: var(--mws-well); border: 1px solid var(--mws-line-strong); color: var(--mws-ink);
    font-family: var(--font); font-size: 12.5px; font-weight: 700; cursor: pointer;
  }
  html.web-shell .mwsim-pill.mono { font-family: var(--mws-mono); font-weight: 600; font-size: 12px; }
  html.web-shell .mwsim-pill > span:not(.chev):not(.av) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  html.web-shell .mwsim-pill .nm { font-size: 13px; }
  html.web-shell .mwsim-pill .av { display: inline-flex; flex-shrink: 0; }
  html.web-shell .mwsim-pill .av > * { width: 18px !important; height: 18px !important; font-size: 8px !important; }
  html.web-shell .mwsim-pill .chev { display: inline-flex; color: var(--mws-ink-3); flex-shrink: 0; }
  html.web-shell select.mwsim-overlay {
    position: absolute; inset: 0; width: 100%; height: 100%;
    opacity: 0; cursor: pointer; margin: 0; padding: 0; border: 0;
    -webkit-appearance: none; appearance: none; font-size: 16px;
  }
  html.web-shell .mwsim-seg {
    display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px;
    background: var(--mws-bg); border: 1px solid var(--mws-line); border-radius: 999px;
  }
  html.web-shell .mwsim-seg-b {
    height: 34px; border-radius: 999px; border: 0; background: transparent; cursor: pointer;
    font-family: var(--mws-mono); font-size: 11.5px; font-weight: 600; color: var(--mws-ink-3);
  }
  html.web-shell .mwsim-seg-b.on { background: rgba(240, 185, 11, 0.14); color: var(--mws-gold); }
  html.web-shell .mwsim-cta { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 10px; padding-top: 4px; }
  html.web-shell .mwsim-cta.solo { grid-template-columns: 1fr; }
  html.web-shell .mwsim-cta .mws-btn { height: 46px; font-size: 13.5px; width: 100%; margin: 0 !important; padding: 0 12px; text-decoration: none; }
  html.web-shell .mwsim-cta .mws-btn.gold { font-weight: 800; }
  html.web-shell .mwsim-cta .mws-btn:not(.gold) { font-weight: 700; font-size: 13px; }

  /* ------------------------------------------------ collapsible sections */
  html.web-shell .mwsim-sec { padding: 0; gap: 0; overflow: hidden; }
  html.web-shell .mwsim-sec-hd,
  html.web-shell .mwsim-more-acts > summary {
    list-style: none; cursor: pointer; min-height: 54px; padding: 0 16px;
    display: flex; align-items: center; gap: 10px;
  }
  html.web-shell .mwsim-sec-hd::-webkit-details-marker,
  html.web-shell .mwsim-more-acts > summary::-webkit-details-marker { display: none; }
  html.web-shell .mwsim-sec-t { font-weight: 800; font-size: 14px; flex-shrink: 0; }
  html.web-shell .mwsim-sec-sub {
    margin-left: auto; min-width: 0; font-family: var(--mws-mono); font-size: 10.5px;
    color: var(--mws-ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  html.web-shell .mwsim-sec-chev { display: inline-flex; color: var(--mws-ink-3); transition: transform .15s; flex-shrink: 0; }
  html.web-shell details[open] > summary .mwsim-sec-chev { transform: rotate(180deg); }
  html.web-shell .mwsim-sec-bd {
    padding: 4px 16px 16px; display: flex; flex-direction: column; gap: 14px;
    border-top: 1px solid var(--mws-line-2);
  }
  html.web-shell .mwsim-sec-bd > :first-child { margin-top: 12px; }
  html.web-shell .mwsim-hint { font-size: 12px; color: var(--mws-ink-3); line-height: 1.45; }
  html.web-shell .mwsim-note { font-size: 12px; color: var(--mws-ink-3); line-height: 1.5; }
  html.web-shell .mwsim-note.left { text-align: left; }

  /* legacy fields inside the sections — board inputs */
  html.web-shell .mwsim .field { margin: 0; min-width: 0; }
  html.web-shell .mwsim .field > label:first-child,
  html.web-shell .mwsim .sim-date-row .field > label {
    display: block; margin-bottom: 7px;
    font-family: var(--mws-mono); font-size: 10px; letter-spacing: 0.12em;
    text-transform: uppercase; color: var(--mws-ink-3); font-weight: 500;
  }
  html.web-shell .mwsim .field input[type="text"],
  html.web-shell .mwsim .field input[type="number"],
  html.web-shell .mwsim .field input[type="datetime-local"],
  html.web-shell .mwsim .field select,
  html.web-shell .mwsim .sim-sweep-values {
    width: 100%; height: 44px; box-sizing: border-box; margin: 0;
    background: var(--mws-bg); border: 1px solid var(--mws-line); border-radius: 12px;
    padding: 0 12px; color: var(--mws-ink); font-size: 14px;
    font-family: var(--mws-mono); font-weight: 600;
  }
  html.web-shell .mwsim .field select { font-family: var(--font); font-weight: 600; }
  html.web-shell .mwsim .field input:focus,
  html.web-shell .mwsim .field select:focus { outline: none; border-color: rgba(240, 185, 11, 0.5); }
  html.web-shell .mwsim .hint {
    font-size: 12px; color: var(--mws-ink-3); line-height: 1.5; margin-top: 8px;
    font-family: var(--font); letter-spacing: 0; text-transform: none;
  }
  html.web-shell .mwsim .hint input[type="number"] {
    display: inline-block; width: 84px !important; height: 36px; margin: 6px 0 0 6px !important; vertical-align: middle;
  }
  html.web-shell .mwsim .sim-inline-check {
    display: flex !important; align-items: center; gap: 10px; min-height: 36px;
    font-family: var(--font) !important; font-size: 13.5px !important; letter-spacing: 0 !important;
    text-transform: none !important; color: var(--mws-ink) !important; font-weight: 700 !important;
    margin: 0 !important; cursor: pointer;
  }
  html.web-shell .mwsim .sim-inline-check input[type="checkbox"] {
    -webkit-appearance: none; appearance: none; margin: 0;
    width: 36px; height: 20px; border-radius: 999px; flex-shrink: 0;
    background: var(--mws-well); border: 1px solid var(--mws-line); position: relative; cursor: pointer;
  }
  html.web-shell .mwsim .sim-inline-check input[type="checkbox"]::after {
    content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px;
    border-radius: 50%; background: var(--mws-ink-3); transition: transform .15s;
  }
  html.web-shell .mwsim .sim-inline-check input[type="checkbox"]:checked {
    background: rgba(32, 199, 117, 0.25); border-color: rgba(32, 199, 117, 0.45);
  }
  html.web-shell .mwsim .sim-inline-check input[type="checkbox"]:checked::after { transform: translateX(16px); background: var(--mws-up); }
  html.web-shell .mwsim .sim-date-row { display: grid; grid-template-columns: 1fr; gap: 14px; }
  html.web-shell .mwsim .sim-coins { display: flex; flex-direction: column; gap: 8px; }
  html.web-shell .mwsim .sim-coin-row { display: flex; gap: 8px; align-items: center; }
  html.web-shell .mwsim .sim-coin-row select { flex: 1 1 auto; }
  html.web-shell .mwsim .sim-coin-remove {
    width: 44px; height: 44px; flex: 0 0 44px; border-radius: 12px; padding: 0;
    background: transparent; border: 1px solid var(--mws-line); color: var(--mws-down);
  }
  html.web-shell .mwsim .sim-coins > .btn.secondary {
    height: 40px; border-radius: 999px; background: transparent !important;
    border: 1px dashed var(--mws-line-strong) !important; color: var(--mws-gold) !important;
    font-size: 13px; font-weight: 700; margin-top: 2px !important; box-shadow: none !important;
  }
  html.web-shell .mwsim .sim-sampling-panel { margin-top: 10px; }
  html.web-shell .mwsim .sim-sampling-best {
    display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 12px;
    background: rgba(240, 185, 11, 0.08); border: 1px solid rgba(240, 185, 11, 0.25);
    font-size: 12.5px; color: var(--mws-ink); font-weight: 600;
  }
  html.web-shell .mwsim .sim-sampling-emoji { display: none; }
  html.web-shell .mwsim .sim-sampling-more { margin-top: 8px; font-size: 12.5px; color: var(--mws-ink-2); }
  html.web-shell .mwsim .sim-sampling-more summary { cursor: pointer; color: var(--mws-gold); font-weight: 700; min-height: 32px; display: flex; align-items: center; }
  html.web-shell .mwsim .sim-sampling-section-title {
    font-family: var(--mws-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--mws-ink-3); margin: 10px 0 4px;
  }
  html.web-shell .mwsim .sim-sampling-list { margin: 0; padding-left: 18px; line-height: 1.5; }

  /* legacy strategy groups (nested <details>) */
  html.web-shell .mwsim .sim-base-groups { display: flex; flex-direction: column; gap: 8px; }
  html.web-shell .mwsim .sim-group {
    background: var(--mws-bg); border: 1px solid var(--mws-line-2); border-radius: 12px;
    padding: 0; margin: 0;
  }
  html.web-shell .mwsim .sim-group > summary {
    min-height: 46px; padding: 0 14px; display: flex; align-items: center;
    font-size: 13.5px; font-weight: 700; color: var(--mws-ink); cursor: pointer;
  }
  html.web-shell .mwsim .sim-group[open] > summary { border-bottom: 1px solid var(--mws-line-2); }
  html.web-shell .mwsim .sim-group > :not(summary) { margin-left: 12px; margin-right: 12px; }
  html.web-shell .mwsim .sim-group > .field,
  html.web-shell .mwsim .sim-group > div { margin-top: 12px; }
  html.web-shell .mwsim .sim-group > :last-child { margin-bottom: 12px; }
  html.web-shell .mwsim .sim-group .field > label:not(.sim-inline-check) input[type="checkbox"] { accent-color: var(--mws-gold); }

  /* ------------------------------------------------ find-best (desktop sweep card on phone) */
  html.web-shell .mwsim-opt .fbc-allbar { display: flex; justify-content: flex-end; gap: 14px; margin: -4px 2px; font-family: var(--mws-mono); font-size: 10.5px; }
  html.web-shell .mwsim-opt .fbc-allbar a { color: var(--mws-ink-3); text-decoration: none; }
  html.web-shell .mwsim-opt .mwsim-step {
    margin: 0 !important; width: auto !important; max-width: none !important;
    background: var(--mws-card) !important; border: 1px solid var(--mws-line) !important;
    border-radius: 16px !important; padding: 16px !important; box-shadow: none !important;
  }
  html.web-shell .mwsim-opt .fbc-step-head { flex-wrap: wrap; row-gap: 8px; }
  html.web-shell .mwsim-opt .fbc-step-title { font-size: 14.5px; font-weight: 800; }
  html.web-shell .mwsim-opt .fbc-step-sub { font-family: var(--mws-mono); font-size: 10.5px; color: var(--mws-ink-3); }
  html.web-shell .mwsim-opt .fbc-chipgrid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  html.web-shell .mwsim-opt .fbc-knob { min-width: 0; min-height: 56px; }
  html.web-shell .mwsim-opt .fbc-est { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  html.web-shell .mwsim-opt .rfgrid { grid-template-columns: 1fr !important; }
  html.web-shell .mwsim-opt input, html.web-shell .mwsim-opt select { max-width: 100%; }
  html.web-shell .mwsim-opt .mwsim-new .fbc-runbtn { display: inline-flex; }
  html.web-shell .mwsim-fleet { font-size: 12px; }

  /* ------------------------------------------------ PAST RUNS */
  html.web-shell .mwsim-past { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
  html.web-shell .mwsim-past > .mws-sec { margin: 0 2px; min-height: 28px; }
  html.web-shell .mwsim-cmp { font-size: 12.5px; padding: 6px 0; min-height: 32px; }
  html.web-shell .mwsim-row { padding: 15px; position: relative; }
  html.web-shell .mwsim-row .nm { flex-wrap: wrap; row-gap: 3px; font-size: 13.5px; }
  html.web-shell .mwsim-row .nm .t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
  html.web-shell .mwsim-row .mws-badge { font-size: 9px; padding: 1px 6px; border-radius: 5px; }
  html.web-shell .mwsim-row .mws-badge.line.up { border-color: rgba(32, 199, 117, 0.3); background: rgba(32, 199, 117, 0.1); }
  html.web-shell .mwsim-row .mws-badge.line.down { border-color: rgba(234, 57, 67, 0.3); background: rgba(234, 57, 67, 0.1); }
  html.web-shell .mwsim-row .mws-badge.line.gold { border-color: rgba(240, 185, 11, 0.3); background: rgba(240, 185, 11, 0.1); }
  html.web-shell .mwsim-row .sub { font-size: 10.5px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  html.web-shell .mwsim-row .right .v { font-size: 13.5px; }
  html.web-shell .mwsim-row .mws-icosq { border-radius: 10px; }
  html.web-shell .mws-icosq.off { background: var(--mws-well); color: var(--mws-ink-3); }
  html.web-shell .mwsim-bar { height: 4px; border-radius: 999px; background: var(--mws-well); overflow: hidden; margin-top: 4px; }
  html.web-shell .mwsim-bar > span { display: block; height: 100%; background: linear-gradient(90deg, #f0b90b, #fcd535); border-radius: inherit; }
  html.web-shell .mwsim-bar.big { height: 8px; }
  html.web-shell .mwsim-bar.off > span { background: var(--mws-ink-3); }
  html.web-shell .mwsim-tune {
    width: 40px; height: 40px; flex: 0 0 40px; margin: -6px -6px -6px 0; border-radius: 10px;
    background: transparent; border: 1px solid var(--mws-line); color: var(--mws-ink-2);
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
  }
  html.web-shell .mwsim-tune > span { display: inline-flex; }
  html.web-shell .mwsim-more { align-self: center; padding: 8px 12px; min-height: 40px; }
  html.web-shell .mwsim-tools { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; }
  html.web-shell .mwsim-clr { font-size: 12px; min-height: 40px; padding: 0 4px; }
  html.web-shell .mwsim-empty-t { font-weight: 800; color: var(--mws-ink); font-size: 14px; margin-bottom: 6px; }
  /* compare mode — the legacy selectable rows as board row cards */
  html.web-shell .mwsim-cmpbar { gap: 10px; }
  html.web-shell .mwsim-cmpbar .sim-compare-hint { font-size: 12.5px; color: var(--mws-ink-2); }
  html.web-shell .mwsim-cmplist { display: flex; flex-direction: column; gap: 10px; }
  html.web-shell .mwsim-cmplist .sim-run-row {
    display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
    background: var(--mws-card); border: 1px solid var(--mws-line); border-radius: 16px;
    padding: 14px; color: var(--mws-ink); margin: 0;
  }
  html.web-shell .mwsim-cmplist .sim-run-row.selected { border-color: rgba(240, 185, 11, 0.5); background: rgba(240, 185, 11, 0.06); }
  html.web-shell .mwsim-cmplist .sim-run-row.disabled { opacity: 0.45; }
  html.web-shell .mwsim-cmplist .sim-run-select-box {
    width: 24px; height: 24px; flex: 0 0 24px; border-radius: 7px; border: 1px solid var(--mws-line-strong);
    display: inline-flex; align-items: center; justify-content: center; color: #1a1206;
    font-weight: 800; font-size: 13px;
  }
  html.web-shell .mwsim-cmplist .sim-run-row.selected .sim-run-select-box { background: var(--mws-gold); border-color: var(--mws-gold); }
  html.web-shell .mwsim-cmplist .sim-run-main { flex: 1 1 auto; min-width: 0; }
  html.web-shell .mwsim-cmplist .sim-run-title { font-weight: 800; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  html.web-shell .mwsim-cmplist .sim-run-sub,
  html.web-shell .mwsim-cmplist .sim-run-hint { font-family: var(--mws-mono); font-size: 10.5px; color: var(--mws-ink-3); margin-top: 3px; }
  html.web-shell .mwsim-cmplist .sim-pill,
  html.web-shell .mwsim-board .sim-pill { font-family: var(--mws-mono); font-size: 9.5px; flex-shrink: 0; }

  /* ------------------------------------------------ results: shared */
  html.web-shell .mwsim-poshead { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
  html.web-shell .mwsim-poshead > :last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  html.web-shell .mwsim-hero { gap: 12px; background: linear-gradient(180deg, var(--mws-hero-a), var(--mws-hero-b)); }
  html.web-shell .mwsim-herorow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  html.web-shell .mwsim-big { font-family: var(--mws-mono); font-size: 30px; font-weight: 600; letter-spacing: -0.02em; margin-right: 2px; }
  html.web-shell .mwsim-herosub { font-size: 12px; color: var(--mws-ink-3); margin-top: -6px; }
  html.web-shell .mwsim-sub { font-family: var(--mws-mono); font-size: 10.5px; color: var(--mws-ink-3); }
  html.web-shell .mwsim-stats4 { padding-top: 12px; border-top: 1px solid var(--mws-line-2); }
  html.web-shell .mwsim-acts { display: flex; flex-direction: column; gap: 10px; }
  html.web-shell .mwsim-acts .mws-btn { width: 100%; margin: 0 !important; }
  html.web-shell .mwsim-actgrid > :only-child { grid-column: 1 / -1; }
  html.web-shell .mwsim-actgrid > :nth-child(odd):last-child { grid-column: 1 / -1; }
  html.web-shell .mwsim-del { align-self: center; min-height: 40px; padding: 0 14px; font-size: 12.5px; }
  html.web-shell .mwsim-chartcap { display: flex; justify-content: space-between; font-family: var(--mws-mono); font-size: 10px; color: var(--mws-ink-3); }
  html.web-shell .mwsim-kvv { font-size: 12.5px; min-width: 0; overflow-wrap: anywhere; }
  html.web-shell .mwsim-prog { gap: 12px; }
  html.web-shell .mwsim-pct { font-size: 22px; font-weight: 600; color: var(--mws-gold); }
  html.web-shell .mwsim-meta { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--mws-ink-3); }
  html.web-shell .mwsim-phase { font-size: 11.5px; color: var(--mws-ink-2); padding: 8px 10px; background: var(--mws-well); border-radius: 10px; overflow-wrap: anywhere; }
  html.web-shell .mwsim-fail { border-color: rgba(234, 57, 67, 0.35); gap: 14px; }
  html.web-shell .mwsim-failhd { display: flex; gap: 12px; align-items: center; }
  html.web-shell .mwsim-failhd .t { font-weight: 800; font-size: 15px; }
  html.web-shell .mwsim-failhd .s { font-size: 11px; color: var(--mws-ink-3); margin-top: 2px; }
  html.web-shell .mwsim-failmsg {
    font-family: var(--mws-mono); font-size: 12px; line-height: 1.5; color: #ff9aa0;
    background: rgba(234, 57, 67, 0.08); border: 1px solid rgba(234, 57, 67, 0.25);
    border-radius: 12px; padding: 12px; overflow-wrap: anywhere;
  }
  html.web-shell .mwsim-warn { font-size: 12px; color: var(--mws-gold); }

  /* ------------------------------------------------ run result: coin cards */
  html.web-shell .mwsim-coin { gap: 12px; padding: 16px; margin: 0; }
  html.web-shell .mwsim-coin .sim-coin-title { font-size: 16px; font-weight: 800; margin: 0; letter-spacing: 0; text-transform: none; font-family: var(--font); color: var(--mws-ink); display: flex; align-items: center; gap: 8px; }
  html.web-shell .mwsim-coin .kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--mws-line-2); font-size: 13px; }
  html.web-shell .mwsim-coin .kv .k { color: var(--mws-ink-2); min-width: 0; }
  html.web-shell .mwsim-coin .kv .v { font-family: var(--mws-mono); font-weight: 600; text-align: right; }
  html.web-shell .mwsim-coin .sim-section-title {
    font-family: var(--mws-mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--mws-ink-3); margin: 6px 0 2px;
  }
  html.web-shell .mwsim-coin .sim-trade-row {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px;
    padding: 10px 0; border-top: 1px solid var(--mws-line-2); font-size: 12px;
    font-family: var(--mws-mono);
  }
  html.web-shell .mwsim-coin .tfx-simrun-tabs .tabs-row {
    display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px;
  }
  html.web-shell .mwsim-coin .tfx-simrun-tabs .tabs-row::-webkit-scrollbar { display: none; }
  html.web-shell .mwsim-coin .tfx-simrun-tabs .tab-btn {
    flex-shrink: 0; height: 34px; padding: 0 12px; border-radius: 999px; cursor: pointer;
    background: transparent; border: 1px solid var(--mws-line); color: var(--mws-ink-3);
    font-family: var(--mws-mono); font-size: 11px; display: inline-flex; align-items: center; gap: 6px;
  }
  html.web-shell .mwsim-coin .tfx-simrun-tabs .tab-btn.on {
    background: rgba(240, 185, 11, 0.14); border-color: rgba(240, 185, 11, 0.35); color: var(--mws-gold); font-weight: 600;
  }
  html.web-shell .mwsim-coin .tfx-simrun-tabs .tab-btn .c { opacity: 0.8; }
  html.web-shell .mwsim-coin .tabs-panel { margin-top: 10px; }
  html.web-shell .mwsim-coin .btn.ghost { height: 40px; border-radius: 999px; }
  html.web-shell .mwsim-apply { display: flex; flex-direction: column; gap: 10px; padding-top: 12px; border-top: 1px solid var(--mws-line-2); }
  html.web-shell .mwsim-apply .hd { display: flex; flex-direction: column; gap: 3px; }
  html.web-shell .mwsim-apply .hd .t { font-weight: 800; font-size: 13.5px; }
  html.web-shell .mwsim-apply .hd .s { font-size: 12px; color: var(--mws-ink-3); }
  html.web-shell .mwsim-apply .row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  html.web-shell .mwsim-apply .row .mws-btn { width: 100%; padding: 0 10px; font-size: 13px; }
  html.web-shell .mwsim-share { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--mws-line-2); }

  /* ------------------------------------------------ optimizer result */
  html.web-shell .mwsim-optsum .mwsim-kv,
  html.web-shell .mwsim-optsum .kv {
    display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
    padding: 0; border: 0; font-size: 13px; min-height: 24px;
  }
  html.web-shell .mwsim-optsum .kv .k { color: var(--mws-ink-2); flex-shrink: 0; }
  html.web-shell .mwsim-optsum .kv .v { font-family: var(--mws-mono); font-weight: 600; text-align: right; font-size: 12.5px; min-width: 0; overflow-wrap: anywhere; }
  html.web-shell .mwsim-optsum .sim-sweep-chips { display: flex; flex-wrap: wrap; gap: 5px; justify-content: flex-end; }
  html.web-shell .mwsim-optsum .sim-sweep-chip {
    font-family: var(--mws-mono); font-size: 10.5px; padding: 2px 8px; border-radius: 6px;
    background: var(--mws-well); border: 1px solid var(--mws-line); color: var(--mws-ink-2);
  }
  html.web-shell .mwsim-win { border-color: rgba(240, 185, 11, 0.35); background: linear-gradient(180deg, rgba(240, 185, 11, 0.06), var(--mws-card) 60%); }
  html.web-shell .mwsim-by { text-transform: none; letter-spacing: 0.02em; }
  html.web-shell .mwsim-knobs { display: flex; flex-wrap: wrap; gap: 6px; }
  html.web-shell .mwsim-knob {
    display: inline-flex; gap: 6px; align-items: baseline; padding: 5px 10px; border-radius: 999px;
    background: var(--mws-well); border: 1px solid var(--mws-line); font-size: 12px;
  }
  html.web-shell .mwsim-knob .k { color: var(--mws-ink-3); }
  html.web-shell .mwsim-knob .v { font-family: var(--mws-mono); font-weight: 600; color: var(--mws-gold); }
  html.web-shell .mwsim-win .mws-btns .mws-btn { width: 100%; }
  html.web-shell .mwsim-more-acts { margin: 0 -16px -16px; border-top: 1px solid var(--mws-line-2); }
  html.web-shell .mwsim-more-acts > .sim-opt-details-inner { padding: 4px 16px 16px; display: flex; flex-direction: column; gap: 10px; }
  html.web-shell .mwsim-wf { gap: 10px; }
  html.web-shell .mwsim-wfrow {
    display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(40px, 1fr) auto 26px;
    align-items: center; gap: 10px; min-height: 40px; padding: 6px 0;
    border-top: 1px solid var(--mws-line-2);
  }
  html.web-shell .mwsim-wfrow .l { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  html.web-shell .mwsim-wfrow .n { font-size: 11px; font-weight: 700; color: var(--mws-ink); }
  html.web-shell .mwsim-wfrow .d { font-size: 10.5px; color: var(--mws-ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  html.web-shell .mwsim-wfrow .v { font-size: 12.5px; font-weight: 600; text-align: right; }
  html.web-shell .mwsim-wfrow .mws-badge { justify-content: center; }
  html.web-shell .mwsim-wfrow.hold { background: rgba(240, 185, 11, 0.04); margin: 0 -16px; padding: 6px 16px; }
  html.web-shell .mwsim-wfrow.hold .n { color: var(--mws-gold); }
  html.web-shell .mwsim-wfbar { height: 6px; background: var(--mws-well); border-radius: 999px; overflow: hidden; }
  html.web-shell .mwsim-wfbar > span { display: block; height: 100%; border-radius: inherit; }
  html.web-shell .mwsim-wfbar > span.up { background: var(--mws-up); }
  html.web-shell .mwsim-wfbar > span.down { background: var(--mws-down); }

  /* ranked candidates (legacy scoreboard, board row cards) */
  html.web-shell .mwsim-board { gap: 12px; margin: 0; }
  html.web-shell .mwsim-board .sim-opt-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
  html.web-shell .mwsim-board .mwsim-boardlbl { flex: 1 1 100%; }
  html.web-shell .mwsim-board .sim-opt-metric-label { font-size: 12px; color: var(--mws-ink-3); }
  html.web-shell .mwsim-board select {
    flex: 1 1 auto; min-width: 0; height: 40px; border-radius: 10px; padding: 0 10px;
    background: var(--mws-bg); border: 1px solid var(--mws-line); color: var(--mws-ink);
    font-size: 13px; font-weight: 600;
  }
  html.web-shell .mwsim-board .sim-opt-coin-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
  html.web-shell .mwsim-board .sim-opt-coin-tab {
    flex-shrink: 0; height: 34px; padding: 0 12px; border-radius: 999px; cursor: pointer;
    background: transparent; border: 1px solid var(--mws-line); color: var(--mws-ink-3);
    font-family: var(--mws-mono); font-size: 11px;
  }
  html.web-shell .mwsim-board .sim-opt-coin-tab.active { background: rgba(240, 185, 11, 0.14); border-color: rgba(240, 185, 11, 0.35); color: var(--mws-gold); font-weight: 600; }
  html.web-shell .mwsim-board .sim-opt-winner { display: none; }   /* shown by the WINNER card above */
  html.web-shell .mwsim-board .sim-opt-summary { font-size: 12px; color: var(--mws-ink-3); display: flex; flex-direction: column; gap: 6px; }
  html.web-shell .mwsim-board .sim-staged { font-size: 12px; background: var(--mws-bg); border: 1px solid var(--mws-line-2); border-radius: 12px; padding: 10px 12px; }
  html.web-shell .mwsim-board .sim-staged summary { cursor: pointer; font-weight: 700; color: var(--mws-ink); min-height: 32px; display: flex; align-items: center; }
  html.web-shell .mwsim-board .sim-opt-row-head { display: none; }
  html.web-shell .mwsim-board .sim-opt-tap-hint { font-size: 11.5px; color: var(--mws-ink-3); }
  html.web-shell .mwsim-board .sim-opt-row-group {
    background: var(--mws-bg); border: 1px solid var(--mws-line-2); border-radius: 14px; margin: 0 0 8px; overflow: hidden;
  }
  html.web-shell .mwsim-board .sim-opt-row {
    display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; grid-template-areas:
      "rank metric chev" "rank knobs knobs" "rank trades trades";
    gap: 6px 10px; padding: 12px; cursor: pointer; align-items: center; border: 0; background: transparent;
  }
  html.web-shell .mwsim-board .sim-opt-row.best { background: rgba(240, 185, 11, 0.06); }
  html.web-shell .mwsim-board .sim-opt-cell { min-width: 0; padding: 0; border: 0; text-align: left; }
  html.web-shell .mwsim-board .sim-opt-cell.rank {
    grid-area: rank; align-self: start; width: 36px; height: 36px; border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--mws-well); font-family: var(--mws-mono); font-size: 12px; font-weight: 700; color: var(--mws-ink-2);
  }
  html.web-shell .mwsim-board .sim-opt-row.best .sim-opt-cell.rank { background: rgba(240, 185, 11, 0.16); color: var(--mws-gold); }
  html.web-shell .mwsim-board .sim-opt-cell.metric {
    grid-area: metric; font-family: var(--mws-mono); font-size: 14px; font-weight: 600; color: var(--mws-ink);
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  }
  html.web-shell .mwsim-board .sim-opt-cell.knobs { grid-area: knobs; }
  html.web-shell .mwsim-board .sim-opt-cell.trades { grid-area: trades; font-family: var(--mws-mono); font-size: 10.5px; color: var(--mws-ink-3); }
  html.web-shell .mwsim-board .sim-opt-cell.chevron { grid-area: chev; color: var(--mws-ink-3); }
  html.web-shell .mwsim-board .sim-opt-row.expanded .sim-opt-cell.chevron { transform: rotate(180deg); }
  html.web-shell .mwsim-board .sim-wf-badges { display: flex; flex-wrap: wrap; gap: 4px; flex-basis: 100%; }
  html.web-shell .mwsim-board .sim-wf-badge {
    font-family: var(--mws-mono); font-size: 9.5px; font-weight: 700; padding: 1px 6px; border-radius: 5px;
    border: 1px solid rgba(32, 199, 117, 0.3); background: rgba(32, 199, 117, 0.1); color: var(--mws-up);
  }
  html.web-shell .mwsim-board .sim-wf-badge.warn { border-color: rgba(234, 57, 67, 0.3); background: rgba(234, 57, 67, 0.1); color: var(--mws-down); }
  html.web-shell .mwsim-board .sim-wf-badge.realized { border-color: rgba(240, 185, 11, 0.3); background: rgba(240, 185, 11, 0.1); color: var(--mws-gold); }
  html.web-shell .mwsim-board .sim-opt-knob-chips { display: flex; flex-wrap: wrap; gap: 5px; }
  html.web-shell .mwsim-board .sim-opt-knob-chip {
    display: inline-flex; gap: 4px; font-size: 11px; padding: 2px 8px; border-radius: 999px;
    background: var(--mws-well); border: 1px solid var(--mws-line);
  }
  html.web-shell .mwsim-board .sim-opt-knob-chip .k { color: var(--mws-ink-3); }
  html.web-shell .mwsim-board .sim-opt-knob-chip .v { font-family: var(--mws-mono); font-weight: 600; color: var(--mws-ink); }
  html.web-shell .mwsim-board .sim-opt-details { padding: 0 12px 12px; border-top: 1px solid var(--mws-line-2); }
  html.web-shell .mwsim-board .sim-opt-details-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
  html.web-shell .mwsim-board .sim-opt-action-btn,
  html.web-shell .mwsim-more-acts .sim-opt-action-btn {
    width: 100%; height: 44px; border-radius: 999px; font-size: 13.5px; font-weight: 700; margin: 0 !important;
  }
  html.web-shell .mwsim-board .sim-opt-more-bar { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
  html.web-shell .mwsim-board .sim-opt-more-btn { height: 40px; border-radius: 999px; padding: 0 16px; }
  html.web-shell .mwsim-board .sim-opt-overflow-meta { font-family: var(--mws-mono); font-size: 10.5px; color: var(--mws-ink-3); text-align: center; }
  html.web-shell .mwsim .sim-opt-deploy-header { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
  html.web-shell .mwsim .sim-opt-deploy-title { font-weight: 800; font-size: 13px; }
  html.web-shell .mwsim .sim-opt-deploy-hint { font-size: 11.5px; color: var(--mws-ink-3); }
}
@media (max-width: 979px) {
  html.web-shell .mwsim-pill .av > * { overflow: hidden; }
}
@media (max-width: 979px) {
  html.web-shell .mwsim-board .sim-opt-row.sim-opt-row-head { display: none; }
}
