*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0f0f12; --bg-card: #1a1a20; --bg-input: #141418;
  --text: #e8e8ed; --text2: #8e8e96; --dim: #5e5e66;
  --border: #2a2a32; --accent: #5e5eff;
  --green: #34c759; --red: #ff453a; --orange: #ff9f0a;
  --radius: 12px; --radius-sm: 8px;
}
.strategy-name { color: #ffd60a !important; font-weight: 400 !important; }
.copytrade-mode { color: #64d2ff; font-weight: 400; }
[data-theme="light"] {
  --bg: #f2f2f7; --bg-card: #ffffff; --bg-input: #e8e8ed;
  --text: #111114; --text2: #6c6c74; --dim: #a0a0a8; --border: #dcdce2;
}

html, body { background: var(--bg); color: var(--text); font: 15px/1.4 -apple-system, "Segoe UI", Roboto, sans-serif; }
#app { min-height: 100vh; padding-bottom: 80px; }

#topBar { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; background: var(--bg); border-bottom: 1px solid var(--border); }
#topBar .title { font-weight: 600; font-size: 17px; }
#topBar .sub { font-size: 12px; color: var(--text2); }
#topBar .theme-btn { background: none; border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 4px 10px; }

#content { padding: 12px 12px 0; }

#tabBar { position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: var(--bg);
  border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); z-index: 5; }
.tab-btn { flex: 1; min-width: 0; background: none; border: 0; color: var(--dim); padding: 8px 0 10px; font-size: 10px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.tab-btn .ico { font-size: 20px; line-height: 1; }
.tab-btn.active { color: var(--text); }

.section-title { font-size: 13px; text-transform: uppercase; color: var(--text2); margin: 16px 4px 8px; letter-spacing: .04em; }
.section-title:first-child { margin-top: 4px; }

.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card-title { font-weight: 600; }
.card-sub { color: var(--text2); font-size: 13px; margin-top: 2px; }
.indic-density .card-title { font-size: 13px; line-height: 1.2; }
.indic-density .card-sub { font-size: 11px; line-height: 1.2; margin-top: 1px; }
.indic-density .indic-live { font-size: 10px; font-weight: 500; color: var(--text2); }
.indicator-settings .card { padding: 9px 11px; margin-bottom: 7px; }
.indicator-settings .indic-settings-group { margin-top: 6px; margin-bottom: 2px; }
.indicator-settings .indic-settings-row { min-height: 0; padding: 2px 0; margin: 0; gap: 6px; }
.indicator-settings .indic-settings-row .lbl { font-size: 11px; line-height: 1.15; }
.indicator-settings .indic-settings-row .form-input,
.indicator-settings .form-group .form-input { padding: 4px 7px; border-radius: 6px; font-size: 12px; line-height: 1.15; }
.indicator-settings .form-group { margin-bottom: 6px; }
.indicator-settings .form-group > label { margin-bottom: 2px; font-size: 11px; }
.indicator-settings .card-actions { gap: 5px; margin-top: 6px; }
.indicator-settings .card-actions .btn { min-height: 0; padding: 4px 8px; font-size: 11px; }
.indicator-settings .seg button { padding: 4px 3px; font-size: 11px; }
.db-sync-compact .ladder { font-size: 10px; line-height: 1.1; }
.db-sync-compact .ladder th { padding: 1px 3px; font-size: 9px; }
.db-sync-compact .ladder td { padding: 1px 3px; }
.db-sync-compact .hint { font-size: 10px; line-height: 1.2; margin-top: 2px; }
.card-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.card.click { cursor: pointer; }

.row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; gap: 8px; }
.row + .row { border-top: 1px solid var(--border); }
.row .lbl { color: var(--text2); font-size: 14px; }

.btn { border: 0; border-radius: var(--radius-sm); padding: 9px 14px; font-size: 14px; font-weight: 500; background: var(--bg-input); color: var(--text); cursor: pointer; }
.btn:active { opacity: .7; }
.btn:disabled { opacity: .4; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-danger { background: transparent; color: var(--red); border: 1px solid var(--red); }
.btn-outline { background: transparent; border: 1px solid var(--border); }
.btn-block { width: 100%; }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.code-log-icon { font: 700 11px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: -1px; }
.condition-log-overlay { z-index: 30; }
.condition-log-modal { max-width: 640px; padding: 10px 10px 14px; }
.condition-log-modal .modal-header { margin-bottom: 6px; }
.condition-log-modal .modal-header h2 { font-size: 13px; line-height: 1.25; font-weight: 400; }
.condition-log-modal .modal-close { font-size: 20px; line-height: 1; padding: 2px 5px; }
.condition-log-modal .modal-footer { margin-top: 7px; }
.condition-log-modal .modal-footer .btn { padding: 6px 9px; font-size: 12px; font-weight: 400; }
.cond-log-tabs { margin-bottom: 6px; }
.cond-log-tabs button { padding: 4px 3px; font-size: 11px; font-weight: 400; }
.cond-log-card { padding: 7px 8px; margin-bottom: 6px; border-radius: 8px; }
.cond-log-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; color: var(--text2); font-size: 10.5px; margin-bottom: 4px; }
.cond-log-head .badge { font-size: 9px; font-weight: 400; padding: 2px 5px; }
.cond-log-group { border-left: 1px solid var(--border); padding-left: 5px; margin: 3px 0; }
.cond-log-group.nested { margin-left: 5px; }
.cond-log-group-head { font-size: 11px; font-weight: 400; margin-bottom: 1px; }
.cond-log-line { padding: 2px 0 2px 5px; font-size: 11px; line-height: 1.3; font-weight: 400; overflow-wrap: anywhere; }
.cond-log-line + .cond-log-line { border-top: 1px solid color-mix(in srgb, var(--border) 65%, transparent); }
.cond-log-overall { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--border); font-size: 10.5px; font-weight: 400; }
.cond-log-card .ok { color: var(--green); }
.cond-log-card .bad { color: var(--text2); }
.cond-log-state { margin: 0 1px 6px; font-size: 11px; line-height: 1.3; font-weight: 400; }
.cond-log-empty { padding: 14px 6px; text-align: center; font-size: 11px; font-weight: 400; }

