/* Терминал: панель автоторговли. Цвета и элементы — те же, что у остальных панелей.
   Зелёный и красный — только для денег: плюс, минус и кнопка «Стоп». */

.tm .tmPane.atPane { display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.atScroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 4px 14px 12px; display: flex; flex-direction: column; gap: 10px; }
.atUp { color: var(--cx-up); }
.atDown { color: var(--cx-down); }

/* статус */
.atStatus { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13.5px; }
.atStatus i { margin-left: auto; font-style: normal; font: 700 11.5px 'JetBrains Mono', monospace; color: var(--cx-dim); }
.atStatus em { flex-basis: 100%; font-style: normal; font-size: 11.5px; font-weight: 600; color: var(--cx-dim); }
.atDot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--cx-dim); }
.atDot--running { background: var(--cx-up); box-shadow: 0 0 0 3px rgba(85, 223, 160, 0.18); }
.atDot--paused { background: var(--brand, #FFCB2E); box-shadow: 0 0 0 3px rgba(255, 203, 46, 0.18); }
.atDot--stopped { background: var(--cx-down); }

/* заметки */
.atNote { padding: 9px 11px; border-radius: 10px; background: var(--cx-bg2); font-size: 12px; font-weight: 600; line-height: 1.5; margin-bottom: 6px; color: var(--cx-txt); }
.atNote b { display: block; font-size: 12.5px; margin-bottom: 2px; }
.atNote--stop { background: rgba(244, 117, 111, 0.08); border: 1px solid rgba(244, 117, 111, 0.22); }
.atNote--ask { background: rgba(255, 203, 46, 0.07); border: 1px solid var(--brand-line, rgba(255, 203, 46, 0.42)); }
.atAsk { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.atAsk .tmBtn { height: 38px; font-size: 12.5px; }
.atWarn { padding: 8px 11px; border-radius: 10px; background: rgba(255, 203, 46, 0.08); border: 1px solid rgba(255, 203, 46, 0.3); color: var(--brand-text, #FFD95C); font-size: 12px; font-weight: 600; line-height: 1.45; margin-top: 6px; }
.atWarnT { color: var(--brand-text, #FFD95C) !important; }

/* статистика */
.atStats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.atStat { background: var(--cx-bg2); border-radius: 12px; padding: 8px 10px; min-width: 0; }
.atStat span { display: block; font-size: 10.5px; font-weight: 700; color: var(--cx-dim); margin-bottom: 2px; }
.atStat b { font: 800 13.5px 'JetBrains Mono', monospace; white-space: nowrap; }

.atViews { margin: 2px 0 0; }

/* вкладки настроек */
.atTabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--cx-line); margin-bottom: 12px; }
.atTabs button { border: 0; background: transparent; padding: 9px 0; font-size: 12.5px; font-weight: 700; color: var(--cx-dim); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.atTabs button:hover { color: var(--cx-txt); }
.atTabs button.is-on { color: var(--brand-text, #FFD95C); border-bottom-color: var(--brand, #FFCB2E); }

.atField { display: block; margin-bottom: 10px; min-width: 0; }
.atField > span { display: block; font-size: 11.5px; font-weight: 700; color: var(--cx-dim); margin-bottom: 4px; line-height: 1.3; }
.atField small, .atHint { display: block; font-size: 11px; font-weight: 600; line-height: 1.45; color: var(--cx-dim); margin-top: 5px; }
.atField .tcIn { height: 38px; font-size: 14px; }
.atGrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; align-items: end; }
.atLbl { font-size: 11.5px; font-weight: 700; color: var(--cx-dim); margin: 10px 0 5px; }
.atSeg { flex-wrap: nowrap; }
.atSeg button { padding: 8px 4px; font-size: 12px; min-width: 0; white-space: normal; line-height: 1.2; }
.atLink { border: 0; background: transparent; padding: 6px 0; color: var(--brand, #FFCB2E); font-size: 12.5px; font-weight: 700; }

/* карточки стратегий */
.atCard { background: var(--cx-bg2); border: 1px solid transparent; border-radius: 12px; padding: 10px 11px; margin-bottom: 8px; cursor: pointer; }
.atCard.is-on { border-color: var(--brand-line, rgba(255, 203, 46, 0.42)); background: rgba(255, 203, 46, 0.05); }
.atCard__h { display: flex; align-items: center; gap: 8px; }
.atCard__h b { font-family: var(--f-display, 'Unbounded', sans-serif); font-weight: 600; font-size: 13px; }
.atCard__h em { font-style: normal; font-size: 10.5px; font-weight: 700; color: var(--cx-dim); background: rgba(255, 255, 255, 0.06); padding: 2px 6px; border-radius: 6px; }
.atI { margin-left: auto; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--cx-line); background: transparent; color: var(--cx-dim); font: 700 11px 'JetBrains Mono', monospace; }
.atCard__t { margin: 8px 0 0; font-size: 12px; font-weight: 600; line-height: 1.5; color: var(--cx-dim); }

.atBack { margin-top: 8px; }
.atBack__wait { font-size: 11.5px; font-weight: 600; color: var(--cx-dim); line-height: 1.45; }
.atBar { position: relative; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.07); margin-bottom: 6px; }
.atBar__fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--violet, #9B87FF); }
.atBar__be { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--brand, #FFCB2E); }
.atBack__row { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; font-weight: 600; color: var(--cx-dim); }
.atBack__row b { font-family: 'JetBrains Mono', monospace; color: var(--cx-txt); }
.atBack__row--m { margin-top: 6px; }
.atBack__t { margin: 5px 0 0; font-size: 11.5px; font-weight: 600; line-height: 1.45; color: var(--cx-txt); }
.atBack__s { margin: 5px 0 0; font-size: 10.5px; font-weight: 600; line-height: 1.4; color: var(--cx-dim); }

/* правила */
.atRule { background: var(--cx-bg2); border-radius: 12px; padding: 9px 10px; margin-bottom: 8px; }
.atRule__h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.atInline { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; }
.atInline .tcIn { width: 48px; height: 32px; font-size: 13px; padding: 0 4px; }
.atX { border: 0; background: transparent; color: var(--cx-dim); font-size: 18px; line-height: 1; width: 26px; height: 26px; }
.atX:hover { color: var(--cx-txt); }
.atRule .atSeg { margin-bottom: 8px; background: var(--cx-bg0); }
.atRule .atField { margin-bottom: 0; }
.atRule .atGrid { align-items: start; }

.atTbl { width: 100%; border-collapse: collapse; font: 600 11.5px 'JetBrains Mono', monospace; margin-top: 10px; }
.atTbl th { text-align: right; font: 700 10.5px Manrope, sans-serif; color: var(--cx-dim); padding: 3px 4px; }
.atTbl td { text-align: right; padding: 4px; border-top: 1px solid var(--cx-line); }
.atTbl th:first-child, .atTbl td:first-child { text-align: left; }

/* область поиска */
.atChips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.atChips--pairs { max-height: 168px; overflow-y: auto; }
.atChips button { border: 1px solid var(--cx-line); background: transparent; border-radius: 9px; padding: 6px 9px; font-size: 12px; font-weight: 700; color: var(--cx-dim); }
.atChips button i { font-style: normal; font-family: 'JetBrains Mono', monospace; font-size: 10.5px; }
.atChips button.is-on { background: rgba(255, 203, 46, 0.14); border-color: var(--brand-line, rgba(255, 203, 46, 0.42)); color: var(--brand-text, #FFD95C); }
.atCount { margin-top: 10px; padding: 8px 10px; border-radius: 10px; background: var(--cx-bg2); font-size: 12px; font-weight: 600; line-height: 1.5; color: var(--cx-dim); }
.atCount b { font-family: 'JetBrains Mono', monospace; color: var(--cx-txt); }

/* сводка */
.atSum { margin-top: 12px; padding: 9px 11px; background: var(--cx-bg2); border-radius: 12px; display: flex; flex-direction: column; gap: 5px; }
.atSum > div { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 11.5px; font-weight: 600; color: var(--cx-dim); }
.atSum b { font: 700 12px 'JetBrains Mono', monospace; color: var(--cx-txt); white-space: nowrap; }
.atSum b.atDown { color: var(--cx-down); }
.atFail { margin: 8px 0 0; }
.atFail b { color: var(--cx-txt); }
.atApply { display: flex; gap: 8px; margin-top: 10px; }
.atApply .tmBtn { height: 38px; font-size: 13px; }
.tm .tmBtn[disabled], .tm .atSeg button[disabled], .tm .atAcc button[disabled] { opacity: 0.45; cursor: default; }

/* журнал */
.atH { margin: 12px 0 6px; font-size: 11.5px; font-weight: 700; color: var(--cx-dim); }
.atOpen { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; column-gap: 8px; align-items: center; padding: 8px 10px; border-radius: 12px; background: var(--cx-bg2); font-size: 13px; }
.atOpen b { grid-column: 2; }
.atOpen i { grid-column: 2; font-style: normal; font-size: 11px; font-weight: 600; color: var(--cx-dim); }
.atOpen em { grid-column: 3; grid-row: 1 / span 2; font: 800 15px 'JetBrains Mono', monospace; font-style: normal; }
.atDir { grid-row: 1 / span 2; font-size: 14px; }
.atDir--call { color: var(--cx-up); }
.atDir--put { color: var(--cx-down); }
.atSers { display: flex; flex-direction: column; gap: 4px; }
.atSer { display: flex; justify-content: space-between; gap: 8px; align-items: center; background: var(--cx-bg2); border-radius: 9px; padding: 6px 10px; font-size: 12px; font-weight: 600; }
.atSer > b { font: 700 12px 'JetBrains Mono', monospace; }
.atSer--past { margin-bottom: 5px; font-size: 11.5px; color: var(--cx-dim); line-height: 1.5; }
.atSer--past span b { color: var(--cx-txt); font-size: 12px; }
.atLogs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.atLog { padding: 6px 9px; border-left: 2px solid var(--cx-line); font-size: 11.5px; font-weight: 600; line-height: 1.45; }
.atLog span { display: block; font: 700 10px 'JetBrains Mono', monospace; color: var(--cx-dim); margin-bottom: 1px; }
.atLog--trade { border-left-color: var(--violet, #9B87FF); }
.atLog--stop, .atLog--pause, .atLog--decision { border-left-color: var(--brand, #FFCB2E); }
.atLog--skip { color: var(--cx-dim); }

/* низ панели: кнопки всегда на виду */
.atFoot { flex: none; padding: 10px 14px calc(14px + env(safe-area-inset-bottom, 0px)); background: #0D121F; border-top: 1px solid var(--cx-line); display: flex; flex-wrap: wrap; gap: 8px; }
.atFoot .tmBtn { height: 48px; min-width: 0; }
.atAcc { flex-basis: 100%; flex-wrap: nowrap; }
.atAcc button { padding: 7px 6px; font-size: 12px; }
.atGo { background: var(--brand, #FFCB2E); color: var(--brand-ink, #1A1400); border-color: transparent; }
.atGo:not([disabled]):hover { filter: brightness(1.06); border-color: transparent; }
.atStop { flex: 2; background: var(--cx-down); color: #1C0606; border-color: transparent; font-size: 16px; }
.atStop:hover { filter: brightness(1.08); border-color: transparent; }
.atConfirm { flex-basis: 100%; font-size: 12.5px; font-weight: 600; line-height: 1.45; }

/* метка на графике */
.atChip { position: absolute; z-index: 7; left: 12px; bottom: 36px; display: flex; align-items: center; gap: 8px; max-width: calc(100% - 100px); padding: 6px 6px 6px 10px; border-radius: 11px; background: #13192A; border: 1px solid var(--cx-line); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); font-size: 12px; cursor: pointer; white-space: nowrap; }
.atChip i { font-style: normal; font-weight: 600; color: var(--cx-dim); overflow: hidden; text-overflow: ellipsis; }
.atChip em { font: 700 12px 'JetBrains Mono', monospace; font-style: normal; }
.atChip button { flex: none; border: 0; border-radius: 8px; height: 30px; padding: 0 12px; background: var(--cx-down); color: #1C0606; font-weight: 800; font-size: 12.5px; }

@media (max-width: 899px) {
  .atField .tcIn { height: 42px; }
  .atSeg button, .atTabs button { min-height: 40px; }
}

/* сделки и разбор запуска */
.atStats--mini { margin-top: 8px; }
.atStats--mini .atStat span { line-height: 1.25; }
.atTbl--deals { margin-top: 4px; table-layout: fixed; }
.atTbl--deals th:nth-child(1), .atTbl--deals td:nth-child(1) { width: 58px; }
.atTbl--deals th:nth-child(2), .atTbl--deals td:nth-child(2) { text-align: left; }
.atTbl--deals th:nth-child(3), .atTbl--deals td:nth-child(3) { width: 44px; white-space: nowrap; }
.atTbl--deals th:nth-child(4), .atTbl--deals td:nth-child(4) { width: 54px; }
.atTbl--deals th:nth-child(5), .atTbl--deals td:nth-child(5) { width: 68px; }
.atTd--pair { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: Manrope, sans-serif; }
.atTd--pair .atDir { margin-right: 4px; font-size: 9px; }
.atTbl--deals small { display: block; font: 600 9.5px Manrope, sans-serif; color: var(--cx-dim); }
.atDim { color: var(--cx-dim); }
.atSer--btn { width: 100%; border: 0; cursor: pointer; text-align: left; color: var(--cx-dim); font-family: inherit; }
.atSer--btn:hover { outline: 1px solid var(--cx-line); }
.atSer--head { margin-top: 8px; }
