@charset "UTF-8";

:root {
  color-scheme: dark;
  --bg: #0b111b;
  --panel: #131d2b;
  --panel-raised: #192536;
  --panel-soft: #101925;
  --field: #0e1723;
  --text: #edf1f7;
  --muted: #8390a4;
  --faint: #54647c;
  --line: rgba(160, 181, 211, .11);
  --orange: #ffa24b;
  --orange-strong: #ff9633;
  --orange-soft: rgba(255, 162, 75, .10);
  --mint: #75e0b4;
  --mint-soft: rgba(117, 224, 180, .09);
  --red: #f3838d;
  --red-soft: rgba(243, 131, 141, .09);
  --shadow: 0 14px 50px rgba(0, 0, 0, .18);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --content-safe-top: 0px;
  --content-safe-bottom: 0px;
  --nav-height: 77px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f6fa;
  --panel: #fff;
  --panel-raised: #edf1f6;
  --panel-soft: #f9fafc;
  --field: #f3f5f9;
  --text: #142036;
  --muted: #66758b;
  --faint: #8c98aa;
  --line: rgba(38, 61, 95, .10);
  --orange: #d86c13;
  --orange-strong: #f39a41;
  --orange-soft: rgba(224, 119, 31, .08);
  --mint: #168561;
  --mint-soft: rgba(22, 133, 97, .07);
  --red: #c5485b;
  --red-soft: rgba(197, 72, 91, .07);
  --shadow: 0 12px 40px rgba(27, 53, 93, .05);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; min-width: 300px; min-height: 100vh; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; overflow-x: clip; }