.form-group { margin-bottom: 12px; }
.form-group > label { display: block; font-size: 13px; color: var(--text2); margin-bottom: 4px; }
.form-input, .form-select { width: 100%; background: var(--bg-input); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 9px 10px; font-size: 15px; outline: none; font-family: inherit; }
.form-input:focus, .form-select:focus { border-color: var(--accent); }
.form-input:disabled, .form-select:disabled { opacity: .35; color: var(--dim); cursor: not-allowed; }
.form-input::placeholder { color: var(--dim); }
.hint { font-size: 12px; color: var(--dim); margin-top: 4px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.date-picker-input { cursor: pointer; text-align: center; }
.date-calendar { user-select: none; }
.date-calendar-head { display: grid; grid-template-columns: 42px 1fr 42px; align-items: center; gap: 6px; margin-bottom: 8px; }
.date-calendar-head b { text-align: center; font-size: 16px; }
.date-calendar-head button, .date-calendar-day { border: 0; background: transparent; color: var(--text); font: inherit; cursor: pointer; }
.date-calendar-head button { height: 36px; border-radius: 9px; background: var(--bg-input); font-size: 24px; }
.date-calendar-week, .date-calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.date-calendar-week { margin-bottom: 4px; }
.date-calendar-week span { color: var(--text2); font-size: 11px; text-align: center; padding: 4px 0; }
.date-calendar-week span:nth-last-child(-n+2) { color: var(--red); }
.date-calendar-day { min-height: 38px; border-radius: 9px; }
.date-calendar-day.outside { color: var(--dim); opacity: .5; }
.date-calendar-day.today { box-shadow: inset 0 0 0 1px var(--accent); }
.date-calendar-day.selected { background: var(--accent); color: #fff; font-weight: 700; }
.date-calendar-today { margin-top: 10px; }

.calc-results { font-size: 11px; }
.calc-card { margin: 5px 0; padding: 6px 8px; border-radius: 8px; }
.calc-card .card-title { font-size: 12px; line-height: 1.2; margin-bottom: 2px; }
.calc-card .row { padding: 2px 0; min-height: 0; gap: 6px; font-size: 11px; line-height: 1.15; }
.calc-card .row .lbl, .calc-card .lbl { font-size: 11px; line-height: 1.15; }

/* VirtTrade: dense dashboard intended for dozens or hundreds of strategies. */
.virt-seg button { padding: 4px 3px; font-size: 11px; }
.paper-list { margin-top: 7px; }
.paper-account-chips { margin-top: 6px; }
.paper-card, .paper-bot-card { padding: 6px 9px; margin-bottom: 5px; border-radius: 8px; }
.paper-card .card-title, .paper-bot-card .card-title { font-size: 12px; line-height: 1.15; }
.paper-card .card-sub, .paper-bot-card .card-sub { font-size: 10px; line-height: 1.15; margin-top: 1px; }
.paper-card .badge, .paper-bot-card .badge { font-size: 9px; padding: 2px 5px; }
.paper-bot-card .card-head { gap: 5px; }
.paper-bot-card .btn { padding: 3px 7px; min-height: 0; font-size: 10px; }
.paper-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; margin-top: 4px; }
.paper-grid > span { display: flex; justify-content: space-between; gap: 5px; min-width: 0; font-size: 10px; line-height: 1.2; }
.paper-grid i { color: var(--text2); font-style: normal; white-space: nowrap; }
.paper-grid b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.paper-strategy-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 5px 2px; font-size: 10px; color: var(--text2); }
.paper-strategy-toolbar select { width: auto; min-width: 54px; padding: 3px 20px 3px 6px; font-size: 10px; }
.paper-strategy-toolbar .dim { margin-left: auto; }
.paper-strategy-scroll { width: 100%; height: clamp(320px, 58dvh, 620px); overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding-bottom: 3px; }
.paper-strategy-table-head { position: sticky; top: 0; z-index: 3; display: grid; grid-template-columns: 76px 920px; gap: 4px; width: max-content; min-width: 100%; background: var(--bg); color: #9699a3; font-size: 9px; line-height: 1.1; }
[data-theme="light"] .paper-strategy-table-head { color: #5f636d; }
.paper-strategy-table-head > div, .paper-strategy-row { display: grid; grid-template-columns: 190px 60px 100px 115px 110px 90px 90px 65px 100px; align-items: center; }
.paper-strategy-table-head > div, .paper-strategy-items { touch-action: none; user-select: none; -webkit-user-select: none; }
.paper-strategy-head-help { min-width: 0; padding: 4px 6px; border: 0; background: transparent; color: inherit; font: inherit; line-height: inherit; text-align: left; white-space: nowrap; cursor: help; }
.paper-strategy-table-head > .paper-strategy-head-help { padding-left: 2px; }
.paper-strategy-table-head > div > .paper-strategy-head-help:not(:first-child) { text-align: center; }
.paper-strategy-head-help small { margin-left: 2px; color: var(--accent); font-size: 8px; }
.paper-stat-help { color: var(--text); font-size: 13px; line-height: 1.45; }
.paper-stat-tip { max-width: min(380px, calc(100vw - 16px)); line-height: 1.35; }
.paper-stat-tip strong { display: block; margin-bottom: 4px; color: #c8c8ce; font-size: 12px; }
.paper-stat-tip div { color: var(--text2); font-size: 11px; }
.paper-strategy-group { display: grid; grid-template-columns: 76px 920px; gap: 4px; align-items: start; width: max-content; min-width: 100%; margin-bottom: 2px; }
.paper-strategy-folder { display: grid; grid-template-columns: 10px 12px minmax(0, 1fr); align-items: start; gap: 1px; width: 100%; min-width: 0; padding: 5px 1px 5px calc(1px + var(--paper-folder-depth, 0) * 5px); border: 0; background: transparent; color: var(--text2); font: inherit; text-align: left; touch-action: none; cursor: pointer; }
.paper-strategy-sign { color: var(--accent); font-size: 12px; font-weight: 700; line-height: 1.15; text-align: center; }
.paper-strategy-folder-icon { font-size: 9px; line-height: 1.15; }
.paper-strategy-folder-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 8px; line-height: 1.15; }
.paper-strategy-folder-count { grid-column: 3; color: var(--dim); font-size: 9px; line-height: 1.1; }
.paper-strategy-items { min-width: 920px; }
.paper-strategy-wrap { border-bottom: 1px solid rgba(255,255,255,.045); }
.paper-strategy-wrap.stripe-0 .paper-strategy-row, .paper-strategy-wrap.stripe-0 .paper-strategy-trades { background: #0d0f12; }
.paper-strategy-wrap.stripe-1 .paper-strategy-row, .paper-strategy-wrap.stripe-1 .paper-strategy-trades { background: #191c21; }
.paper-strategy-row { width: 920px; min-height: 36px; padding: 0; border: 0; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.paper-strategy-row:hover { filter: brightness(1.12); }
.paper-strategy-row > span { min-width: 0; padding: 6px; font-size: 10px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.paper-strategy-row > span:not(:first-child) { text-align: center; }
.paper-strategy-name { display: flex; align-items: center; gap: 5px; }
.paper-strategy-name b { flex: 0 0 10px; color: var(--accent); font-size: 11px; }
.paper-strategy-name i { flex: 1 1 auto; min-width: 0; max-height: 2.3em; overflow: hidden; overflow-wrap: break-word; white-space: normal; font-style: normal; font-size: 9px; line-height: 1.15; font-weight: 600; }
.paper-strategy-name .strategy-name { color: #c8c8ce !important; }
[data-theme="light"] .paper-strategy-name .strategy-name { color: #3f3f46 !important; }
.paper-strategy-meta { flex: 0 0 62px; display: flex; flex-direction: column; align-items: stretch; gap: 1px; min-width: 0; }
.paper-strategy-name em { min-width: 0; padding: 0 2px; color: #f4c95d; font-size: 8px; line-height: 1.05; font-style: normal; font-weight: 600; text-align: center; white-space: nowrap; }
.paper-strategy-version,.paper-strategy-current { flex: 0 0 auto; padding: 1px 4px; border-radius: 8px; font-size: 8px; line-height: 1.25; font-weight: 600; }
.paper-strategy-version { width: 100%; max-width: 62px; min-height: 14px; padding-top: 0; padding-bottom: 0; border: 1px solid rgba(145,149,158,.18); background: rgba(145,149,158,.08); color: var(--dim); cursor: pointer; }
.paper-strategy-current { background: rgba(67,184,129,.14); color: #75d6a8; }
.paper-strategy-trades { display: none; width: 920px; padding: 4px 6px 7px 22px; box-sizing: border-box; }
.paper-strategy-wrap.open .paper-strategy-trades { display: block; }
.paper-strategy-trade-head, .paper-strategy-trade-row { display: grid; grid-template-columns: 100px 140px 70px 95px 75px 75px 85px 1fr; align-items: center; min-width: 0; }
.paper-strategy-trade-head { color: var(--dim); border-bottom: 1px solid rgba(255,255,255,.08); font-size: 8px; }
.paper-strategy-trade-row { border-bottom: 1px solid rgba(255,255,255,.04); font-size: 9px; }
.paper-strategy-trade-head > .paper-strategy-head-help, .paper-strategy-trade-row > span { min-width: 0; padding: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.paper-strategy-trade-head > .paper-strategy-head-help, .paper-strategy-trade-row > span { text-align: center; }
.paper-strategy-trade-head > .paper-strategy-head-help { font-size: 8px; }
.paper-strategy-trade-empty { padding: 8px 4px; color: var(--dim); font-size: 9px; }
.paper-strategy-branch.closed > .paper-strategy-group > .paper-strategy-items,
.paper-strategy-branch.closed > .paper-strategy-children { display: none; }
.paper-position-actions { margin-top: 5px; gap: 5px; }
.paper-position-actions .btn { min-height: 0; padding: 3px 7px; font-size: 10px; }
.strategy-card-title { display: flex; align-items: baseline; gap: 5px; min-width: 0; }
.strategy-card-title .strategy-name { min-width: 0; }
.strategy-card-version { flex: 0 0 auto; color: var(--text2); font-size: 9px; line-height: 1; font-weight: 500; }
.calc-card .dim { font-size: 10px; }
.calc-card-section { margin-top: 5px; }
.calc-results > .hint { font-size: 10px; line-height: 1.25; margin-top: 3px; }

.seg { display: flex; background: var(--bg-input); border-radius: var(--radius-sm); padding: 2px; }
.seg button { flex: 1; border: 0; background: none; color: var(--text2); padding: 7px 4px; border-radius: 6px; font-size: 14px; }
.seg button.on { background: var(--accent); color: #fff; }
.seg.virt-seg { padding: 1px; border-radius: 6px; }
.seg.virt-seg button { min-height: 0; height: 24px; padding: 2px 3px; border-radius: 5px; font-size: 10px; line-height: 1.05; }
.indicator-main-tabs button { flex: 0 0 auto; min-width: 52px; padding: 3px 9px; font-size: 12px; line-height: 1.15; white-space: nowrap; }
.cycle-preview-seg button { flex: 0 0 auto; min-width: 48px; padding: 3px 7px; font-size: 11px; line-height: 1.15; white-space: nowrap; }
.stake-modes, .stake-mode-wrap .seg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stake-modes button, .stake-mode-wrap .seg button { min-width: 0; padding: 6px 2px; font-size: 10.5px; white-space: nowrap; }

.toggle { position: relative; display: inline-block; width: 44px; height: 26px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle span { position: absolute; inset: 0; background: var(--border); border-radius: 26px; transition: .2s; }
.toggle span::before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.toggle input:checked + span { background: var(--green); }
.toggle input:checked + span::before { transform: translateX(18px); }

.badge { display: inline-block; font-size: 11px; padding: 2px 7px; border-radius: 10px; font-weight: 600; }
.badge-green { background: rgba(52,199,89,.15); color: var(--green); }
.badge-red { background: rgba(255,69,58,.15); color: var(--red); }
.badge-orange { background: rgba(255,159,10,.15); color: var(--orange); }
.badge-gray { background: var(--bg-input); color: var(--text2); }

.ladder { width: 100%; border-collapse: collapse; font-size: 14px; }
.ladder th { text-align: left; color: var(--text2); font-weight: 400; font-size: 12px; padding: 4px; }
.ladder td { padding: 3px 4px; }
.ladder .del { background: none; border: 0; color: var(--red); font-size: 18px; }
.sum { font-size: 12px; margin-top: 4px; }
.sum.bad { color: var(--red); } .sum.ok { color: var(--green); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--border); border-radius: 14px; padding: 5px 11px; font-size: 13px; background: none; color: var(--text2); }
.chip.on { border-color: var(--accent); color: var(--text); background: rgba(94,94,255,.15); }

.empty { text-align: center; color: var(--text2); padding: 30px 10px; }
.error-text { color: var(--red); font-size: 13px; margin-top: 6px; white-space: pre-wrap; }
.ok-text { color: var(--green); font-size: 13px; margin-top: 6px; }

#loading { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 80vh; color: var(--text2); gap: 12px; }
.spinner { width: 32px; height: 32px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 20; display: flex; align-items: flex-end; }
.modal { background: var(--bg); width: 100%; max-height: 92vh; overflow-y: auto; border-radius: 16px 16px 0 0; padding: 16px 14px 24px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.modal-header h2 { font-size: 18px; }
.modal-close { background: none; border: 0; color: var(--text2); font-size: 24px; }
.modal-footer { display: flex; gap: 8px; margin-top: 14px; }
.modal-footer .btn { flex: 1; }
.indicator-preview-modal { align-items: flex-start; }
.indicator-preview-modal .modal { border-radius: 0 0 16px 16px; padding-top: 12px; }

#toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: var(--bg-card); border: 1px solid var(--border);
  padding: 9px 16px; border-radius: 20px; font-size: 14px; z-index: 30; display: none; max-width: 90vw; }

.opt-controls { padding: 7px 9px; }
.opt-controls .form-group { margin-bottom: 7px; }
.opt-controls .form-group:last-child { margin-bottom: 0; }
.opt-controls .form-group > label { font-size: 10px; margin-bottom: 2px; }
.opt-controls .seg button { padding: 4px 3px; font-size: 11px; }
.opt-controls .form-select { padding: 5px 7px; font-size: 11px; }
.opt-prof-picker { position: relative; }
.opt-prof-picker summary { list-style: none; width: 100%; padding: 5px 7px; border: 1px solid var(--border); border-radius: 7px;
  background: var(--bg-input); color: var(--text); font-size: 11px; line-height: 1.2; cursor: pointer; }
.opt-prof-picker summary::-webkit-details-marker { display: none; }
.opt-prof-picker summary::after { content: "▾"; float: right; color: var(--text2); }
.opt-prof-picker[open] summary::after { content: "▴"; }
.opt-prof-menu { display: flex; flex-direction: column; gap: 2px; margin-top: 3px; padding: 3px; border: 1px solid var(--border);
  border-radius: 7px; background: var(--bg-input); }
.opt-prof-menu button { border: 0; border-radius: 5px; background: transparent; color: var(--text2); padding: 5px 6px;
  font: inherit; font-size: 11px; line-height: 1.2; text-align: left; cursor: pointer; }
.opt-prof-menu button.on { color: var(--text); background: rgba(94,94,255,.18); }
.opt-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-variant-numeric: tabular-nums; font-size: 14px; }
.opt-table th { font-size: 11px; color: var(--text2); font-weight: 500; text-align: right; padding: 4px 6px; border-bottom: 1px solid var(--border); }
.opt-table td { text-align: right; padding: 6px; border-bottom: 1px solid var(--border); }
.opt-table td.bid { color: var(--green); }
.opt-table td.ask { color: var(--red); }
.opt-table td.strike { font-weight: 600; }
.opt-table tr.itm td { background: rgba(94,94,255,.08); }
.opt-table tr.atm td.strike { color: var(--accent); }
.opt-table tr.opt-spot td { text-align: center; font-size: 12px; color: var(--orange); font-weight: 600; padding: 3px; border-bottom: 1px dashed var(--orange); }
.opt-table tr.center td { border-top: 2px solid var(--accent); border-bottom: 2px solid var(--accent); }
.opt-table tr[data-strike] { cursor: pointer; }
.opt-table tr[data-strike]:active td { background: rgba(94,94,255,.2); }
.warn { background: rgba(255,159,10,.15); color: var(--orange); border-radius: var(--radius-sm); padding: 8px 10px; font-size: 13px; margin-bottom: 10px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; text-align: center; margin-bottom: 8px; font-variant-numeric: tabular-nums; }
.grid3 .lbl { font-size: 11px; color: var(--text2); }
.grid3 .bid { color: var(--green); font-weight: 600; } .grid3 .ask { color: var(--red); font-weight: 600; }
.dim { color: var(--dim); font-size: 13px; }
.pencil { background: none; border: 0; font-size: 13px; padding: 0 2px; cursor: pointer; opacity: .7; vertical-align: 1px; }

.sub-card { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; margin: 8px 0; }

.pos { color: var(--green); } .neg { color: var(--red); }
.option-entry-state { font-size: 13px; font-weight: 400; }
.option-entry-filled { color: var(--green); }
.option-entry-pending { color: var(--dim); }
.option-entry-cancelled { color: var(--red); }
.chart { width: 100%; height: 140px; display: block; }
.chart rect { cursor: pointer; }
.chart-x { display: flex; justify-content: space-between; font-size: 11px; color: var(--dim); margin-top: 4px; }
.pnl-chart-wrap { position: relative; padding-left: 62px; }
.pnl-y-axis { position: absolute; inset: 0 auto 0 0; width: 58px; font-size: 10px; color: var(--dim); }
.pnl-y-axis span { position: absolute; right: 4px; transform: translateY(-50%); white-space: nowrap; font-variant-numeric: tabular-nums; }

.btn.btn-outline.active { background: var(--accent, #5b5bf0); color: #fff; border-color: transparent; }

.row .lbl { flex: 1; }
.apply-btn { padding: 7px 12px; min-width: 40px; }

.card.tap { cursor: pointer; }
.card.tap:active { opacity: .85; }
.pnl-card-img { width: 100%; border-radius: 16px; display: block; -webkit-touch-callout: default; user-select: auto; }

/* ── 📡 Аналитика (optan.js) ── */
#topBar .theme-btn.on { border-color: var(--accent); background: rgba(94,94,255,.15); }
#optanBtn { font-size: 13px; white-space: nowrap; }
.oan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.oan-tile { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; min-width: 0; }
.oan-lbl { font-size: 11px; color: var(--text2); text-transform: uppercase; letter-spacing: .03em; }
.oan-val { font-size: 16px; font-weight: 600; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oan-sub { font-size: 11px; color: var(--dim); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oan-read p { font-size: 13px; line-height: 1.45; margin-top: 6px; }
.oan-read p:first-child { margin-top: 4px; }
/* 🌊 Поток */
.badge-blue { background: rgba(94,94,255,.15); color: var(--accent); }
.fl-row { display: grid; grid-template-columns: 118px 1fr 70px; align-items: center; gap: 8px; font-size: 13px; margin-top: 8px; }
.fl-row b { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.fl-bar { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.fl-bar i { display: block; height: 100%; border-radius: 4px; }
.fl-print { padding: 7px 0; border-bottom: 1px solid var(--border); }
.fl-print:last-child { border-bottom: 0; }
.fl-p1, .fl-p2 { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.fl-p1 { font-size: 13px; font-variant-numeric: tabular-nums; }
.fl-p2 { font-size: 11px; color: var(--text2); margin-top: 2px; }
.fl-p2 .badge { margin-left: 3px; font-size: 10px; padding: 1px 5px; }
.pr-ctl { display: flex; gap: 6px; justify-content: center; margin-top: 8px; }
.pr-ctl button { background: var(--bg-card); border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 5px 11px; font-size: 14px; }
.pr-ctl button:active { background: rgba(94,94,255,.2); }
.pr-ctl button:disabled { opacity: .35; }
.mp-leg { display: flex; flex-wrap: wrap; gap: 10px; font-size: 11px; color: var(--text2); margin-top: 6px; }
.mp-leg i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }

/* Статистика: компактные карточки позиций и сделок */
.st-card { padding: 6px 8px; margin-bottom: 5px; border-radius: 8px; }
.st-card .card-title { font-size: 12px; line-height: 1.2; }
.st-card .card-sub { font-size: 10px; line-height: 1.2; }
.st-card .row { padding: 2px 0; font-size: 11px; line-height: 1.2; }
.st-card .row .lbl { font-size: 10.5px; }
.st-card .card-head > div:last-child { font-size: 11px; }
.st-card .dim { font-size: 10px; }
.st-card .option-entry-state { font-size: 10px; }
.st-card .badge { font-size: 9px; padding: 1px 5px; }
.st-card .card-actions { margin-top: 5px; gap: 5px; }
.st-card .card-actions .btn { padding: 4px 8px; font-size: 11px; }

/* Manual: dense list for many strategies and assets. */
.manual-compact .section-title { margin: 9px 3px 5px; font-size: 11px; }
.manual-compact .card { padding: 6px 8px; margin-bottom: 5px; border-radius: 8px; }
.manual-compact .card-title { font-size: 12px; line-height: 1.2; }
.manual-compact .card-sub { font-size: 10px; line-height: 1.2; }
.manual-compact .form-select { padding: 5px 7px; font-size: 11px; }
.manual-compact .row { padding: 2px 0; gap: 5px; font-size: 11px; line-height: 1.2; }
.manual-compact .row .lbl { font-size: 10.5px; }
.manual-compact .card-actions { margin-top: 5px; gap: 5px; }
.manual-compact .btn { padding: 4px 8px; font-size: 11px; }
.manual-compact [data-mrow] > div:first-child { font-size: 14px !important; line-height: 14px !important; }
.manual-top-controls { display: grid; gap: 3px; margin: 2px 0 5px; }
.manual-top-controls .seg { padding: 1px; border-radius: 6px; }
.manual-top-controls .seg button { min-height: 0; height: 25px; padding: 2px 3px; border-radius: 5px; font-size: 10px; line-height: 1; }
.manual-strategy-card { padding: 5px 7px !important; }
.manual-strategy-card .form-select { min-height: 27px; padding: 3px 6px; }
.manual-strategy-card .card-actions { margin-top: 3px; }
.manual-account-filter { margin: 5px 0 2px; padding: 4px 6px; border: 1px solid var(--border); border-radius: 7px; background: var(--bg-card); }
.manual-account-filter .sts-acc-all { margin-bottom: 2px; }
.manual-account-filter .sts-acc-group { margin-top: 2px; }

/* ── Подключения: compact cards + folder tree (v47) ── */
.acc-card { padding: 9px 12px; margin-bottom: 8px; }
.acc-card .card-title { font-size: 14px; line-height: 1.3; }
.acc-card .card-sub { font-size: 12px; margin-top: 2px; }
.acc-card .badge { font-size: 9.5px; padding: 1px 5px; }
.acc-card .row { padding: 5px 0; }
.acc-card .row .lbl, .acc-card .row > span { font-size: 13px; }
.acc-card .seg { padding: 1px; }
.acc-card .seg button { padding: 3px 4px; font-size: 12px; }
.acc-card .toggle { width: 36px; height: 21px; }
.acc-card .toggle span::before { width: 15px; height: 15px; }
.acc-card .toggle input:checked + span::before { transform: translateX(15px); }
.acc-card .pencil { font-size: 11px; }
.acc-head-l { display: flex; align-items: center; gap: 6px; min-width: 0; }
.acc-head-r { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.icon-btn { background: none; border: 0; font-size: 14px; padding: 2px 4px; cursor: pointer; opacity: .75; color: var(--text); }
.drag-h { cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; color: var(--text2); font-size: 16px; padding: 4px 2px; line-height: 1; }
.fold { margin-bottom: 6px; }
.fold-head { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: var(--radius-sm); background: var(--bg-input); cursor: pointer; user-select: none; -webkit-user-select: none; }
.fold-caret { width: 12px; color: var(--text2); font-size: 12px; }
.fold-name { font-weight: 600; font-size: 13px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fold-cnt { font-size: 11px; color: var(--text2); background: var(--bg-card); border-radius: 10px; padding: 1px 7px; }
.fold-mode-counts { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.fold-mode-count { display: inline-flex; align-items: center; overflow: hidden; border-radius: 8px; background: var(--bg-card); font-size: 10px; line-height: 16px; color: var(--text2); }
.fold-mode-count b { padding: 0 5px; background: rgba(255,69,58,.17); color: var(--red); font-size: 8px; font-weight: 700; letter-spacing: .3px; }
.fold-mode-count.virt b { background: rgba(100,210,255,.16); color: #64d2ff; }
.fold-mode-count span { padding: 0 5px 0 4px; font-variant-numeric: tabular-nums; }
.fold-acts { display: flex; }
.fold-acts .icon-btn { font-size: 12px; padding: 2px 3px; }
.fold-body { margin: 6px 0 0 8px; padding-left: 8px; border-left: 2px solid var(--border); }
.fold.closed > .fold-body { display: none; }
.fold-drop-slot { height: 0; margin: 0; border-radius: 5px; transition: height .12s, margin .12s, background .12s; }
.folder-drag-active .fold-drop-slot { height: 12px; margin: -3px 0; }
.fold-drop-slot.drop-on { outline: 0; background: var(--accent) !important; box-shadow: 0 0 0 2px rgba(10,132,255,.22); }
.fold-empty { font-size: 12px; color: var(--text2); padding: 6px 4px; }
.fold-root { font-size: 12px; color: var(--text2); text-align: center; border: 1px dashed var(--border); border-radius: var(--radius-sm); padding: 6px; margin-bottom: 8px; display: none; }
.fold-root.show { display: block; }
.drop-on { outline: 2px solid var(--accent); outline-offset: 1px; background: rgba(10,132,255,.15) !important; }
.dragging { opacity: .4; }
.drag-ghost { position: fixed; z-index: 9999; pointer-events: none; background: var(--accent); color: #fff; font-size: 13px; padding: 5px 10px; border-radius: 8px; box-shadow: 0 4px 14px rgba(0,0,0,.35); white-space: nowrap; }
.fold-pick .fold-opt { text-align: left; margin-bottom: 6px; }
.fold-pick .fold-opt.on { border-color: var(--accent); color: var(--accent); }
.fold-root.show { position: fixed; top: 8px; left: 12px; right: 12px; z-index: 9000; background: var(--bg-card); padding: 12px; font-size: 13px; }
#newFold, #balRefresh { white-space: nowrap; }
.user-card { padding: 9px 12px; margin-bottom: 8px; }
.user-card .card-title { font-size: 14px; }
.user-card .card-sub { font-size: 11px; margin-top: 2px; }
.check-row { display: flex; align-items: center; gap: 9px; color: var(--text); cursor: pointer; }
.check-row input { width: 18px; height: 18px; accent-color: var(--accent); }
.indicator-grants { border: 1px solid var(--border); border-radius: 10px; padding: 0; overflow: hidden; }
.indicator-grants > summary { list-style: none; padding: 10px 12px; user-select: none; }
.indicator-grants > summary::-webkit-details-marker { display: none; }
.indicator-grants > summary::after { content: "▸"; margin-left: auto; color: var(--muted); }
.indicator-grants[open] > summary::after { content: "▾"; }
.indicator-grants > .chips { padding: 0 10px 8px; }
.indicator-grants > .hint { padding: 0 10px 10px; }
.indicator-grant-groups { padding: 0 10px 8px; }
.indicator-grant-group { border-top: 1px solid var(--border); }
.indicator-grant-group > summary { list-style: none; padding: 8px 2px; font-size: 12px; color: var(--text2); cursor: pointer; }
.indicator-grant-group > summary::-webkit-details-marker { display: none; }
.indicator-grant-group > summary::before { content: "▸"; display: inline-block; width: 15px; }
.indicator-grant-group[open] > summary::before { content: "▾"; }
.indicator-grant-group > .chips { padding: 0 0 7px 15px; }
.indicator-source-picker { position: relative; flex: 1; min-width: 0; }
.indicator-source-picker > summary { list-style: none; padding: 5px 24px 5px 7px; border: 1px solid var(--border); border-radius: 7px; background: var(--bg-input); font-size: 12px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.indicator-source-picker > summary::-webkit-details-marker { display: none; }
.indicator-source-picker > summary::after { content: "▾"; position: absolute; right: 8px; color: var(--text2); }
.indicator-source-menu { display: flex; flex-direction: column; gap: 5px; margin-top: 4px; padding: 5px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-card); }
.indicator-source-group { border: 1px solid var(--border); border-radius: 7px; overflow: hidden; background: var(--bg-input); }
.indicator-source-group > summary { list-style: none; padding: 7px 8px; color: var(--text); font-size: 11px; font-weight: 600; cursor: pointer; }
.indicator-source-group > summary::-webkit-details-marker { display: none; }
.indicator-source-group > summary::before { content: "▸"; display: inline-block; width: 14px; }
.indicator-source-group[open] > summary::before { content: "▾"; }
.indicator-source-group > div { display: flex; flex-direction: column; padding: 1px 7px 6px 22px; border-top: 1px solid var(--border); }
.indicator-source-group button { border: 0; border-bottom: 1px solid rgba(128,128,128,.12); border-radius: 0; padding: 6px 5px; background: transparent; color: var(--text); font-size: 10px; text-align: left; }
.indicator-source-group button:last-child { border-bottom: 0; }
.indicator-source-group button.on { color: var(--accent); background: rgba(10,132,255,.08); }
.indicator-filter-tabs { width: fit-content; margin: 7px 0 4px; }

/* v114: collapsible settings sections + scoped Long/Short strategy tree */
.settings-sec { margin-bottom: 12px; }
.settings-head { display: flex; align-items: center; gap: 7px; padding: 10px 12px; margin-bottom: 8px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); font-weight: 600; cursor: pointer; user-select: none; }
.settings-caret { width: 13px; color: var(--text2); }
.settings-sec.closed > .settings-body { display: none; }
.ban-tree { max-height: 52vh; overflow: auto; padding: 2px 0; }
.ban-folder { margin: 4px 0; }
.ban-folder-head { padding: 7px 8px; background: var(--bg-input); border-radius: var(--radius-sm); font-weight: 600; }
.ban-collapse { width: 18px; padding: 0; border: 0; background: transparent; color: var(--text2); cursor: pointer; font-size: 13px; }
.ban-folder-body { margin: 4px 0 3px 10px; padding-left: 10px; border-left: 2px solid var(--border); }
.ban-folder.closed > .ban-folder-body { display: none; }
.ban-prof { padding: 7px 4px; min-width: 0; }
.ban-prof > span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* account links badge / tooltip */
.link-badge { display: inline-flex; align-items: center; gap: 1px; }
.link-badge b { font-size: 10px; font-weight: 600; color: var(--text2); }
.link-badge.none { opacity: .35; }
.acc-tip { position: fixed; z-index: 9999; max-width: 320px; min-width: 200px; padding: 8px 10px; border-radius: 10px;
  background: var(--bg-card); color: var(--text); border: 1px solid var(--border); box-shadow: 0 6px 24px rgba(0,0,0,.35); font-size: 12px; pointer-events: none; }
.lk-grp { font-size: 11px; font-weight: 600; opacity: .7; margin: 6px 0 2px; }
.lk-grp:first-child { margin-top: 0; }
.lk-row { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; font-size: 12px; }
.lk-row.off { opacity: .55; }
.lk-name { font-weight: 500; }
.lk-det { opacity: .75; text-align: right; white-space: nowrap; }

/* strategy template picker */
.tpl-list { display: flex; flex-direction: column; gap: 6px; }
.tpl-item { text-align: left; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 9px 11px; color: var(--text); cursor: pointer; }
.tpl-item:active { border-color: var(--accent); }
.tpl-title { font-size: 14px; font-weight: 600; }
.tpl-desc { font-size: 12px; color: var(--text2); margin-top: 2px; }

/* strategy manual */
.prof-tip { max-width: 400px; max-height: 75vh; overflow: hidden; }
.has-strategy-description { cursor: help; }
.prof-description-tip { max-width: min(420px, calc(100vw - 16px)); font-style: italic; }
.prof-description-name { margin-bottom: 4px; color: var(--text); font-size: 12px; font-weight: 600; }
.prof-description-text { color: var(--text2); line-height: 1.4; overflow-wrap: anywhere; white-space: pre-wrap; }
.pm-head { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.pm-ul { margin: 0 0 4px; padding-left: 16px; }
.pm-ul li { font-size: 12px; line-height: 1.35; margin: 1px 0; }
.pm-body .pm-ul li { font-size: 13px; }

/* compact strategy cards */
.prof-card { padding: 8px 11px; margin-bottom: 8px; }
.prof-card .card-title { font-size: 14px; line-height: 1.25; }
.prof-card .card-sub { font-size: 11px; margin-top: 1px; }
.prof-card .badge { font-size: 9px; padding: 1px 5px; }
.prof-card .row { padding: 2px 0; min-height: 0; gap: 8px; }
.prof-card .row .lbl, .prof-card .row > span { font-size: 11.5px; line-height: 1.3; }
.prof-card .card-actions { margin-top: 5px; gap: 6px; }
.prof-card .card-actions .btn { padding: 4px 10px; font-size: 12px; min-height: 0; }
.prof-card .toggle { width: 36px; height: 21px; }
.prof-card .toggle span::before { width: 15px; height: 15px; }
.prof-card .toggle input:checked + span::before { transform: translateX(15px); }
.prof-card .icon-btn { font-size: 13px; }
.prof-card .row { font-size: 11.5px; } .prof-card .row span, .prof-card .row div { font-size: inherit; }
.prof-card .acc-head-r { align-items: flex-start; gap: 5px; }
.prof-actions { display: flex; align-items: center; padding-top: 1px; }
.prof-modes { display: flex; flex-direction: column; gap: 3px; }
.prof-mode-row { display: flex; align-items: center; justify-content: flex-end; gap: 5px; cursor: pointer; }
.prof-mode-name { min-width: 38px; color: var(--dim); font-size: 9px; font-weight: 700; line-height: 1; text-align: right; text-transform: uppercase; transition: color .2s; }
.prof-mode-name.on { color: var(--red); }

/* Constructor: many blocks must remain readable without turning the editor into a long page. */
.chain-prof-card { padding: 6px 8px; margin-bottom: 5px; }
.chain-prof-card > div[style*="margin-top"] { margin-top: 3px !important; }
.chain-prof-card .row { padding: 1px 0; }
.chain-prof-card .card-actions { margin-top: 3px; }
.chain-prof-card .card-sub { font-size: 10px; }
.chain-compact .modal { max-height: 96vh; padding: 8px 9px 12px; }
.chain-compact .modal-header { margin-bottom: 5px; }
.chain-compact .modal-header h2 { font-size: 14px; }
.chain-compact .modal-close { font-size: 20px; line-height: 1; padding: 2px 5px; }
.chain-compact .modal-footer { margin-top: 6px; gap: 5px; }
.chain-compact .modal-footer .btn { padding: 6px 9px; font-size: 12px; }
.chain-compact .section-title { margin: 8px 2px 4px; font-size: 10px; }
.chain-compact .card { padding: 6px 7px; margin: 4px 0; border-radius: 8px; }
.chain-compact .card-head { gap: 4px; }
.chain-compact .card-title { font-size: 12px; line-height: 1.15; }
.chain-compact .card-sub { font-size: 10px; line-height: 1.15; margin-top: 1px; }
.chain-compact .form-group { margin-bottom: 5px; }
.chain-compact .form-group > label, .chain-compact .lbl { font-size: 10px; margin-bottom: 2px; }
.chain-compact .form-input, .chain-compact .form-select { padding: 5px 6px; font-size: 12px; }
.chain-compact .grid2 { gap: 5px; }
.chain-compact .hint { margin-top: 2px; font-size: 9.5px; line-height: 1.2; }
.chain-compact .row { padding: 3px 0; gap: 4px; }
.chain-compact .seg button { padding: 4px 3px; font-size: 11px; }
.chain-compact .btn { padding: 6px 9px; font-size: 11px; }
.chain-compact .btn-sm { padding: 3px 7px; font-size: 10px; }
.chain-compact .icon-btn { font-size: 12px; padding: 2px; }
.chain-compact .ladder { font-size: 11px; }
.chain-compact .ladder th { padding: 2px 3px; font-size: 9px; }
.chain-compact .ladder td { padding: 2px 3px; }
.chain-compact .sum { font-size: 9px; margin-top: 1px; }

/* «Лимитно» checkbox + ⓘ tip */
.lim-i { background: none; border: 0; color: var(--tg-theme-link-color, #5aa9ff); font-size: 13px; padding: 0 4px; cursor: pointer; }
.optord-i { background: none; border: 0; color: var(--tg-theme-link-color, #5aa9ff); font-size: 13px; padding: 2px 5px; cursor: pointer; }
.lim-tip { margin: -2px 0 8px; line-height: 1.35; }
.lim-tip b { font-weight: 600; }
.lim-tip[hidden] { display: none; }
.field-help-tip { max-width: min(420px, calc(100vw - 16px)); color: var(--text2); font-style: italic; line-height: 1.4; overflow-wrap: anywhere; }
.field-help-tip b { color: var(--text); font-weight: 600; }

/* copytrade inside a strategy card */
.ct-block { margin-top: 5px; border-top: 1px solid var(--border, rgba(127,127,127,.2)); padding-top: 3px; }
.ct-mode { margin: 0; border-bottom: 1px solid var(--border, rgba(127,127,127,.16)); }
.ct-mode summary, .ct-mode-static { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 2px; font-size: 11px; color: var(--text); cursor: pointer; list-style: none; }
.ct-mode summary::-webkit-details-marker { display: none; }
.ct-mode summary::before { content: "›"; width: 8px; color: var(--text2); transition: transform .15s ease; }
.ct-mode[open] summary::before { transform: rotate(90deg); }
.ct-mode-status { margin-left: auto; color: var(--text2); font-size: 10px; font-weight: 400; white-space: nowrap; }
.ct-mode-body { padding: 0 2px 5px 10px; }
.ct-mode-hint { margin: 0; font-size: 10px; line-height: 1.25; }
.ct-add-btn { width: auto; padding: 3px 7px; margin-top: 3px; font-size: 10px; }
.ct-mode-static { cursor: default; padding-left: 12px; }
.ct-block .sub-card { padding: 5px 6px; margin: 3px 0; border-radius: 7px; }
.ct-block .card-head { gap: 5px; }
.ct-block .card-title { font-size: 12px; line-height: 1.15; font-weight: 500; }
.ct-block .card-sub { margin-top: 1px; font-size: 10px; line-height: 1.15; }
.ct-block .row { min-height: 0; padding: 3px 0; gap: 5px; font-size: 11px; line-height: 1.2; }
.ct-block .row .lbl { font-size: 11px; line-height: 1.2; }
.ct-block .row .form-input, .ct-block .row .form-select { padding: 3px 5px; border-radius: 6px; font-size: 11px; line-height: 1.15; }
.ct-block .seg { margin: 4px 0 !important; padding: 1px; border-radius: 6px; }
.ct-block .seg button { min-height: 0; padding: 4px 2px; border-radius: 5px; font-size: 10px; line-height: 1.15; }
.ct-block .toggle { width: 32px; height: 18px; }
.ct-block .toggle span { border-radius: 18px; }
.ct-block .toggle span::before { width: 14px; height: 14px; left: 2px; top: 2px; }
.ct-block .toggle input:checked + span::before { transform: translateX(14px); }
.ct-block .card-actions { gap: 4px; margin-top: 5px; }
.ct-block .card-actions .btn { padding: 3px 7px; font-size: 10px; }
.ct-hist summary { cursor: pointer; }
/* ── Статистика: пакеты УП/МНЧ в папках (v63) ── */
.bfold .fold-head { flex-wrap: nowrap; }
.bfold .fold-name { white-space: normal; line-height: 1.25; }
.bfold-sub { display: block; font-weight: 400; font-size: 11px; color: var(--text2); }
.bfold-pnl { font-weight: 600; font-size: 13px; text-align: right; white-space: nowrap; }
.bfold-pnl .dim { display: block; font-size: 11px; font-weight: 400; }
.compact-pnl { display: inline-block; font-size: 11px; font-weight: 400; line-height: 1.3; text-align: right; white-space: nowrap; }
.compact-pnl-label { color: var(--text2); font-weight: 400; }
.bfold-acts { display: flex; justify-content: flex-end; margin-bottom: 6px; }
.bfold > .fold-head.with-package-actions { border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.bfold-package-acts {
  justify-content: flex-start;
  gap: 5px;
  margin: 0 0 6px;
  padding: 6px 8px;
  background: var(--bg-input);
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}
.bfold-package-acts .btn { padding: 4px 8px; font-size: 11px; min-height: 0; }
/* ── Статистика: компактные переключатели и чипы аккаунтов (v66) ── */
.sts-top .seg button { padding: 2px 4px; font-size: 11.5px; line-height: 1.3; }
.sts-chips { gap: 4px; }
.sts-chips .chip { padding: 1px 7px; font-size: 11px; line-height: 1.3; border-radius: 10px; }
.sts-acc-all { margin-bottom: 5px; }
.sts-acc-group { margin-top: 4px; }
.sts-acc-head { display: flex; align-items: center; gap: 4px; min-height: 20px; }
.sts-acc-caret, .sts-acc-name { border: 0; background: transparent; color: var(--text2); padding: 1px 2px; font: inherit; }
.sts-acc-caret { width: 16px; font-size: 11px; cursor: pointer; }
.sts-acc-name { color: var(--text); font-size: 11px; font-weight: 600; cursor: pointer; }
.sts-acc-name:active { color: var(--accent); }
.sts-acc-count { color: var(--text2); font-size: 10px; }
.sts-acc-body { margin: 2px 0 0 20px; }
.sts-acc-group.closed .sts-acc-body { display: none; }
.sos-btn { background: #c62828 !important; color: #fff !important; border-color: #c62828 !important; }
.prof-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ban-row { display: flex; gap: 5px; }
.ban-btn { border: 1px solid var(--border); background: var(--bg-input); color: var(--text2); border-radius: 8px; padding: 3px 8px; font-size: 12px; text-transform: none; letter-spacing: 0; }
.ban-btn.on { background: #c62828; border-color: #c62828; color: #fff; font-weight: 600; }
/* «УП Filters»: шкалы фильтров и окна цикла */
.upf-ind { margin: 8px 0; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--bg-input); }
.upf-ind.off .upf-body { opacity: .35; pointer-events: none; }
.upf-bar { position: relative; height: 14px; border-radius: 6px; margin: 2px 0; touch-action: none; cursor: pointer; }
.upf-cyc { height: 22px; margin-top: 8px; }
.upf-tick { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(0,0,0,.55); }
.upf-dim { position: absolute; top: 0; bottom: 0; background: rgba(0,0,0,.62); pointer-events: none; }
.upf-cur { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: #ffe066; pointer-events: none; }
.upf-h { position: absolute; top: -6px; bottom: -6px; width: 6px; margin-left: -3px; background: #fff; border-radius: 3px; box-shadow: 0 0 3px #000; pointer-events: none; }
.upf-win { position: absolute; top: -2px; bottom: -2px; border: 2px solid #fff; border-radius: 4px; box-sizing: border-box; pointer-events: none; }
.upf-wlist { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.upf-wchip b { margin-left: 4px; cursor: pointer; color: var(--text2); }

/* Биржевой каталог пар */
.market-picker { position: relative; }
.market-picker-open { width: 100%; min-height: 38px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 10px; color: var(--text); background: var(--bg-input); border: 1px solid var(--border); border-radius: 8px; font: inherit; text-align: left; cursor: pointer; }
.market-picker-value { min-width: 0; display: flex; flex-wrap: wrap; gap: 4px; overflow: hidden; }
.market-picker-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 5px; border-radius: 5px; background: color-mix(in srgb, var(--accent) 15%, var(--bg-card)); white-space: nowrap; }
.market-picker-chip b { color: var(--text2); font-size: 14px; line-height: 1; cursor: pointer; }
.market-picker-pop { position: relative; z-index: 20; margin-top: 4px; padding: 7px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 9px; box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.market-picker-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; margin-bottom: 6px; padding: 2px; background: var(--bg-input); border-radius: 7px; }
.market-picker-tabs button { padding: 5px; border: 0; border-radius: 5px; color: var(--text2); background: transparent; font-size: 11px; cursor: pointer; }
.market-picker-tabs button.on { color: var(--text); background: var(--bg-card); font-weight: 600; }
.market-picker-tools { display: flex; gap: 5px; }
.market-picker-tools .form-input { min-width: 0; padding: 6px 8px; }
.market-picker-source { min-height: 15px; margin: 4px 1px 0; color: #f2c94c; font-size: 11px; font-weight: 600; }
.market-picker-status { min-height: 16px; margin: 4px 1px 2px; }
.market-picker-list { max-height: 220px; overflow-y: auto; overscroll-behavior: contain; }
.market-picker-item { width: 100%; display: grid; grid-template-columns: 70px 1fr 18px; gap: 7px; align-items: center; padding: 6px 7px; border: 0; border-top: 1px solid var(--border); color: var(--text); background: transparent; font-size: 11px; text-align: left; cursor: pointer; }
.market-picker-item span { color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.market-picker-item.on { color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.market-picker-item:disabled { opacity: .55; cursor: default; }
.market-picker-inline-field { position: relative; }
.market-picker-inline-input { padding-right: 34px; font-weight: 700; text-transform: uppercase; }
.market-picker-inline-toggle { position: absolute; top: 1px; right: 1px; bottom: 1px; width: 32px; border: 0; border-radius: 0 7px 7px 0; color: var(--text2); background: var(--bg-input); cursor: pointer; }
.market-picker-inline .market-picker-pop { margin-top: 2px; padding-top: 4px; }
.market-picker-inline-meta { display: flex; align-items: center; justify-content: space-between; min-height: 22px; }
.market-picker-inline-meta .market-picker-source { flex: 1; }
.market-picker-inline-meta .market-picker-refresh { min-width: 28px; height: 24px; }

/* v94: strategies tab folder tree */
.prof-tools { display: flex; justify-content: flex-end; margin: 0 0 8px; }

/* v101: strategy statistical-version preview */
.strategy-version-alert { display:inline-flex; align-items:center; margin-left:4px; color:#ffd65a; font-weight:800; white-space:nowrap; cursor:help; }
.strategy-version-popover { position:fixed; z-index:10020; padding:10px; border:1px solid #6b6040; border-radius:10px; color:var(--text); background:#181a20; box-shadow:0 12px 32px rgba(0,0,0,.52); font-size:11px; text-align:left; }
.strategy-version-popover-title { color:#fff; font-weight:700; }
.strategy-version-popover ul { max-height:180px; overflow:auto; margin:7px 0; padding-left:20px; color:#c7cad1; }
.strategy-version-popover li { margin:3px 0; }
.strategy-version-choice { display:grid; grid-template-columns:1fr 1fr; gap:6px; }
.strategy-version-choice button { padding:7px 5px; border:1px solid var(--border); border-radius:7px; color:#d5d8df; background:var(--surface2); font-size:10px; cursor:pointer; }
.strategy-version-choice button.on { border-color:#ffd65a; color:#fff; background:#3a3320; }
.strategy-version-help { margin-top:7px; color:#9da2ad; font-style:italic; }

/* v99: auto add-on ladder block (options) */
.lfold { border: 1.5px solid var(--accent, #4c8dff); border-radius: 12px; padding: 2px 6px 4px; margin: 8px 0; }
.lfold > .fold-body > .st-card { margin-left: 0; margin-right: 0; }
/* Spot Manual */
.spot-strategy-head { display:flex; align-items:center; gap:8px; padding:8px; }
.spot-strategy-select { flex:1; min-width:0; }
.spot-exchange-logo { width:34px; height:34px; flex:0 0 34px; border-radius:50%; display:grid; place-items:center; font-size:10px; font-weight:800; color:#0b0d12; background:#aeb5c1; box-shadow:0 0 0 1px rgba(255,255,255,.1); }
.spot-exchange-logo.ex-binance { background:#181a20; box-shadow:0 0 14px rgba(243,186,47,.35); }
.spot-exchange-logo.ex-bybit { background:#101421; box-shadow:0 0 14px rgba(247,166,0,.32); }
.spot-exchange-logo.ex-bingx { background:#fff; color:white; box-shadow:0 0 14px rgba(91,140,255,.32); }
.spot-exchange-logo.ex-okx { background:#fff; color:#111; box-shadow:0 0 12px rgba(255,255,255,.22); }
.spot-market-card,.spot-ticket { padding:9px; margin-bottom:7px; }
.spot-pair-row { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:8px; }
.spot-pair-row .market-picker-open { min-height:34px; font-size:15px; font-weight:700; }
.spot-exchange-logo img { width: 28px; height: 28px; display: block; object-fit: contain; border-radius: 5px; }
.spot-exchange-logo.ex-bybit img { width: 32px; height: 32px; }
.spot-price { color:#18b77a; font-size:16px; font-weight:700; white-space:nowrap; }
.spot-quotes { display:grid; grid-template-columns:repeat(3,1fr); gap:5px; margin-top:6px; }
.spot-quotes span { padding:5px; border-radius:7px; background:var(--surface2); text-align:center; color:var(--muted); font-size:9px; }
.spot-quotes b { display:block; color:var(--text); font-size:10px; margin-top:2px; }
.spot-trade-grid { display:grid; grid-template-columns:minmax(0,1.16fr) minmax(0,.84fr); gap:6px; align-items:start; }
.spot-trade-grid .spot-ticket { min-width:0; padding:7px; }
.spot-trade-grid .spot-ticket .seg { gap:3px; }
.spot-trade-grid .spot-ticket .seg button { min-width:0; padding:6px 2px; font-size:9px; }
.spot-trade-grid .spot-ticket .form-group { margin-bottom:6px; }
.spot-trade-grid .spot-ticket .form-group label { font-size:8px; }
.spot-trade-grid .spot-ticket .form-input { min-height:32px; padding:6px 7px; font-size:11px; }
.spot-book { min-width:0; margin:0 0 7px; padding:6px 3px; font-size:8px; font-variant-numeric:tabular-nums; }
.spot-book-toolbar { display:flex; align-items:center; justify-content:space-between; gap:3px; min-height:25px; padding:0 3px 4px; color:var(--text); font-size:9px; font-weight:700; }
.spot-book-toolbar label { display:flex; align-items:center; gap:3px; color:var(--muted); font-size:7px; font-weight:500; }
.spot-book-toolbar select { max-width:58px; height:22px; padding:1px 2px; border:1px solid var(--border); border-radius:5px; color:var(--text); background:var(--surface2); font-size:8px; }
.spot-book-head,.spot-book-row { display:grid; grid-template-columns:1.15fr .85fr; gap:3px; align-items:center; min-height:16px; padding:0 2px; }
.spot-book-head { color:var(--muted); font-size:8px; text-align:right; }
.spot-book-row { position:relative; overflow:hidden; }
.spot-book-row i { position:absolute; top:1px; right:0; bottom:1px; opacity:.13; pointer-events:none; }
.spot-book-row.ask i { background:#ef5350; }
.spot-book-row.bid i { background:#18b77a; }
.spot-book-row b,.spot-book-row span { position:relative; z-index:1; text-align:right; font-weight:500; }
.spot-book-row.ask b { color:#ef6b68; }
.spot-book-row.bid b { color:#26c88b; }
.spot-book-mid { margin:3px 0; padding:4px 1px; border-top:1px solid var(--border); border-bottom:1px solid var(--border); color:#f2c94c; text-align:center; font-size:8px; font-weight:700; }
.spot-ticket .seg { margin-bottom:6px; }
.spot-balance { min-height:22px; font-size:9px; }
.spot-balance b { text-align:right; font-size:9px; }
.spot-pcts { display:grid; grid-template-columns:repeat(4,1fr); gap:3px; margin:-2px 0 5px; }
.spot-pcts button { border:0; border-radius:6px; padding:4px 1px; background:var(--surface2); color:var(--muted); font-size:8px; }
.spot-addon-row { margin:3px 0 5px; padding:3px 0; font-size:8px; }
.spot-estimate { display:flex; justify-content:space-between; gap:4px; border-top:1px solid var(--border); padding:5px 0; color:var(--muted); font-size:8px; }
.spot-estimate b { color:var(--text); }
.spot-submit { background:#16ad72; border-color:#16ad72; }
.spot-submit.sell { background:#d84b55; border-color:#d84b55; }
.spot-trade-grid .spot-submit { min-height:34px; padding:7px 3px; font-size:11px; }
.spot-position { padding:8px; }
.spot-protection-take { display:grid; grid-template-columns:minmax(0,1fr) 82px 28px; gap:5px; align-items:center; margin:5px 0; }
.spot-protection-take .form-input { min-width:0; }
.spot-protection-take .icon-btn { width:28px; height:30px; min-height:30px; padding:0; color:var(--red); }
