/* CryptoTracker.Pro — Gabinete Psicológico del Trader (Simulación Real & Disciplina Mental) */
body.psy-modal-open { overflow: hidden; }

.psy-overlay {
  position: fixed; inset: 0; z-index: 10050;
  display: none; align-items: center; justify-content: center;
  padding: max(12px, env(safe-area-inset-top, 0px)) 12px max(12px, env(safe-area-inset-bottom, 0px));
  background: rgba(3, 6, 14, 0.78);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.psy-overlay.open { display: flex; animation: psyFade .2s ease; }
@keyframes psyFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes psyRise { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }

.psy-modal {
  width: 100%; max-width: 580px; max-height: 92vh;
  overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  background: linear-gradient(180deg, #111a30 0%, #0b1222 100%);
  border: 1px solid var(--glass-border, rgba(255,255,255,.09));
  border-radius: 18px; padding: 18px 18px 16px;
  box-shadow: 0 24px 70px rgba(0,0,0,.55);
  color: var(--text-primary, #e8edf5);
  font-family: var(--font-family, inherit);
  animation: psyRise .28s cubic-bezier(.16,1,.3,1);
  -webkit-user-select: none; user-select: none;
}
.psy-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.psy-modal-kicker { font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; color: var(--text-secondary, #8896ae); font-weight: 600; }
.psy-close { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); color: var(--text-secondary,#8896ae); width: 30px; height: 30px; border-radius: 50%; font-size: 1.1rem; cursor: pointer; line-height: 1; }
.psy-close:hover { color: #fff; }

.psy-intact-banner {
  margin: 10px 0 6px;
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #bbf7d0;
  font-size: .78rem;
  line-height: 1.4;
}

.psy-progress { display: flex; gap: 6px; margin: 10px 0 10px; }
.psy-progress-dot { flex: 1; height: 4px; border-radius: 4px; background: rgba(255,255,255,.08); }
.psy-progress-dot.done { background: #6366f1; }
.psy-progress-dot.active { background: linear-gradient(90deg, #6366f1, #22d3ee); }

.psy-title { font-size: 1.04rem; margin: 4px 0 4px; font-weight: 700; line-height: 1.3; }
.psy-sub { font-size: .8rem; color: var(--text-secondary, #8896ae); margin: 0 0 12px; line-height: 1.45; }
.psy-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-label,#6b7f9a); font-weight: 700; margin: 16px 0 8px; }

.psy-options, .psy-checks { display: flex; flex-direction: column; gap: 8px; }
.psy-option, .psy-check {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 10px 12px; border-radius: 12px; cursor: pointer;
  background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.07);
  color: inherit; font: inherit; transition: border-color .15s, background .15s, transform .1s;
}
.psy-option:hover, .psy-check:hover { border-color: rgba(255,255,255,.16); }
.psy-option:active, .psy-check:active { transform: scale(.99); }
.psy-option.selected, .psy-check.checked { border-color: #6366f1; background: rgba(99,102,241,.14); }
.psy-option-icon, .psy-check-icon { font-size: 1.35rem; flex-shrink: 0; }
.psy-option-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.psy-option-text strong { font-size: .88rem; }
.psy-option-text small { font-size: .75rem; color: var(--text-secondary,#8896ae); line-height: 1.35; }
.psy-check-box { width: 22px; height: 22px; border-radius: 6px; border: 2px solid rgba(255,255,255,.2); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; color: #fff; flex-shrink: 0; font-size: .8rem; }
.psy-check.checked .psy-check-box { background: #6366f1; border-color: #6366f1; }

.psy-tension { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.psy-tension-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border-radius: 10px; background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.07); color: inherit; cursor: pointer; font: inherit; }
.psy-tension-num { font-size: 1rem; font-weight: 800; }
.psy-tension-lbl { font-size: .62rem; color: var(--text-secondary,#8896ae); text-align: center; line-height: 1.2; }
.psy-tension-btn.t1.selected { background: rgba(34,197,94,.18); border-color: #22c55e; }
.psy-tension-btn.t2.selected { background: rgba(132,204,22,.18); border-color: #84cc16; }
.psy-tension-btn.t3.selected { background: rgba(245,158,11,.18); border-color: #f59e0b; }
.psy-tension-btn.t4.selected { background: rgba(249,115,22,.18); border-color: #f97316; }
.psy-tension-btn.t5.selected { background: rgba(239,68,68,.2); border-color: #ef4444; }

.psy-risk-box { border-radius: 14px; padding: 14px; border: 1px solid; }
.psy-risk-box.ok { background: rgba(34,197,94,.08); border-color: rgba(34,197,94,.3); }
.psy-risk-box.danger { background: rgba(239,68,68,.08); border-color: rgba(239,68,68,.35); }
.psy-risk-line { font-size: .82rem; color: var(--text-secondary,#8896ae); }
.psy-risk-amount { font-size: 1.65rem; font-weight: 800; margin: 6px 0; color: #22c55e; }
.psy-risk-amount span { font-size: .8rem; font-weight: 600; color: var(--text-secondary,#8896ae); }
.psy-risk-rule { font-size: .78rem; line-height: 1.45; color: var(--text-primary,#e8edf5); }

.psy-footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 16px; }
.psy-btn { padding: 10px 16px; border-radius: 11px; font: inherit; font-size: .84rem; font-weight: 700; cursor: pointer; border: 1px solid transparent; }
.psy-btn.primary { background: linear-gradient(135deg, #6366f1, #4f46e5); color: #fff; box-shadow: 0 6px 18px rgba(99,102,241,.35); }
.psy-btn.primary:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }
.psy-btn.ghost { background: rgba(255,255,255,.04); color: var(--text-secondary,#8896ae); border-color: rgba(255,255,255,.1); }
.psy-btn.ghost:hover { color: #fff; border-color: rgba(255,255,255,.22); }
.psy-btn.small { padding: 6px 11px; font-size: .73rem; }

.psy-result { display: flex; align-items: center; gap: 16px; margin: 6px 0 4px; }
.psy-gauge { --pdi: 0; --c: #ef4444; width: 96px; height: 96px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  background: conic-gradient(var(--c) calc(var(--pdi) * 1%), rgba(255,255,255,.08) 0); }
.psy-gauge.mid { --c: #f59e0b; }
.psy-gauge.high { --c: #22c55e; }
.psy-gauge-inner { width: 76px; height: 76px; border-radius: 50%; background: #0d1527; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.psy-gauge-val { font-size: 1.6rem; font-weight: 800; line-height: 1; }
.psy-gauge-lbl { font-size: .62rem; color: var(--text-secondary,#8896ae); letter-spacing: .1em; }
.psy-result-arch { display: flex; gap: 10px; align-items: flex-start; }
.psy-arch-icon { font-size: 2rem; }
.psy-result-arch strong { font-size: 1rem; }
.psy-result-arch p { margin: 4px 0 0; font-size: .8rem; color: var(--text-secondary,#8896ae); line-height: 1.4; }
.psy-pdi-note { font-size: .72rem; color: var(--text-label,#6b7f9a); margin-bottom: 8px; }
.psy-rx { margin: 8px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.psy-rx li { font-size: .82rem; line-height: 1.5; padding: 10px 12px 10px 34px; position: relative; border-radius: 10px; background: rgba(255,255,255,.035); border-left: 3px solid #6366f1; }
.psy-rx li::before { content: '℞'; position: absolute; left: 12px; top: 9px; color: #a5b4fc; font-weight: 800; }
.psy-source { margin-top: 12px; font-size: .7rem; color: var(--text-label,#6b7f9a); font-style: italic; }

/* ---------- Cabinet card ---------- */
.psy-empty { padding: 18px; border-radius: 12px; background: rgba(255,255,255,.03); border: 1px dashed rgba(255,255,255,.12); font-size: .85rem; color: var(--text-secondary,#8896ae); text-align: center; }
.psy-cab-top { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.psy-cab-pdi { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.psy-cab-pdi small { font-size: .68rem; color: var(--text-label,#6b7f9a); }
.psy-cab-arch { flex: 1; min-width: 220px; }
.psy-cab-arch .psy-label { margin-top: 0; }
.psy-arch-big { font-size: 1.15rem; }
.psy-cab-arch p { margin: 4px 0 8px; font-size: .8rem; color: var(--text-secondary,#8896ae); line-height: 1.4; }
.psy-cab-flags { display: flex; flex-wrap: wrap; gap: 6px; }
.psy-flag { font-size: .72rem; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.06); color: var(--text-secondary,#8896ae); font-weight: 600; }
.psy-flag.good { background: rgba(34,197,94,.14); color: #86efac; }
.psy-flag.bad { background: rgba(239,68,68,.12); color: #fca5a5; }

.psy-narrative-box {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(99,102,241,.10), rgba(15,23,42,.65));
  border: 1px solid rgba(99,102,241,.28);
}
.psy-narrative-title {
  font-size: .86rem;
  font-weight: 800;
  color: #c7d2fe;
  margin-bottom: 8px;
}
.psy-narrative-box p {
  margin: 6px 0;
  font-size: .8rem;
  line-height: 1.5;
  color: var(--text-primary, #e8edf5);
}

.psy-ops-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.psy-op-card {
  padding: 13px 14px;
  border-radius: 13px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.psy-op-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.psy-op-asset {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.psy-op-asset strong { font-size: .92rem; }
.psy-op-sym { color: var(--text-secondary,#8896ae); font-weight: 600; }
.psy-op-date { font-size: .72rem; color: var(--text-secondary,#8896ae); }
.psy-op-badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.psy-cond-badge {
  font-size: .72rem;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 8px;
}
.psy-cond-badge.cond-good { background: rgba(34,197,94,.14); color: #86efac; border: 1px solid rgba(34,197,94,.3); }
.psy-cond-badge.cond-warn { background: rgba(245,158,11,.14); color: #fcd34d; border: 1px solid rgba(245,158,11,.3); }
.psy-cond-badge.cond-neutral { background: rgba(56,189,248,.12); color: #7dd3fc; border: 1px solid rgba(56,189,248,.28); }

.psy-op-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 9px 11px;
  border-radius: 10px;
  background: rgba(0,0,0,.25);
}
.psy-op-metrics div { display: flex; flex-direction: column; gap: 2px; }
.psy-op-metrics small { font-size: .67rem; color: var(--text-label,#6b7f9a); text-transform: uppercase; }
.psy-op-metrics strong { font-size: .83rem; }

.psy-op-conditions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: .77rem;
  color: var(--text-secondary,#8896ae);
  line-height: 1.4;
}
.psy-op-conditions strong { color: var(--text-primary,#e8edf5); }

.psy-op-diag {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,.06);
  font-size: .77rem;
  line-height: 1.45;
  color: #cbd5e1;
}

.psy-buckets { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.psy-bucket { padding: 12px; border-radius: 12px; border: 1px solid rgba(255,255,255,.07); background: rgba(255,255,255,.03); }
.psy-bucket.disc { border-color: rgba(34,197,94,.25); }
.psy-bucket.imp { border-color: rgba(239,68,68,.25); }
.psy-bucket-title { font-size: .78rem; font-weight: 700; }
.psy-bucket-pnl { font-size: 1.25rem; font-weight: 800; margin: 6px 0 2px; }
.psy-bucket-meta { font-size: .7rem; color: var(--text-label,#6b7f9a); }
.pos { color: #22c55e; } .neg { color: #ef4444; }

.psy-trig-bars { display: flex; flex-direction: column; gap: 7px; }
.psy-trig-row { display: grid; grid-template-columns: minmax(140px, 1.4fr) 2fr 85px; gap: 8px; align-items: center; font-size: .76rem; }
.psy-trig-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-secondary,#8896ae); }
.psy-trig-track { height: 8px; border-radius: 6px; background: rgba(255,255,255,.06); overflow: hidden; }
.psy-trig-fill { display: block; height: 100%; border-radius: 6px; background: #6366f1; }
.psy-trig-fill.trig-plan { background: #22c55e; }
.psy-trig-fill.trig-support { background: #10b981; }
.psy-trig-fill.trig-conviction { background: #6366f1; }
.psy-trig-fill.trig-tip { background: #38bdf8; }
.psy-trig-fill.trig-fomo { background: #f97316; }
.psy-trig-fill.trig-revenge { background: #ef4444; }
.psy-trig-pct { text-align: right; font-weight: 700; }

.psy-log-pdi { font-weight: 700; text-align: center; border-radius: 6px; padding: 3px 8px; font-size: .72rem; }
.psy-log-pdi.pdi-high { color: #22c55e; background: rgba(34,197,94,.12); }
.psy-log-pdi.pdi-mid { color: #f59e0b; background: rgba(245,158,11,.12); }
.psy-log-pdi.pdi-low { color: #ef4444; background: rgba(239,68,68,.12); }
.psy-cab-actions { display: flex; justify-content: flex-end; margin-top: 12px; }

@media (max-width: 650px) {
  .psy-modal { padding: 14px 14px 12px; border-radius: 16px; }
  .psy-tension-lbl { font-size: .56rem; }
  .psy-buckets { grid-template-columns: 1fr; }
  .psy-op-metrics { grid-template-columns: 1fr 1fr; }
  .psy-op-diag { flex-direction: column; align-items: flex-start; }
}

/* v47 — KPI pills: Disciplina mental · Mente · Riesgo · Ejecución */
.psy-kpi-pills { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.psy-kpi-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(113, 113, 122, 0.4);
  background: rgba(24, 24, 27, 0.6);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  white-space: nowrap;
}
.psy-kpi-label { color: #a1a1aa; text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.66rem; }
.psy-kpi-val { color: #e4e4e7; font-weight: 700; }
.psy-kpi-dot { width: 6px; height: 6px; border-radius: 50%; background: #71717a; }
.psy-kpi-pill.good { border-color: rgba(52, 211, 153, 0.35); background: rgba(16, 185, 129, 0.08); }
.psy-kpi-pill.good .psy-kpi-dot { background: #34d399; }
.psy-kpi-pill.warn { border-color: rgba(251, 191, 36, 0.35); background: rgba(245, 158, 11, 0.08); }
.psy-kpi-pill.warn .psy-kpi-dot { background: #fbbf24; }
.psy-kpi-pill.bad { border-color: rgba(251, 113, 133, 0.35); background: rgba(225, 29, 72, 0.08); }
.psy-kpi-pill.bad .psy-kpi-dot { background: #fb7185; }