body::before { content: ""; position: fixed; z-index: -1; width: 680px; height: 460px; left: 50%; top: -330px; transform: translateX(-50%); background: radial-gradient(ellipse, rgba(255, 162, 75, .055), transparent 65%); pointer-events: none; }
button, input, select { font: inherit; }
button, a, input, summary { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; color: inherit; }
button:disabled { cursor: default; }
button, input { outline: none; }
button:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--orange); outline-offset: 4px; }
a { color: inherit; text-decoration: none; }
h1, h2, p, dl, dd { margin: 0; }
button { border: 0; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
strong, b { font-weight: 650; }
input { color: var(--text); min-width: 0; }
input::-webkit-inner-spin-button, input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
input:invalid:not(:placeholder-shown).was-validated { box-shadow: 0 0 0 1px var(--red); }
.icon-library, .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.app-shell { width: 100%; max-width: 600px; padding: calc(19px + max(var(--safe-top), var(--content-safe-top))) 24px calc(101px + max(var(--safe-bottom), var(--content-safe-bottom))); margin: 0 auto; }
.app-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 33px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-size: 21px; font-weight: 760; letter-spacing: -.9px; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 32px; border-radius: 9px; background: var(--orange); color: #101723; font-size: 24px; font-family: Arial, sans-serif; font-weight: 700; line-height: 1; transform: rotate(-6deg); box-shadow: 0 0 24px rgba(255, 162, 75, .10); }
.brand-dot { color: var(--orange); }
.paper-badge { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; font-size: 9px; font-weight: 750; letter-spacing: 1.3px; color: var(--muted); }
.paper-badge > span { width: 4px; height: 4px; background: var(--orange); border-radius: 50%; }
.market-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.market-identity { display: flex; align-items: center; gap: 10px; min-width: 0; }
.coin-icon { display: grid; place-items: center; flex: 0 0 auto; height: 37px; width: 37px; border-radius: 50%; background: var(--orange-soft); color: var(--orange); font-size: 27px; font-family: Arial, sans-serif; transform: rotate(8deg); }
.market-identity h1 { font-size: 15px; font-weight: 700; letter-spacing: -.35px; }
.market-identity h1 span { display: inline; margin-left: 5px; font-size: 10px; font-weight: 500; color: var(--muted); letter-spacing: 0; white-space: nowrap; }
.market-identity p { margin-top: 1px; color: var(--muted); font-size: 10px; }
.status-dot { display: inline-block; width: 5px; height: 5px; background: currentColor; border-radius: 50%; flex: 0 0 auto; }
.live-label { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 9px; font-weight: 650; white-space: nowrap; }
.live-label.fresh { color: var(--mint); }
.live-label.fresh .status-dot { box-shadow: 0 0 0 3px var(--mint-soft); }
.price-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; }
.live-price { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 9px; row-gap: 0; font-size: clamp(35px, 9.5vw, 48px); font-weight: 650; line-height: 1.15; letter-spacing: -2.2px; font-variant-numeric: tabular-nums; }
.price-currency { font-size: 12px; color: var(--faint); font-weight: 600; letter-spacing: .2px; }
.leverage-badge { color: var(--orange); background: var(--orange-soft); border: 1px solid rgba(255, 162, 75, .14); padding: 5px 9px; border-radius: 7px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.chart-subline { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 10px; margin-top: 9px; }
.chart-change { color: var(--mint); font-weight: 700; font-variant-numeric: tabular-nums; }
.chart-change.negative, .negative { color: var(--red) !important; }
.positive { color: var(--mint) !important; }
.muted { color: var(--muted); }
.chart-panel { margin-top: 9px; }
.chart-viewport { position: relative; width: 100%; height: 226px; }
#price-chart { display: block; width: 100%; height: 100%; touch-action: pan-y; }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--faint); font-size: 12px; }
.chart-tooltip { position: absolute; display: flex; flex-direction: column; z-index: 2; pointer-events: none; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-raised); padding: 8px 11px; box-shadow: var(--shadow); min-width: 112px; }
.chart-tooltip strong { color: var(--text); font-size: 13px; font-variant-numeric: tabular-nums; }
.chart-tooltip span { color: var(--muted); font-size: 10px; margin-top: 1px; }
.chart-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.chart-interval { display: flex; align-items: center; gap: 5px; color: var(--faint); font-size: 10px; }
.chart-interval > span { background: var(--orange); width: 4px; height: 4px; border-radius: 50%; }
.period-switch { display: flex; gap: 3px; }
.period-switch button { background: transparent; border-radius: 7px; padding: 5px 11px; color: var(--muted); font-size: 11px; font-weight: 600; transition: background .15s, color .15s; }
.period-switch button.active { color: var(--orange); background: var(--orange-soft); }
.balance-card { margin-top: 24px; padding: 18px 19px 14px; border-radius: 17px; border: 1px solid var(--line); background: linear-gradient(115deg, var(--panel-raised), var(--panel)); box-shadow: var(--shadow); }
.card-label { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 11px; font-weight: 550; }
.card-label .icon { width: 15px; height: 15px; }
.card-label > span { margin-left: auto; color: var(--faint); font-size: 9px; letter-spacing: .6px; }
.balance-grid { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-top: 14px; }
.metric-label { display: block; color: var(--muted); font-size: 10px; font-weight: 450; line-height: 1.5; }
.balance-main { display: block; margin-top: 1px; font-size: 29px; font-weight: 650; letter-spacing: -.8px; line-height: 1.3; font-variant-numeric: tabular-nums; }
.balance-pnl { text-align: right; padding-bottom: 2px; }
.balance-pnl strong { display: block; margin-top: 4px; font-size: 20px; line-height: 1.3; letter-spacing: -.4px; font-variant-numeric: tabular-nums; }
.balance-divider { height: 1px; background: var(--line); margin-top: 15px; }
.balance-details { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 5px 12px; color: var(--muted); font-size: 10px; padding-top: 11px; }
.balance-details strong { font-size: 10px; margin-left: 3px; color: var(--text); font-variant-numeric: tabular-nums; }
.decision-card { margin-top: 16px; padding: 18px 18px 0; border-radius: 17px; border: 1px solid var(--line); background: var(--panel-soft); overflow: hidden; }
.decision-topline { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bot-status { display: inline-flex; align-items: center; gap: 5px; color: var(--orange); font-size: 10px; font-weight: 650; }
.bot-status.running { color: var(--mint); }
.strategy-badge { font-size: 9px; padding: 3px 6px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); white-space: nowrap; }
.decision-title { display: flex; gap: 10px; align-items: flex-start; margin-top: 18px; }
.decision-icon { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 10px; color: var(--orange); background: var(--orange-soft); flex: 0 0 auto; margin-top: 1px; }
.decision-icon .icon { width: 17px; height: 17px; }
.decision-title h2 { font-size: 14px; font-weight: 650; letter-spacing: -.25px; line-height: 1.4; }
.decision-title p { margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.pause-reasons { margin: 12px 0 0; color: var(--muted); padding: 9px 10px; border-radius: 8px; background: var(--orange-soft); font-size: 10px; }
.entry-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 12px; margin-top: 16px; }
.entry-checks:empty { margin-top: 0; }
.entry-check { display: flex; align-items: center; gap: 6px; color: var(--muted); min-width: 0; font-size: 10px; line-height: 1.5; }
.entry-check > span:first-child { display: grid; place-items: center; height: 14px; width: 14px; color: var(--faint); background: var(--line); border-radius: 50%; flex: 0 0 auto; font-size: 9px; }
.entry-check.passed > span:first-child { color: var(--mint); background: var(--mint-soft); }
.entry-check.failed > span:first-child { color: var(--orange); background: var(--orange-soft); }
.entry-check > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.next-check { display: flex; justify-content: space-between; gap: 12px; align-items: center; border-top: 1px dashed var(--line); padding-top: 13px; margin-top: 16px; }
.next-check > span { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10px; }
.next-check .icon { width: 13px; height: 13px; }
.next-check strong { font-size: 12px; color: var(--orange); font-variant-numeric: tabular-nums; letter-spacing: .5px; }
.decision-actions { display: flex; gap: 8px; margin-top: 14px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 46px; border-radius: 11px; padding: 11px 16px; font-size: 12px; font-weight: 700; transition: opacity .15s, background .15s, transform .15s; }
.button .icon { width: 16px; height: 16px; }
.button-primary { background: var(--orange-strong); color: #111a26; box-shadow: 0 3px 14px rgba(255, 150, 51, .07); }
.button-primary:hover:not(:disabled) { filter: brightness(1.06); }
.button-primary:disabled { opacity: .4; box-shadow: none; }
.button:active:not(:disabled) { transform: translateY(1px); }
.decision-actions .button-primary { flex: 1; }
.button-icon { width: 46px; flex: 0 0 auto; padding: 11px; background: var(--panel-raised); color: var(--muted); border: 1px solid var(--line); }
.button-icon:disabled { opacity: .3; }
.button-subtle { background: var(--panel-raised); color: var(--muted); }
.button-subtle:disabled { opacity: .4; }
.activity-meta { display: flex; flex-wrap: wrap; gap: 5px 12px; align-items: center; margin: 15px -18px 0; padding: 10px 18px; border-top: 1px solid var(--line); font-size: 9px; color: var(--faint); }
.activity-meta b { color: var(--muted); font-weight: 550; }
.activity-meta > span:last-child { margin-left: auto; }
.section-block { margin-top: 26px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.section-heading h2 { font-size: 14px; font-weight: 650; letter-spacing: -.2px; }
.text-button { display: flex; align-items: center; gap: 1px; padding: 3px 0 3px 9px; font-size: 10px; font-weight: 650; color: var(--orange); background: transparent; }
.text-button .icon { width: 14px; height: 14px; }
.empty-position { display: flex; align-items: center; gap: 12px; min-height: 83px; padding: 17px; border: 1px dashed var(--line); border-radius: 13px; }
.empty-position > .icon { width: 22px; height: 22px; color: var(--faint); }
.empty-position strong { font-size: 11px; font-weight: 550; color: var(--muted); }
.empty-position p { color: var(--faint); font-size: 10px; margin-top: 2px; }
.long-badge { color: var(--mint); background: var(--mint-soft); padding: 3px 7px; font-size: 9px; font-weight: 700; border-radius: 5px; letter-spacing: .3px; }
.position-card { padding: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 13px; }
.position-top { display: flex; justify-content: space-between; align-items: start; gap: 10px; }
.position-top strong { display: block; margin-top: 4px; font-variant-numeric: tabular-nums; font-size: 20px; font-weight: 600; letter-spacing: -.4px; }
.position-pnl { text-align: right; }
.position-pnl strong { font-size: 17px; }
.position-price-track { height: 3px; border-radius: 5px; position: relative; background: linear-gradient(90deg, var(--red), var(--orange) 45%, var(--mint)); margin-top: 23px; }
.position-price-track > span { position: absolute; width: 9px; height: 9px; top: -3px; border: 2px solid var(--panel); background: var(--text); border-radius: 50%; transform: translateX(-50%); box-shadow: 0 0 0 2px rgba(237, 241, 247, .12); }
.position-levels { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; }
.position-levels > div { flex: 1; }
.position-levels > div:nth-child(2) { text-align: center; }
.position-levels > div:last-child { text-align: right; }
.position-levels span { display: block; color: var(--muted); font-size: 9px; }
.position-levels strong { display: block; margin-top: 2px; font-size: 11px; font-variant-numeric: tabular-nums; }
.stop-level strong { color: var(--red); }
.target-level strong { color: var(--mint); }
.position-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 5px 10px; border-top: 1px solid var(--line); margin-top: 15px; padding-top: 10px; color: var(--faint); font-size: 9px; }
.position-meta strong { color: var(--muted); font-weight: 500; }
.portfolio-budget { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px 18px; border-top:1px solid var(--line); margin-top:15px; padding-top:14px; }
.portfolio-budget > div { display:flex; align-items:flex-start; flex-direction:column; gap:5px; min-width:0; }
.portfolio-budget span { color:var(--muted); font-size:9px; }
.portfolio-budget strong { font-size:12px; font-weight:550; font-variant-numeric:tabular-nums; }
.position-summary,.position-fixed-note { color:var(--muted); font-size:10px; line-height:1.7; }
.position-summary { margin:-4px 0 12px; }
.position-fixed-note { margin-top:12px; color:var(--faint); font-size:9px; }
.position-list { display:flex; flex-direction:column; gap:9px; }
.portfolio-position { padding:0; overflow:hidden; }
.portfolio-position-heading { display:flex; align-items:center; gap:10px; padding:15px 13px; cursor:pointer; list-style:none; }
.portfolio-position-heading::-webkit-details-marker { display:none; }
.portfolio-position-identity { flex:1; min-width:0; }
.portfolio-position-identity strong { display:block; color:var(--mint); font-size:11px; font-weight:600; }
.portfolio-position-identity span,.portfolio-position-result > span { display:block; margin-top:5px; color:var(--faint); font-size:8px; font-variant-numeric:tabular-nums; }
.portfolio-position-result { text-align:right; }
.portfolio-position-result strong { font-size:12px; font-weight:600; font-variant-numeric:tabular-nums; }
.portfolio-position-chevron { flex:0 0 auto; color:var(--muted); font-size:16px; line-height:1; transition:transform .15s; }
.portfolio-position[open] .portfolio-position-chevron { transform:rotate(180deg); }
.portfolio-position-body { border-top:1px solid var(--line); padding:0 13px 13px; }
.position-close { margin-top:13px; width:100%; padding:9px 12px; min-height:38px; color:var(--red); background:var(--red-soft); border:1px solid var(--line); border-radius:8px; font-size:10px; }
.position-close:disabled { opacity:.45; cursor:default; }
.positions-more { width:100%; border:1px solid var(--line); border-radius:9px; background:var(--panel-soft); color:var(--muted); padding:12px; margin-top:10px; font-size:10px; }
.portfolio-settings { margin-bottom:12px; }
.capital-section .wide-field + .wide-field { margin-top:17px; }
.price-rules-builder > .field-help { margin-top:10px; }
.price-rule-cards { display:flex; flex-direction:column; gap:11px; margin-top:15px; }
.price-rule-card { border:1px solid var(--line); border-top:2px solid var(--mint); border-radius:13px; background:var(--panel); overflow:hidden; }
.price-rule-card > summary { display:flex; align-items:center; justify-content:space-between; gap:10px; cursor:pointer; list-style:none; padding:15px 13px; }
.price-rule-card > summary::-webkit-details-marker { display:none; }
.price-rule-card summary strong { display:block; font-size:12px; font-weight:600; overflow-wrap:anywhere; }
.price-rule-caption { display:block; color:var(--muted); font-size:9px; margin-top:6px; font-variant-numeric:tabular-nums; line-height:1.5; }
.price-rule-card[open] > summary .portfolio-position-chevron { transform:rotate(180deg); }
.price-rule-card.disabled-rule { border-top-color:var(--faint); }
.price-rule-card.disabled-rule > summary { opacity:.65; }
.price-rule-body { padding:0 13px 14px; border-top:1px solid var(--line); }
.price-rule-toggle { display:flex; align-items:center; gap:8px; font-size:11px; margin:14px 0 17px; }
.price-rule-toggle input { accent-color:var(--orange); width:16px; height:16px; }
.price-rule-body input[type="text"] { min-width:0; width:100%; }
.price-rule-body .field-help { margin-top:14px; }
.price-rule-preview { margin-top:16px; border:1px solid var(--line); border-radius:10px; background:var(--panel-soft); padding:12px 10px; }
.rule-preview-heading { display:block; color:var(--text); font-size:10px; font-weight:600; }
.rule-preview-message { color:var(--muted); font-size:9px; line-height:1.7; margin-top:7px; overflow-wrap:anywhere; }
.rule-preview-message.unavailable { color:var(--red); }
.rule-preview-metrics { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:13px 9px; margin-top:13px; }
.rule-preview-metrics > div { min-width:0; display:flex; flex-direction:column; gap:5px; }
.rule-preview-metrics span { color:var(--muted); font-size:8px; line-height:1.5; }
.rule-preview-metrics strong { font-size:12px; font-weight:600; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.rule-preview-levels,.rule-preview-footnote { color:var(--muted); font-size:8px; line-height:1.7; margin-top:11px; }
.rule-preview-footnote { color:var(--faint); border-top:1px solid var(--line); padding-top:9px; }
.rule-plan-detail { border:1px solid var(--line); border-radius:10px; background:var(--panel-soft); overflow:hidden; }
.rule-plan-detail > summary { cursor:pointer; list-style:none; border:0; border-radius:0; }
.rule-plan-detail > summary::-webkit-details-marker { display:none; }
.rule-plan-detail > summary > span::after { content:" · расчёт ⌄"; color:var(--faint); font-size:8px; }
.rule-plan-detail[open] > summary > span::after { content:" · расчёт ⌃"; }
.rule-plan-detail-content { border-top:1px solid var(--line); padding:12px 10px; }
.add-price-rule { width:100%; border:1px dashed var(--orange); border-radius:11px; background:var(--orange-soft); color:var(--orange); padding:14px 10px; font-size:11px; font-weight:600; margin-top:12px; }
.add-price-rule:disabled { opacity:.45; cursor:default; }
.remove-price-rule { display:block; color:var(--red); font-size:10px; background:transparent; padding:12px 0 2px; }
.batch-settings { margin-top:14px; color:var(--muted); font-size:10px; }
.batch-settings > summary { cursor:pointer; padding:6px 0; }
.batch-settings > .field-label { margin-top:12px; }
.price-rule-mode { display:block; margin-bottom:17px; }
.market-history { margin:0 0 19px; padding:0 1px; }
.market-history .section-heading { margin-bottom:12px; }
.market-history .section-heading h2 { font-size:12px; }
.market-history-periods { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
.market-history-period { min-width:0; padding:13px 10px; background:var(--panel-soft); border:1px solid var(--line); border-radius:11px; }
.market-history-period > strong { font-size:11px; display:block; margin-bottom:13px; }
.market-history-row { display:flex; flex-wrap:wrap; justify-content:space-between; gap:4px; font-size:9px; margin-top:9px; }
.market-history-row > span { color:var(--muted); line-height:1.4; }
.market-history-row b { font-variant-numeric:tabular-nums; font-weight:550; white-space:nowrap; }
.market-history-period > p { font-size:8px; color:var(--faint); line-height:1.5; margin-top:12px; overflow-wrap:anywhere; }
.market-history > .field-help { font-size:8px; margin-top:9px; }
.trade-list { border: 1px solid var(--line); border-radius: 13px; background: var(--panel-soft); overflow: hidden; }
.trade-list:empty { display: none; }
.trade-row + .trade-row { border-top: 1px solid var(--line); }
.trade-row summary { display: flex; align-items: center; gap: 10px; padding: 13px 14px; cursor: pointer; list-style: none; }
.trade-row summary::-webkit-details-marker, .advanced-settings summary::-webkit-details-marker { display: none; }
.trade-symbol { display: grid; place-items: center; flex: 0 0 auto; width: 30px; height: 30px; color: var(--mint); border-radius: 10px; background: var(--mint-soft); }
.trade-symbol .icon { width: 15px; height: 15px; }
.trade-copy { flex: 1; min-width: 0; }
.trade-copy > strong { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; }
.trade-reason { color: var(--faint); font-size: 8px; font-weight: 500; }
.trade-date { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }
.trade-result { margin-left: auto; white-space: nowrap; font-variant-numeric: tabular-nums; font-size: 12px; font-weight: 650; }
.trade-chevron { width: 13px; height: 13px; color: var(--faint); transition: transform .15s; }
.trade-row[open] .trade-chevron { transform: rotate(90deg); }
.trade-details { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; margin: 0 14px 13px 54px; padding-top: 10px; border-top: 1px solid var(--line); }
.trade-details span { display: block; font-size: 9px; color: var(--muted); }
.trade-details strong { display: block; font-size: 10px; margin-top: 1px; font-weight: 500; font-variant-numeric: tabular-nums; }
.trade-empty { padding: 25px 18px; text-align: center; }
.trade-empty .icon { width: 26px; height: 26px; color: var(--faint); margin-bottom: 8px; }
.trade-empty strong { display: block; font-size: 12px; font-weight: 550; color: var(--muted); }
.trade-empty p { margin: 4px auto 0; color: var(--faint); font-size: 10px; max-width: 230px; line-height: 1.6; }
.paper-note { display: flex; align-items: center; justify-content: center; gap: 5px; color: var(--faint); font-size: 9px; margin-top: 23px; line-height: 1.5; text-align: center; }
.paper-note .icon { width: 12px; height: 12px; }
.research-card { padding: 17px; margin-top: 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel-soft); }
.research-heading { display: flex; gap: 10px; align-items: center; }
.research-icon { display: grid; place-items: center; width: 31px; height: 34px; border: 1px solid var(--line); border-radius: 9px; color: var(--orange); }
.research-icon .icon { width: 17px; height: 17px; }
.research-heading .eyebrow { font-size: 7px; letter-spacing: 1.1px; }
.research-heading h2 { font-size: 12px; font-weight: 650; margin-top: 1px; }
.research-heading .strategy-badge { margin-left: auto; }
.research-card > p { margin-top: 12px; font-size: 11px; color: var(--muted); line-height: 1.65; }
.research-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; border-top: 1px solid var(--line); margin-top: 13px; padding-top: 12px; }
.research-metrics span { font-size: 8px; color: var(--muted); display: block; }
.research-metrics strong { font-size: 15px; font-variant-numeric: tabular-nums; display: block; margin-top: 2px; }
.research-card .research-footnote { font-size: 9px; color: var(--faint); }
.research-heading .strategy-badge.unverified { color: var(--orange); border-color: rgba(255, 162, 75, .2); background: var(--orange-soft); }
.research-comparison { margin-top: 14px; border-top: 1px solid var(--line); }
.research-comparison summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 11px 0; font-size: 10px; color: var(--muted); list-style: none; cursor: pointer; }
.research-comparison summary::-webkit-details-marker { display: none; }
.research-comparison summary .icon { width: 12px; height: 12px; transform: rotate(90deg); }
.research-comparison[open] summary .icon { transform: rotate(-90deg); }
.research-table-heading, .research-table-row { display: grid; grid-template-columns: 1.2fr .55fr 1fr; gap: 10px; align-items: center; }
.research-table-heading { font-size: 8px; color: var(--faint); padding-bottom: 7px; }
.research-table-heading > span:not(:first-child), .research-table-row > span:not(:first-child) { text-align: right; }
.research-table-row { font-size: 10px; padding: 8px 0; border-top: 1px solid var(--line); color: var(--muted); }
.research-table-row > span:last-child { font-weight: 600; font-variant-numeric: tabular-nums; }
.research-table-row.selected > span:first-child { color: var(--text); }
.page-heading { margin-top: 5px; margin-bottom: 24px; }
.eyebrow { font-size: 8px; font-weight: 650; letter-spacing: 1.65px; color: var(--muted); }
.page-heading h1 { font-size: 31px; line-height: 1.2; font-weight: 650; letter-spacing: -1.3px; margin-top: 8px; }
.heading-dot { color: var(--orange); }
.page-heading > p { margin-top: 9px; color: var(--muted); font-size: 11px; max-width: 300px; }
.trade-summary { display: grid; grid-template-columns: .7fr 1fr 1.2fr; gap: 12px; padding: 17px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 20px; }
.trade-summary > div:not(:first-child) { border-left: 1px solid var(--line); padding-left: 14px; }
.trade-summary strong { display: block; font-size: 20px; font-weight: 600; margin-top: 5px; line-height: 1.3; letter-spacing: -.6px; font-variant-numeric: tabular-nums; }
.trade-summary > div:last-child strong { font-size: 17px; padding-top: 3px; }
.detailed-trades .trade-row summary { padding-top: 15px; padding-bottom: 15px; }
.costs-card { margin-top: 25px; }
.costs-card h2 { font-size: 13px; font-weight: 600; margin-bottom: 11px; }
.costs-card dl > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 11px; }
.costs-card dt { color: var(--muted); }
.costs-card dt .muted { color: var(--faint); font-size: 9px; }
.costs-card dd { font-variant-numeric: tabular-nums; font-weight: 550; }
.costs-card > p { margin-top: 13px; color: var(--faint); font-size: 10px; line-height: 1.6; }
.settings-notice { display: flex; align-items: flex-start; gap: 8px; font-size: 11px; line-height: 1.6; padding: 12px 13px; border: 1px solid rgba(255, 162, 75, .13); border-radius: 10px; color: var(--orange); background: var(--orange-soft); margin-top: -3px; margin-bottom: 23px; }
.settings-notice .icon { width: 15px; height: 15px; margin-top: 1px; }
.settings-notice.editable { color: var(--mint); border-color: rgba(117, 224, 180, .14); background: var(--mint-soft); }
.settings-section { margin-bottom: 26px; }
.settings-section .section-heading { margin-bottom: 13px; }
.section-number { color: var(--faint); font-size: 9px; font-variant-numeric: tabular-nums; letter-spacing: 1px; }
.strategy-choices { display: flex; flex-direction: column; gap: 8px; }
.strategy-choice { display: flex; align-items: flex-start; gap: 10px; position: relative; padding: 14px 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-soft); cursor: pointer; transition: border-color .15s, background .15s; }
.strategy-choice:has(input:checked) { border-color: rgba(255, 162, 75, .5); background: var(--orange-soft); }
.strategy-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.strategy-choice:has(input:focus-visible) { outline: 2px solid var(--orange); outline-offset: 3px; }
.choice-symbol { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 8px; color: var(--muted); background: var(--panel-raised); flex: 0 0 auto; }
.choice-symbol .icon { width: 17px; height: 17px; }
.strategy-choice:has(input:checked) .choice-symbol { background: var(--orange-soft); color: var(--orange); }
.choice-copy { flex: 1; min-width: 0; }
.choice-copy strong { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; font-size: 12px; font-weight: 650; line-height: 1.5; }
.choice-copy small { display: block; font-size: 10px; color: var(--muted); line-height: 1.6; margin-top: 4px; max-width: 350px; }
.choice-tag { display: inline; font-size: 7px; font-weight: 650; color: var(--orange); background: var(--orange-soft); padding: 2px 4px; border-radius: 4px; white-space: nowrap; }
.radio-indicator { border: 1px solid var(--faint); width: 14px; height: 14px; flex: 0 0 auto; border-radius: 50%; margin-top: 2px; }
.strategy-choice:has(input:checked) .radio-indicator { background: var(--orange); border: 4px solid var(--orange); box-shadow: inset 0 0 0 2px var(--bg); }
.field-help { font-size: 10px; color: var(--faint); line-height: 1.6; margin-top: 10px; }
.leverage-setting { display: flex; justify-content: space-between; align-items: center; gap: 15px; background: var(--panel-soft); padding: 14px 13px; border: 1px solid var(--line); border-radius: 11px; margin-bottom: 16px; }
.leverage-setting label { font-size: 12px; font-weight: 600; }
.leverage-setting p { font-size: 9px; color: var(--faint); margin-top: 4px; max-width: 185px; }
.stepper { display: flex; align-items: center; gap: 4px; border-radius: 8px; padding: 4px; background: var(--field); flex: 0 0 auto; }
.stepper button { width: 26px; height: 28px; border-radius: 6px; color: var(--muted); background: var(--panel-raised); font-size: 16px; line-height: 1; }
.stepper > span { font-size: 12px; color: var(--orange); margin-left: 5px; }
.stepper input { text-align: left; width: 28px; padding: 2px 0; font-size: 16px; font-weight: 650; color: var(--orange); background: transparent; border: 0; font-variant-numeric: tabular-nums; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 13px; row-gap: 17px; }
.field-label { display: flex; flex-direction: column; min-width: 0; font-size: 10px; color: var(--muted); line-height: 1.5; }
.input-wrap { margin-top: 7px; display: flex; align-items: center; gap: 5px; height: 44px; background: var(--field); border: 1px solid var(--line); border-radius: 9px; padding: 0 11px; min-width: 0; }
.input-wrap:focus-within { border-color: var(--orange); }
.input-wrap input { width: 100%; flex: 1; background: transparent; border: 0; outline: none; font-size: 15px; font-weight: 550; font-variant-numeric: tabular-nums; padding: 9px 0; }
.input-wrap input:focus-visible { outline: none; }
.input-wrap > span { flex: 0 0 auto; color: var(--faint); font-size: 10px; white-space: nowrap; }
.field-label > small { display: block; font-size: 9px; color: var(--faint); line-height: 1.55; margin-top: 5px; }
.wide-field { margin-top: 17px; }
.wide-field .input-wrap { max-width: none; }
.bollinger-target-note { display: flex; flex-direction: column; justify-content: center; background: var(--mint-soft); border-radius: 9px; padding: 10px 12px; min-height: 65px; }
.bollinger-target-note strong { margin-top: 3px; color: var(--mint); font-size: 10px; }
.bollinger-target-note small { margin-top: 3px; color: var(--faint); font-size: 9px; }
.advanced-settings { border: 1px solid var(--line); border-radius: 12px; background: var(--panel-soft); }
.advanced-settings summary { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 14px; list-style: none; cursor: pointer; font-size: 11px; font-weight: 600; }
.advanced-settings summary > span { display: flex; align-items: center; gap: 7px; }
.advanced-settings summary .icon { width: 15px; height: 15px; color: var(--muted); }
.advanced-settings summary > .icon { width: 13px; height: 13px; transform: rotate(90deg); transition: transform .15s; }
.advanced-settings[open] summary > .icon { transform: rotate(-90deg); }
.advanced-content { padding: 2px 14px 17px; }
fieldset:disabled .strategy-choice { cursor: default; }
fieldset:disabled input, fieldset:disabled button { opacity: .6; }
fieldset:disabled .strategy-choice { opacity: .7; }
.expense-note { display: flex; gap: 8px; align-items: flex-start; padding: 17px 0; }
.expense-note > .icon { width: 14px; height: 14px; color: var(--faint); margin-top: 1px; }
.expense-note strong { font-size: 10px; color: var(--muted); font-weight: 550; }
.expense-note p { font-size: 9px; color: var(--faint); line-height: 1.6; margin-top: 3px; }
.save-settings { position: sticky; z-index: 4; bottom: calc(var(--nav-height) + max(var(--safe-bottom), var(--content-safe-bottom)) + 5px); padding: 12px 13px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); box-shadow: var(--shadow); margin: 0 -2px; }
.save-settings > span { display: block; font-size: 9px; color: var(--faint); margin-bottom: 8px; }
.save-settings.dirty > span { color: var(--orange); }
.save-settings > div { display: flex; gap: 8px; }
.save-settings .button-primary { flex: 1; }
.save-settings .button-subtle { padding-left: 17px; padding-right: 17px; font-size: 11px; }
.inline-message { padding: 11px 12px; margin-bottom: 17px; border-radius: 9px; font-size: 11px; line-height: 1.6; border: 1px solid rgba(243, 131, 141, .15); background: var(--red-soft); color: var(--red); }
.inline-message.success { border-color: rgba(117, 224, 180, .15); background: var(--mint-soft); color: var(--mint); }
.bottom-navigation { position: fixed; z-index: 10; bottom: 0; left: 0; right: 0; background: var(--bg); padding-bottom: max(var(--safe-bottom), var(--content-safe-bottom)); border-top: 1px solid var(--line); }
@supports (backdrop-filter: blur(20px)) { .bottom-navigation { background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); } }
.bottom-navigation > div { display: grid; grid-template-columns: repeat(4, 1fr); max-width: 600px; margin: 0 auto; height: var(--nav-height); padding: 8px 15px 10px; }
.bottom-navigation button { position: relative; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 6px; color: var(--faint); background: transparent; border-radius: 10px; font-size: 9px; font-weight: 550; }
.bottom-navigation button .icon { width: 20px; height: 20px; }
.bottom-navigation button.active { color: var(--orange); }
.bottom-navigation button.active::before { content: ""; position: absolute; width: 32px; height: 27px; top: 4px; border-radius: 9px; background: var(--orange-soft); z-index: -1; }
.connection-banner { display: flex; gap: 8px; align-items: center; padding: 9px 11px; background: var(--orange-soft); border: 1px solid rgba(255, 162, 75, .16); color: var(--orange); border-radius: 9px; margin: -12px 0 22px; font-size: 10px; }
.connection-banner > span:nth-child(2) { flex: 1; }
.connection-banner button { display: grid; place-items: center; background: transparent; padding: 3px; color: inherit; }
.connection-banner .icon { width: 15px; height: 15px; }
.toast { position: fixed; bottom: calc(93px + max(var(--safe-bottom), var(--content-safe-bottom))); left: 50%; transform: translateX(-50%); z-index: 30; width: max-content; max-width: min(490px, calc(100% - 40px)); padding: 12px 16px; background: var(--panel-raised); color: var(--text); border: 1px solid var(--line); border-radius: 11px; box-shadow: 0 8px 40px rgba(0, 0, 0, .25); font-size: 12px; text-align: center; line-height: 1.5; }
.toast.error { border-color: rgba(243, 131, 141, .3); color: var(--red); }
.access-gate { display: flex; flex-direction: column; align-items: center; text-align: center; padding: max(8vh, 30px) 4px 20px; }
.gate-emblem { position: relative; display: grid; place-items: center; width: 118px; height: 118px; margin-bottom: 28px; }
.gate-emblem > span { display: grid; place-items: center; width: 70px; height: 70px; border-radius: 22px; background: var(--orange); color: #111a26; font-family: Arial, sans-serif; font-size: 50px; font-weight: 700; transform: rotate(-7deg); box-shadow: 0 0 55px rgba(255, 162, 75, .10); }
.gate-emblem > i { position: absolute; inset: 0; border: 1px solid var(--line); border-radius: 37px; transform: rotate(15deg); }
.gate-emblem > i:last-child { inset: -14px; opacity: .5; transform: rotate(31deg); }
.access-gate > h1 { font-size: 27px; font-weight: 650; letter-spacing: -.8px; line-height: 1.25; margin-top: 11px; max-width: 330px; }
.access-gate > p:not(.gate-footnote) { color: var(--muted); font-size: 13px; line-height: 1.75; max-width: 310px; margin-top: 15px; }
.access-gate .button { margin-top: 25px; min-width: 150px; }
.gate-footnote { color: var(--faint); font-size: 10px; margin-top: 34px; }
.loading-dots { display: flex; gap: 5px; margin-top: 30px; }
.loading-dots > i { width: 5px; height: 5px; background: var(--orange); border-radius: 50%; animation: dot-pulse 1s infinite alternate; }
.loading-dots > i:nth-child(2) { animation-delay: .2s; }
.loading-dots > i:nth-child(3) { animation-delay: .4s; }
@keyframes dot-pulse { to { opacity: .2; transform: translateY(-3px); } }

@media (min-width: 600px) {
  .app-shell { padding-left: 32px; padding-right: 32px; }
  .app-header { margin-bottom: 39px; }
  .market-identity h1 { font-size: 18px; }
  .market-identity h1 span { font-size: 11px; }
  .market-identity p { font-size: 11px; }
  .live-price { font-size: 50px; }
  .chart-viewport { height: 255px; }
  .balance-card, .decision-card { border-radius: 19px; }
  .decision-title h2 { font-size: 16px; }
  .decision-title p { font-size: 12px; }
  .button { font-size: 13px; }
  .entry-check { font-size: 11px; }
  .balance-main { font-size: 32px; }
  .balance-pnl strong { font-size: 23px; }
  .field-label { font-size: 11px; }
  .trade-copy > strong { font-size: 12px; }
  .trade-result { font-size: 13px; }
}

@media (max-width: 359px) {
  .app-shell { padding-left: 17px; padding-right: 17px; }
  .brand { font-size: 19px; gap: 7px; }
  .market-identity h1 span { display: block; margin-left: 0; margin-top: 1px; }
  .market-identity p { display: none; }
  .live-price { font-size: 35px; letter-spacing: -1.6px; }
  .price-currency { font-size: 10px; }
  .live-label { font-size: 8px; }
  .chart-viewport { height: 205px; }
  .balance-card { padding-left: 15px; padding-right: 15px; }
  .balance-main { font-size: 25px; }
  .balance-pnl strong { font-size: 17px; }
  .decision-card { padding-left: 14px; padding-right: 14px; }
  .activity-meta { padding-left: 14px; padding-right: 14px; margin-left: -14px; margin-right: -14px; }
  .activity-meta > span:last-child { width: 100%; margin-left: 0; }
  .trade-row summary { padding-left: 11px; padding-right: 11px; gap: 7px; }
  .trade-result { font-size: 11px; }
  .trade-reason { display: none; }
  .settings-grid { column-gap: 9px; }
  .choice-symbol { width: 26px; height: 28px; }
  .strategy-choice { padding-left: 10px; padding-right: 10px; gap: 8px; }
  .choice-copy strong { font-size: 11px; }
  .choice-tag { font-size: 6px; }
  .stepper { gap: 2px; }
  .stepper button { width: 23px; }
  .leverage-setting { padding-left: 11px; padding-right: 11px; gap: 8px; }
  .leverage-setting p { font-size: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}

/* Rule builder: the owner's conditions are the primary control surface. */
.quote-line { display:flex; gap:18px; flex-wrap:wrap; margin:8px 0 10px; font-size:10px; color:var(--muted); }
.quote-line b { color:var(--text); font-weight:550; font-variant-numeric:tabular-nums; margin-left:4px; }
.control-section .section-heading { gap:8px; flex-wrap:wrap; }
.auto-setup { display:flex; align-items:center; gap:5px; color:var(--orange); font-size:10px; background:var(--orange-soft); border:1px solid rgba(255,162,75,.16); padding:7px 9px; border-radius:8px; }
.auto-setup .icon { width:13px; height:13px; }
.control-modes { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
.control-mode-option { display:flex; flex-direction:column; align-items:flex-start; text-align:left; padding:15px 12px; border-radius:12px; background:var(--panel-soft); border:1px solid var(--line); transition:background .15s,border-color .15s; }
.control-mode-option .icon { color:var(--muted); width:20px; height:20px; margin-bottom:12px; }
.control-mode-option strong { font-size:13px; line-height:1.3; }
.control-mode-option > span { color:var(--muted); font-size:10px; line-height:1.6; margin-top:6px; }
.control-mode-option.active { background:var(--orange-soft); border-color:rgba(255,162,75,.6); }
.control-mode-option.active .icon,.control-mode-option.active strong { color:var(--orange); }
.auto-mode-note { display:flex; align-items:flex-start; gap:10px; padding:14px 3px 4px; }
.auto-note-icon { color:var(--mint); background:var(--mint-soft); width:26px; height:26px; border-radius:8px; flex:0 0 auto; display:grid; place-items:center; font-size:18px; }
.auto-mode-note p { color:var(--muted); font-size:10px; line-height:1.7; }
.auto-mode-note strong { color:var(--text); display:block; font-weight:550; margin-bottom:2px; }
.template-picker { margin-top:14px; border-top:1px solid var(--line); padding-top:2px; }
.template-picker summary { display:flex; justify-content:space-between; align-items:center; font-size:10px; color:var(--muted); padding:12px 1px 3px; list-style:none; cursor:pointer; }
.template-picker summary > .icon { width:11px; height:11px; transform:rotate(90deg); }
.template-picker[open] summary > .icon { transform:rotate(-90deg); }
.template-options { display:flex; flex-direction:column; gap:6px; padding-top:11px; }
.template-options button { background:var(--panel-soft); padding:12px; border:1px solid var(--line); border-radius:9px; color:var(--text); text-align:left; font-size:11px; }
.template-options button.active { border-color:var(--orange); }
.template-options span { display:block; font-size:9px; color:var(--muted); margin-top:3px; }
.trigger-card { border:1px solid var(--line); background:var(--panel); padding:17px 15px; border-radius:15px; margin-bottom:13px; }
.trigger-card.buy-trigger { border-top:2px solid var(--mint); }
.trigger-card.sell-trigger { border-top:2px solid var(--orange); }
.trigger-card.stop-trigger { border-top:2px solid var(--red); }
.trigger-heading { display:flex; align-items:flex-start; gap:9px; margin-bottom:17px; }
.trigger-heading h2 { font-size:14px; font-weight:650; line-height:1.25; }
.trigger-heading p { font-size:10px; line-height:1.6; margin-top:4px; color:var(--muted); }
.trigger-number { font-size:10px; font-variant-numeric:tabular-nums; padding-top:3px; color:var(--faint); }
.trigger-direction,.trigger-heading > .icon { margin-left:auto; color:var(--mint); flex:0 0 auto; }
.trigger-direction { font-size:24px; line-height:1; }
.sell-trigger .trigger-direction { color:var(--orange); }
.stop-trigger .trigger-heading > .icon { color:var(--red); width:19px; height:19px; }
.field-label select { margin-top:7px; width:100%; min-width:0; min-height:44px; appearance:none; border:1px solid var(--line); border-radius:9px; color:var(--text); background:var(--field); padding:11px 28px 11px 11px; font-size:11px; background-image:linear-gradient(45deg,transparent 50%,var(--muted) 50%),linear-gradient(135deg,var(--muted) 50%,transparent 50%); background-position:calc(100% - 16px) 19px,calc(100% - 11px) 19px; background-size:5px 5px; background-repeat:no-repeat; }
.field-label select:focus-visible { outline:2px solid var(--orange); outline-offset:2px; }
.trigger-card .field-label + .field-label { margin-top:16px; }
.trigger-price .input-wrap { height:53px; }
.trigger-price .input-wrap input { font-size:21px; font-weight:650; letter-spacing:-.5px; }
.trigger-price input::placeholder { font-size:15px; font-weight:400; letter-spacing:0; color:var(--faint); }
.capital-section .leverage-setting { margin-top:15px; }
.risk-grid,.execution-grid { margin-top:17px; }
.full-width { grid-column:1 / -1; }
.rule-plan { background:var(--panel); border:1px solid var(--line); border-radius:16px; padding:17px 15px; margin:0 0 16px; }
.active-rule-plan { border-color:rgba(255,162,75,.25); background:linear-gradient(145deg,var(--panel),var(--panel-soft)); }
.rule-plan-heading { display:flex; justify-content:space-between; align-items:center; gap:8px; margin-bottom:9px; }
.rule-plan-heading .eyebrow { margin:0; font-size:8px; }
.rule-plan-heading > span:last-child { color:var(--muted); font-size:9px; }
.rule-plan h2 { font-size:15px; letter-spacing:-.2px; }
.plan-summary { margin:9px 0 15px; color:var(--muted); font-size:11px; line-height:1.7; }
.rule-levels { display:flex; flex-direction:column; gap:7px; }
.rule-level { border:1px solid var(--line); border-radius:10px; display:flex; align-items:center; justify-content:space-between; gap:9px; padding:12px 11px; background:var(--panel-soft); }
.rule-level > span { font-size:10px; color:var(--muted); }
.rule-level > strong { font-size:15px; font-weight:600; font-variant-numeric:tabular-nums; white-space:nowrap; }
.rule-level.buy > strong { color:var(--mint); }
.rule-level.sell > strong { color:var(--orange); }
.rule-level.stop > strong { color:var(--red); }
.plan-metrics { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:15px 7px; margin-top:17px; }
.plan-metrics > div { display:flex; flex-direction:column; gap:5px; min-width:0; }
.plan-metrics > div > span { color:var(--muted); font-size:8px; line-height:1.5; }
.plan-metrics strong { font-size:12px; font-variant-numeric:tabular-nums; font-weight:600; }
.plan-note { border-top:1px solid var(--line); padding-top:12px; margin-top:14px; color:var(--muted); font-size:9px; line-height:1.7; }
.draft-plan { margin-top:17px; border-color:rgba(255,162,75,.25); }
.settings-launch { margin:20px 0 0; padding:0 0 8px; }
.settings-launch > p { color:var(--muted); font-size:10px; line-height:1.7; margin-bottom:10px; }
.settings-launch .button { width:100%; }
fieldset:disabled .control-mode-option,fieldset:disabled select,fieldset:disabled .auto-setup { opacity:.6; cursor:default; }
@media (max-width:350px) { .control-mode-option { padding:13px 10px; } .control-mode-option strong { font-size:12px; } .plan-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); } .rule-level > strong { font-size:13px; } }

/* A template stores the strategy; each position is one separate execution. */
.side-badge { display:inline-flex; align-items:center; flex-shrink:0; width:max-content; max-width:100%; border-radius:5px; padding:4px 6px; font-size:8px; font-weight:650; line-height:1.4; }
.side-badge.long { color:var(--mint); background:var(--mint-soft); }
.side-badge.short { color:var(--red); background:var(--red-soft); }
.side-badge.mixed { color:var(--orange); background:var(--orange-soft); }
.price-rule-card.short { border-top-color:var(--red); }
.price-rule-card.disabled-rule { border-top-color:var(--faint); }
.portfolio-position.short .portfolio-position-identity strong { color:var(--red); }
.portfolio-position.short .position-price-track { background:linear-gradient(90deg,var(--mint),var(--orange) 55%,var(--red)); }
.template-side-field { display:block; margin-bottom:9px; }
.template-direction-note { border-left:2px solid var(--mint); padding:8px 10px; margin-bottom:17px; background:var(--mint-soft); color:var(--muted); font-size:10px; line-height:1.7; border-radius:0 7px 7px 0; }
.template-direction-note.short { border-color:var(--red); background:var(--red-soft); }
.saved-templates > .field-help { margin-top:-3px; margin-bottom:13px; }
.saved-template-list,.strategy-analytics-list { display:flex; flex-direction:column; gap:12px; }
.saved-template-card,.strategy-analytics-card { min-width:0; background:var(--panel); border:1px solid var(--line); border-radius:14px; padding:16px 13px; }
.saved-template-card { border-left:2px solid var(--mint); }
.saved-template-card.short { border-left-color:var(--red); }
.saved-template-heading { display:flex; justify-content:space-between; align-items:flex-start; gap:10px; }
.saved-template-heading h2,.saved-template-heading h3 { font-size:13px; font-weight:650; line-height:1.5; overflow-wrap:anywhere; }
.saved-template-status { color:var(--muted); font-size:10px; margin-top:9px; line-height:1.6; }
.saved-template-status.active { color:var(--mint); }
.saved-template-levels { color:var(--muted); font-size:10px; line-height:1.8; margin-top:10px; font-variant-numeric:tabular-nums; }
.saved-template-budget { color:var(--faint); font-size:9px; line-height:1.7; margin-top:4px; }
.template-actions { display:grid; grid-template-columns:1fr 1.2fr; gap:7px; margin-top:15px; }
.template-action { min-height:42px; padding:10px 8px; border:1px solid var(--line); border-radius:8px; background:var(--panel-soft); color:var(--text); font-size:10px; line-height:1.5; font-weight:600; }
.template-action.signal { background:var(--orange-soft); color:var(--orange); border-color:rgba(255,162,75,.25); }
.template-action.pause { grid-column:1/-1; min-height:34px; background:transparent; color:var(--muted); font-weight:450; }
.template-action:disabled { opacity:.45; cursor:default; }
.template-action:focus-visible { outline:2px solid var(--orange); outline-offset:3px; }
.template-execution-note { color:var(--faint); font-size:8px; line-height:1.7; margin-top:10px; }
.saved-template-preview { border-top:1px solid var(--line); margin-top:12px; padding-top:2px; }
.saved-template-preview > summary,.analytics-details > summary { color:var(--muted); font-size:10px; padding:10px 0; cursor:pointer; }
.template-history-link { margin-top:9px; font-size:9px; padding-left:0; }
.trade-filters { display:grid; grid-template-columns:minmax(0,1.3fr) minmax(0,1fr); gap:10px; margin:0 0 17px; }
.trade-filters select { font-size:10px; }
.trade-side-title { color:var(--mint); }
.trade-row.short .trade-side-title { color:var(--red); }
.trade-copy > strong { display:flex; align-items:center; flex-wrap:wrap; gap:5px; }
.analytics-sort { display:block; margin-bottom:14px; }
#analytics-note { margin-bottom:17px; line-height:1.8; font-size:10px; }
.analytics-sample { color:var(--faint); font-size:9px; line-height:1.7; margin-top:7px; }
.analytics-key-metrics { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:17px 12px; margin-top:19px; }
.analytics-key-metrics > div { min-width:0; }
.analytics-key-metrics span { display:block; font-size:9px; line-height:1.6; color:var(--muted); }
.analytics-key-metrics strong { display:block; margin-top:5px; font-size:16px; font-weight:600; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.analytics-key-metrics > div:nth-child(n+3) strong { font-size:13px; }
.analytics-sample-note { color:var(--faint); font-size:9px; line-height:1.7; margin-top:17px; padding:9px 10px; border-radius:7px; background:var(--panel-soft); }
.analytics-sample-note.limited { background:var(--orange-soft); color:var(--orange); }
.analytics-details { margin-top:12px; border-top:1px solid var(--line); }
.analytics-details dl { display:flex; flex-direction:column; gap:11px; padding:5px 0; }
.analytics-details dl > div { display:flex; align-items:flex-start; justify-content:space-between; gap:15px; font-size:9px; line-height:1.6; }
.analytics-details dt { color:var(--muted); }
.analytics-details dd { margin:0; text-align:right; font-variant-numeric:tabular-nums; }
.analytics-details > p { color:var(--faint); font-size:8px; line-height:1.8; margin-top:11px; }
@media (max-width:359px) { .saved-template-heading { flex-wrap:wrap; gap:5px; } .template-actions { grid-template-columns:1fr; } .template-action.pause { grid-column:auto; } .analytics-key-metrics strong { font-size:14px; } .trade-filters { grid-template-columns:1fr; gap:12px; } }
