/* Лента идей: новая карточка и три группы (#271). Макет A v4 одобрен 13.10.2026.
   Минимумы из ревью UI: текст данных ≥ 12px, кнопки ≥ 32px (тач — 44px), цены без
   обрезки, статус — иконка и текст. Старые стили .tgs-card остаются для «Обзора». */

/* ── Группы ─────────────────────────────────────────────────────────── */
.tgs-list > .tgf-h, .tgs-list > .tgf-grid, .tgs-list > .tgf-closed { grid-column: 1 / -1; }
.tgf-h { display: flex; align-items: baseline; gap: 8px; margin: 14px 0 2px; font-size: 15px; font-weight: 700; color: #e6edf3; }
.tgs-list > .tgf-h:first-child { margin-top: 0; }
.tgf-cnt { color: #8b949e; font-weight: 400; }
.tgf-hint { color: #6e7681; font-weight: 400; font-size: 12px; }
.tgf-toggle { margin-left: auto; }
.tgf-grid {
    display: grid; gap: 12px; align-items: stretch;
    grid-template-columns: repeat(auto-fill, minmax(min(400px, 100%), 1fr));
}
.tgf-closed { background: var(--bg-card); border: 1px solid rgba(255,255,255,0.07); border-radius: 12px; overflow: hidden; }
.tgf-crow {
    display: grid; grid-template-columns: 200px 160px 64px 64px 84px 1fr 16px; gap: 10px; align-items: center;
    padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,0.06); cursor: pointer; font-size: 14px;
}
.tgf-crow:hover { background: rgba(255,255,255,0.03); }
.tgf-crow:focus-visible { outline: 2px solid rgba(var(--brand-gold-rgb), 0.6); outline-offset: -2px; }
.tgf-num { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-variant-numeric: tabular-nums; }
.tgf-src { color: #8b949e; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tgf-chev { color: #6e7681; transition: transform .15s; }
.tgf-crow.open .tgf-chev { transform: rotate(90deg); }
.tgf-cexp { padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,0.06); background: rgba(255,255,255,0.02); }
.tgf-cexp .tgs-card.tgc { max-width: 480px; }
.tgf-tag { justify-self: start; display: inline-block; border-radius: 6px; padding: 2px 8px; font-size: 12px; font-weight: 600; white-space: nowrap; }
@media (max-width: 640px) {
    .tgf-crow { grid-template-columns: 1fr auto auto 16px; }
    .tgf-hm { display: none; }
}

/* ── Карточка ───────────────────────────────────────────────────────── */
.tgs-card.tgc { padding: 0; gap: 0; border-left-width: 1px; border-radius: 12px; overflow: hidden; }
.tgs-card.tgc:hover { transform: none; }
.tgc-body { display: flex; flex-direction: column; flex: 1; padding: 12px 14px 14px; }
.tgc-status { display: flex; align-items: center; gap: 8px; padding: 7px 14px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.tgc-status svg { flex: none; }
.tgc-why { margin-left: auto; font-weight: 400; opacity: .85; font-size: 12px; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tgc-s-active  { background: rgba(63,185,80,0.14);  color: #3fb950; }
.tgc-s-missed  { background: rgba(var(--brand-gold-rgb), 0.14);  color: var(--brand-gold); }
.tgc-s-unknown { background: rgba(139,148,158,0.1); color: #8b949e; }
.tgc-s-hit, .tgc-running { background: rgba(88,166,255,0.14); color: #58a6ff; }
.tgc-s-stopped, .tgc-s-stale { background: rgba(248,81,73,0.14); color: #f85149; }
.tgc-s-broken  { background: rgba(163,113,247,0.14); color: #a371f7; }
.tgc-s-closed  { background: rgba(139,148,158,0.12); color: #8b949e; }
.tgc-prog { display: inline-flex; gap: 3px; margin-left: 4px; }
.tgc-prog i { width: 14px; height: 5px; border-radius: 2px; background: rgba(88,166,255,0.25); }
.tgc-prog i.on { background: #58a6ff; }
.tgs-card.tgc-closed .tgc-body { opacity: .7; }

.tgc-head { display: flex; align-items: center; gap: 8px; }
.tgc-who { display: flex; flex-direction: column; min-width: 0; }
.tgc-sym { display: flex; align-items: center; gap: 8px; }
.tgc-sym b { font-size: 17px; color: #e6edf3; letter-spacing: .2px; }
.tgc-src { color: #8b949e; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tgc-tools { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.tgc-ib {
    width: 32px; height: 32px; border-radius: 7px; border: 1px solid rgba(255,255,255,0.1); background: var(--bg-tile);
    color: #8b949e; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-size: 14px; list-style: none;
    margin: 0; padding: 0;
}
.tgc-ib::-webkit-details-marker { display: none; }
.tgc-ib:hover, .tgc-ib.on { color: var(--brand-gold); border-color: rgba(var(--brand-gold-rgb), 0.5); }
.tgc-more { position: relative; }
.tgc-menu {
    position: absolute; right: 0; top: 36px; z-index: 20; min-width: 200px; padding: 8px; display: flex; flex-direction: column; gap: 6px;
    background: var(--bg-tile); border: 1px solid rgba(255,255,255,0.12); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.tgc-menu .tgs-ex-links { display: flex; gap: 6px; }
.tgc-menu .tgs-ex { min-width: 44px; min-height: 32px; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; }
.tgc-menu-btn { min-height: 32px; text-align: left; background: none; border: 0; color: #e6edf3; padding: 6px 4px; font-size: 13px; cursor: pointer; border-radius: 6px; }
.tgc-menu-btn:hover { background: rgba(255,255,255,0.05); }

.tgc-badges { display: flex; gap: 6px; flex-wrap: nowrap; overflow: hidden; min-height: 26px; margin-top: 8px; }
.tgc-badges .tgs-ctx { white-space: nowrap; flex: none; font-size: 12px; padding: 3px 8px; }
.tgs-ctx.tgc-more { background: transparent; border: 1px dashed rgba(255,255,255,0.15); color: #8b949e; }

.tgc-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0 4px; }
.tgc-kpi, .tgc-tile { background: var(--bg-tile); border-radius: 8px; padding: 8px 10px; min-width: 0; }
.tgc-kpi small, .tgc-tile small, .tgc-sec > small { display: block; color: #8b949e; font-size: 12px; }
.tgc-kpi b { display: block; font-size: 22px; line-height: 1.25; white-space: nowrap; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.tgc-kpi span, .tgc-tile span { display: block; font-size: 12px; color: #6e7681; }
.tgs-card.tgc .tgs-scale { margin: 10px 4px 14px; }
.tgs-card.tgc .tgs-axis { font-size: 11px; }

.tgc-levels, .tgc-risk { display: grid; gap: 8px; margin-top: 8px; }
.tgc-levels, .tgc-risk-2 { grid-template-columns: 1fr 1fr; }
.tgc-risk { grid-template-columns: repeat(3, 1fr); }
.tgc-tile b { display: block; font-size: 17px; line-height: 1.35; white-space: nowrap; color: #e6edf3; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.tgc-sl b { color: #f85149; }
.tgc-lev-bad b { color: #f85149; }
.tgc-tile.tgc-risk-over { background: rgba(248,81,73,0.10); border: 1px solid rgba(248,81,73,0.4); }
.tgc-risk-over b { color: #f85149; }
.tgc-risk-over span { color: #f0918b; }
/* «Моя сделка» — цифра лично под трейдера, в цвет кнопки входа (#276) */
.tgc-tile.tgc-mytrade { background: rgba(var(--brand-gold-rgb), 0.10); border: 1px solid rgba(var(--brand-gold-rgb), 0.45); }
.tgc-mytrade small { color: var(--brand-gold); font-weight: 600; }
.tgc-mytrade b { color: #ffd27a; font-size: 19px; }
.tgc-mytrade span { color: #b8a27a; }
.tgc-tile.tgc-mytrade-off { background: var(--bg-tile); border: 1px dashed rgba(255,255,255,0.15); }
.tgc-mytrade-off small, .tgc-mytrade-off b { color: #8b949e; }
.tgc-mytrade-off span { color: #8b949e; }
.tgc-synth { color: #6e7681; font-style: italic; font-size: 12px; cursor: help; }

.tgc-sec { margin-top: 10px; }
.tgc-tps { display: grid; grid-template-columns: repeat(3, 1fr) auto; gap: 6px; min-height: 52px; margin-top: 4px; }
.tgc-tp { display: flex; flex-direction: column; background: var(--bg-tile); border-radius: 6px; padding: 5px 8px; line-height: 1.3; min-width: 0; }
.tgc-tp i { font-style: normal; color: #8b949e; font-size: 11px; }
.tgc-tp b { font-size: 13px; color: #e6edf3; white-space: nowrap; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.tgc-tp em { font-style: normal; font-size: 11px; }
.tgc-tp.tgc-more { align-items: center; justify-content: center; min-width: 36px; background: transparent; border: 1px dashed rgba(255,255,255,0.15); color: #8b949e; }
.tgc-tp-empty { grid-column: 1 / -1; color: #6e7681; font-size: 13px; line-height: 52px; }

.tgc-acts { display: grid; grid-template-columns: 2fr 1fr; gap: 8px; margin-top: auto; padding-top: 12px; }
.tgc-acts:has(> :only-child) { grid-template-columns: 1fr; }
.tgc-btn { height: 44px; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; padding: 0 12px; }
.tgc-primary { background: var(--brand-gold); border: 1px solid var(--brand-gold); color: #111; }
.tgc-primary:hover:not(:disabled) { background: #f0a90d; }
.tgc-primary:disabled { background: transparent; color: #6e7681; border-color: rgba(255,255,255,0.1); cursor: not-allowed; }
.tgc-limit-warn { grid-column: 1 / -1; font-size: 12px; color: var(--brand-gold); background: rgba(var(--brand-gold-rgb), 0.10); border-radius: 6px; padding: 5px 8px; }
.tgc-primary.tgc-primary-warn { background: transparent; color: var(--brand-gold); border: 1px dashed var(--brand-gold); }
.tgc-second { background: transparent; border: 1px solid rgba(var(--brand-gold-rgb), 0.45); color: var(--brand-gold); }
.tgc-btn:focus-visible, .tgc-ib:focus-visible { outline: 2px solid rgba(var(--brand-gold-rgb), 0.6); outline-offset: 2px; }

@media (max-width: 480px) {
    .tgc-kpi b { font-size: 19px; }
    .tgc-risk { grid-template-columns: 1fr 1fr; }
    .tgc-risk .tgc-tile:nth-child(3) { grid-column: 1 / -1; }
    .tgc-tile b { font-size: 16px; }
}
/* Две кнопки в ряд на узкой карточке («Обзор» на телефоне — ~300 px) обрезали
   вторую (nowrap). Условие — ширина карточки (контейнер — .tgs-card), а не окна */
@container (max-width: 360px) { .tgc-acts { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .tgf-chev { transition: none; } }

/* ── «Кандидаты» (#383): старты пампа и слива в «Анализе» ──────────────
   Сторона — сплошной шапкой со словом и стрелкой: цвет не единственный признак */
.pcand-section { margin-top: 18px; }
.pcand-section[hidden] { display: none; }
.pcand-bar { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 6px 0 10px; }
.pcand-grp { margin: 0; gap: 4px; }
.pcand-grp > span { color: #8b949e; margin-right: 2px; }
.pcand-groups > .tgf-h:first-child { margin-top: 0; }
.pcand-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); }
.pcand-card { background: var(--bg-card); border: 1px solid rgba(255,255,255,0.07); border-radius: 10px; overflow: hidden; min-width: 0; }
.pcand-card.pcand-miss { opacity: .55; }
.pcand-ex { margin-left: auto; gap: 6px; }
.pcand-ex .tgs-ex { min-width: 36px; min-height: 32px; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; opacity: .7; }
.pcand-ex .tgs-ex.pcand-ex-here { opacity: 1; box-shadow: 0 0 0 1px currentColor inset; }
.pcand-ex .tgs-ex:hover, .pcand-ex .tgs-ex:focus-visible { opacity: 1; }
.pcand-hd { display: flex; justify-content: space-between; gap: 8px; padding: 6px 12px; font-size: 12px; font-weight: 700; letter-spacing: .06em; color: #fff; white-space: nowrap; }
.pcand-pump .pcand-hd { background: #238636; }
.pcand-dump .pcand-hd { background: #da3633; }
.pcand-st { font-weight: 600; letter-spacing: 0; }
.pcand-in { padding: 10px 12px 12px; }
.pcand-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-width: 0; }
.pcand-sym { font-size: 16px; color: #e6edf3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pcand-rank { flex: none; font-size: 12px; padding: 1px 7px; border-radius: 8px; background: var(--bg-track); color: #9aa6b4; }
.pcand-rank.pcand-top { background: #d29922; color: #111; font-weight: 600; }
.pcand-mut { color: #8b949e; font-size: 12px; margin-top: 3px; }
.pcand-row .pcand-mut { margin-top: 0; text-align: right; }
.pcand-prog { height: 5px; background: var(--bg-track); border-radius: 3px; margin: 8px 0 6px; overflow: hidden; }
.pcand-prog i { display: block; height: 100%; border-radius: 3px; }
.pcand-pump .pcand-prog i { background: #3fb950; }
.pcand-dump .pcand-prog i { background: #f85149; }
.pcand-move { font-size: 13px; font-weight: 600; white-space: nowrap; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.pcand-pump .pcand-move { color: #3fb950; }
.pcand-dump .pcand-move { color: #f85149; }
.pcand-more { display: flex; justify-content: center; margin-top: 10px; }
.pcand-more-btn { min-height: 32px; padding: 4px 14px; }
.pcand-note { margin-top: 8px; color: #8b949e; font-size: 12px; }
.pcand-note b { color: var(--brand-gold); font-weight: 600; }
