/* Сводка «Мои сделки» (#300) — поверх классов ленты (feed-cards.css), карточки
   позиции (pos-cards.css) и блока цели (goals-v2.css). Старые кнопки (переключатели
   биржи и рынка, чипы сортировки и вида, массовое закрытие) — со своими id и
   обработчиками, здесь только вид внутри панели */
/* Бок — общий отступ колонки «Позиций» (--pos-col-pad, style.css): сводка, блок цели и
   карточки — одна колонка. Сверху — как padding сетки, снизу 0: зазор даёт сетка */
.mtv { margin: 16px var(--pos-col-pad, 20px) 0; }
@media (max-width: 600px) { .mtv { margin-top: 12px; } }
.mtv .tgc-head { justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 10px; }
.mtv-tools { display: flex !important; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0 !important; background: none !important; border: 0 !important; padding: 0 !important; }
.mtv-seg { display: inline-flex; border: 1px solid #30363d; border-radius: 8px; overflow: hidden; padding: 0 !important; gap: 0 !important; background: none !important; }
.mtv-seg button { background: none !important; border: 0 !important; border-radius: 0 !important; color: #8b949e !important; font-size: 12px !important;
    padding: 5px 12px !important; cursor: pointer; box-shadow: none !important; }
.mtv-seg .mt-cat-btn--active, .mtv-seg .mt-exch-btn--active { background: rgba(var(--brand-gold-rgb), .14) !important; color: var(--brand-gold) !important; }
.mtv-refresh i { font-size: 12px; }
.mtv-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mtv .tgc-kpis[hidden] { display: none; }

/* «Подробнее» — вкладки прежние (этап 2 переделает содержимое), кнопки — чипы */
.mtv .mt-panel-tabs { background: none; border: 0; padding: 0; margin: 0; }
.mtv .mt-panel-tab-hd { border: 0; padding: 0; margin-top: 12px; }
.mtv .pc-chip.gw-tab-btn { text-transform: none; letter-spacing: 0; font-size: 12px; }
.mtv .pc-chip.gw-tab-btn--active { color: var(--brand-gold); border-color: rgba(var(--brand-gold-rgb), .5); background: rgba(var(--brand-gold-rgb), .08); }
.mtv .mt-panel-pane { margin-top: 10px; }

/* Нижняя строка: сортировка и вид — слева, массовое закрытие — справа */
.mtv-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 14px !important; margin: 0 !important;
    border-top: 1px solid #21262d; background: none !important; }
.mtv-bar .sp { flex: 1; }
.mtv-sort, .mtv-act { display: flex; gap: 12px; align-items: center; }
.mtv-bar .mt-view-group { margin: 0; }
.mtv-bar .mt-view-label { color: #6e7681; font-size: 11px; }
.mtv-bar .filter-pill { font-size: 12px; }
.mtv-bar .mt-mass-btn { background: none; border: 1px solid rgba(248,81,73,.35); color: #f85149; border-radius: 8px; padding: 5px 10px; font-size: 12px; }
.mtv-bar .mt-mass-btn--all { background: rgba(248,81,73,.12); }

/* Загрузка: значения мерцают, подписи остаются */
.mtv--loading [data-mt] b, .mtv--loading [data-mt] .tgc-why { color: transparent !important; background: var(--bg-track); border-radius: 4px; animation: sk-shimmer 1.4s ease-in-out infinite; }

@media (max-width: 700px) {
    .mtv-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mtv-tiles .tgc-tile:nth-child(3) { grid-column: auto; }
}
@media (max-width: 600px) {
    .mtv-bar { display: grid; grid-template-columns: 1fr; gap: 8px; }
    .mtv-bar .sp { display: none; }
    /* сортировка и вид — одной строкой, листается пальцем */
    .mtv-sort { overflow-x: auto; white-space: nowrap; scrollbar-width: none; padding-bottom: 2px; }
    .mtv-sort::-webkit-scrollbar { display: none; }
    .mtv-sort .filter-pills { flex-wrap: nowrap !important; }
    .mtv-act { justify-content: flex-end; }
}
/* Телефон: переключатели не влезают в строку с заголовком — своей строкой, с переносом */
@media (max-width: 480px) {
    .mtv-tools { width: 100%; flex-wrap: wrap !important; }
    .mtv-seg button { padding: 5px 9px !important; }
}

/* ── Этап 2: вкладки «Подробнее» плитками (#300). Значения пишут прежние расчёты
   myTrades по тем же id; зоны (mt-risk-zone-*, mt-risk-val-*) — метки по смыслу ── */
.mtv .mtv-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-top: 10px; }
.mtv .mtv-grid .tgc-tile small { display: flex; justify-content: space-between; gap: 4px 6px; align-items: center; flex-wrap: wrap; }
.mtv .mt-risk-zone { font-style: normal; font-size: 11px; padding: 0 6px; border-radius: 6px; white-space: nowrap; color: #8b949e; background: var(--bg-track); }
.mtv .mt-risk-zone-safe   { color: #3fb950; background: rgba(63,185,80,.12); }
.mtv .mt-risk-zone-ok     { color: #8b949e; background: var(--bg-track); }
.mtv .mt-risk-zone-warn   { color: #d29922; background: rgba(210,153,34,.12); }
.mtv .mt-risk-zone-danger { color: #f85149; background: rgba(248,81,73,.12); }
.mtv .mt-risk-val-safe, .mtv .mt-risk-val-long { color: #3fb950 !important; }
.mtv .mt-risk-val-warn   { color: #d29922 !important; }
.mtv .mt-risk-val-danger, .mtv .mt-risk-val-short { color: #f85149 !important; }
.mtv .mt-risk-net { color: #6e7681 !important; font-size: 12px; text-align: left; margin: 0; padding: 0; background: none; }

/* Направление: шкала без своей рамки */
.mtv .mt-risk-dir-wrap { margin-top: 4px; }

/* Прогноз RR */
.mtv .mt-rr-forecast { margin-top: 12px; padding: 0; border: 0; background: none; }
.mtv .mt-rr-period-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
/* Подпись «Период» заменяется заголовком блока */
.mtv .mt-rr-period-row, .mtv .mt-rr-period-label { text-transform: none; letter-spacing: 0; }
.mtv .mt-rr-period-label { font-size: 0; }
.mtv .mt-rr-period-label::before { content: 'Прогноз RR'; color: #e6edf3; font-weight: 600; font-size: 13px; }
.mtv .mt-rr-period-btns { display: inline-flex; border: 1px solid #30363d; border-radius: 8px; overflow: hidden; gap: 0; }
.mtv .mt-rr-period-btn { background: none; border: 0; border-radius: 0; color: #8b949e; font-size: 12px; padding: 4px 10px; }
.mtv .mt-rr-period-btn.mt-rr-period-active { background: rgba(var(--brand-gold-rgb), .14); color: var(--brand-gold); }
.mtv .mt-rr-track { height: 6px; border-radius: 3px; background: var(--bg-track); }
.mtv .mt-rr-fill { background: var(--brand-gold); border-radius: 3px; }
.mtv .mt-rr-zone-mark { background: #e6edf3; opacity: .6; width: 2px; }
.mtv .mt-rr-tip { margin-top: 8px; padding: 8px 10px; background: var(--bg-inset); border: 0; border-left: 3px solid var(--brand-gold); border-radius: 4px; color: #8b949e; font-size: 12px; }
.mtv .mt-take-chips { display: grid !important; gap: 8px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 8px; }
.mtv .mt-take-chips[style*="none"] { display: none !important; }
.mtv .mt-take-chip { background: var(--bg-tile); border: 0; border-radius: 8px; padding: 8px 10px; text-align: left; align-items: flex-start; }
.mtv .mt-take-chip__label { color: #8b949e; font-size: 12px; text-transform: none; letter-spacing: 0; }
.mtv .mt-take-chip__val { font: 600 17px ui-monospace, Menlo, monospace; }
.mtv .mt-take-chip__hint { color: #6e7681; font-size: 12px; }

/* Фандинг */
.mtv .mt-ft-header { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 0; background: none; border: 0; margin-top: 4px; }
.mtv .mt-ft-title { color: #e6edf3; font-weight: 600; font-size: 13px; text-transform: none; letter-spacing: 0; }
.mtv .mt-ft-title i { display: none; }
.mtv .mt-ft-next, .mtv .mt-ft-per { color: #8b949e; font-size: 12px; }
.mtv .mt-ft-pt-val { font: 600 17px ui-monospace, Menlo, monospace; }
.mtv .mt-ft-recv { color: #3fb950 !important; } .mtv .mt-ft-pay { color: #f85149 !important; }
.mtv .mt-ft-breakdown { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.mtv .mt-ft-bk-item { background: var(--bg-inset); border-radius: 6px; padding: 3px 8px; font: 12px ui-monospace, Menlo, monospace; }

/* Хедж: прежнее содержимое (рекомендация, симуляция, нейтраль, советы) — плитками */
.mtv #mt-panel-hedge .mt-risk-metrics { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); background: none; border: 0; padding: 0; margin-top: 10px; }
.mtv #mt-panel-hedge .mt-risk-sep { display: none !important; }
.mtv .mhr-item, .mtv .mt-hs-block, .mtv .mt-hn-option, .mtv .mt-ha-card, .mtv .mt-hedge-summary > *, .mtv .mt-hn-header, .mtv .mt-ha-header {
    background: var(--bg-tile) !important; border: 1px solid transparent !important; border-radius: 8px !important; box-shadow: none !important; }
.mtv .mhr-item, .mtv .mt-hs-block, .mtv .mt-hn-option, .mtv .mt-ha-card { padding: 8px 10px !important; }
.mtv .mt-hn-option--good { border-color: rgba(var(--brand-gold-rgb), .5) !important; }
.mtv .mt-hn-option--dim { opacity: .75; }
.mtv .mt-hedge-sim, .mtv .mt-hedge-neutral, .mtv .mt-hedge-advice { margin-top: 10px; background: none !important; border: 0 !important; padding: 0 !important; }
.mtv .mhr-chip--main, .mtv .mt-hn-option button { background: var(--brand-gold) !important; color: #0b0f17 !important; border: 0 !important; border-radius: 8px !important; font-weight: 600; }

@media (max-width: 600px) {
    .mtv .mtv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mtv .mt-take-chips { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mtv .mt-rr-period-row { flex-wrap: wrap; }
}
/* Главная карточка хеджа: общее правило выше гасит все рамки !important — выделяем её, как --good у вариантов */
.mtv .mt-ha-card--main { border-color: rgba(var(--brand-gold-rgb), .5) !important; }
