/* Model training page (/model-training, super admins). Shared pieces (topbar, hero, .list, .trow,
   chips, glossary terms) come from app.css. */
.mt-user { font-size: 13px; }
.mt-page { padding-bottom: 48px; }
.mt-loading { padding: 48px 0; text-align: center; }
.mt-gate { margin: 64px auto; max-width: 520px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); line-height: 1.6; }
.mt-gate a { color: var(--accent); }
.mt-hero p { max-width: 720px; }
.mt-section { margin-top: 40px; }
.mt-section .sec-note { margin: -6px 0 14px; max-width: 760px; }

/* Stage dots: pass / mixed / fail / live / skip */
.stage { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.stage i { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--surface-3); }
.stage.is-pass i { background: var(--strong); }
.stage.is-mixed i { background: var(--conviction); }
.stage.is-fail i { background: var(--danger); }
.stage.is-live i { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); animation: mt-pulse 2s infinite; }
.stage.is-skip i { background: transparent; border: 1.5px dashed var(--line-2); }
.stage.is-skip em { color: var(--text-3); }
.stage em { font-style: normal; white-space: nowrap; }
@keyframes mt-pulse { 50% { box-shadow: 0 0 0 6px transparent; } }
@media (prefers-reduced-motion: reduce) { .stage.is-live i { animation: none; } }

/* Where each model stands */
.mt-pipe { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; }
.mt-pipe-row { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(4, minmax(0, 1fr)); gap: 12px; align-items: center; padding: 12px 20px; border-top: 1px solid var(--line); }
.mt-pipe-row:first-child { border-top: 0; }
.mt-pipe-head { font-size: 12px; font-weight: 500; color: var(--text-3); background: var(--surface-2); padding-block: 9px; }
.mt-pipe-row > a { text-decoration: none; color: inherit; min-width: 0; }
.mt-pipe-row > a b { display: block; font-size: 14.5px; font-weight: 650; }
.mt-pipe-row > a small { display: block; font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-pipe-row > a:hover b { color: var(--accent); }
.mt-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 2px 0; }
.mt-legend .stage { font-size: 12px; color: var(--text-3); white-space: nowrap; }

/* How a model earns its place */
.mt-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; counter-reset: none; }
.mt-steps li { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; gap: 12px; }
.mt-steps .n { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 700; }
.mt-steps b { font-size: 14.5px; }
.mt-steps p { margin: 6px 0 0; font-size: 13.5px; color: var(--text-2); line-height: 1.5; }
.mt-steps .why span { display: block; font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); margin-bottom: 2px; }
.mt-costs { margin-top: 12px; max-width: 820px; line-height: 1.6; }

/* Scorecards */
.mt-models { display: grid; gap: 16px; }
.mt-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 22px 24px; scroll-margin-top: 80px; }
.mt-card:target { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow); }
.mt-card header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 8px 12px; }
.mt-card header > div { min-width: 0; }
.mt-card h3 { margin: 0; font-size: 19px; letter-spacing: -.015em; }
.mt-card header .faint { font-size: 13px; }
.mt-card h4 { margin: 0 0 4px; font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); }
.mt-card p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--text-2); }
.mt-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 16px; }
.mt-status { flex: none; white-space: nowrap; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); }
.mt-status.st-live { background: var(--accent-soft); color: var(--accent); }
.mt-status.st-fail { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.mt-checks { width: 100%; border-collapse: collapse; margin-top: 18px; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.mt-checks caption { text-align: left; font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); padding-bottom: 6px; }
.mt-checks th { font-size: 12px; font-weight: 500; color: var(--text-3); text-align: left; padding: 6px 10px 6px 0; border-bottom: 1px solid var(--line); }
.mt-checks td { padding: 9px 10px 9px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.mt-checks tr:last-child td { border-bottom: 0; }
.mt-checks td.bar { color: var(--text-2); }
.mt-checks td.res { white-space: nowrap; }
.mark { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; font-size: 11px; font-weight: 700; margin-right: 6px; vertical-align: -3px; }
.mark.pass { background: color-mix(in srgb, var(--strong) 16%, transparent); color: var(--strong); }
.mark.fail { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.mark.na { background: var(--surface-2); color: var(--text-3); }
.mt-live { margin-top: 14px; padding: 10px 14px; border-radius: 12px; background: var(--accent-soft); font-size: 13.5px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.mt-live a { color: var(--accent); }
.mt-verdict { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.mt-verdict b, .mt-next b { display: block; font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); margin-bottom: 3px; }
.mt-verdict p { color: var(--text); }
.mt-next { margin-top: 12px !important; }
.mt-source { margin-top: 10px !important; font-size: 12px !important; color: var(--text-3) !important; }
.mt-source code { font-size: 11.5px; }
.mt-rejected { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; }
.mt-rejected summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.mt-rejected td { white-space: normal; }

/* Rows: the filings check and the v1 buy list (read-only). */
.trow.static { cursor: default; }
.trow.static:hover { background: none; }
#signals .trow, #buylist .trow { grid-template-columns: 64px minmax(0, 0.9fr) minmax(0, 1.2fr) 150px 170px; }
.pct { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); line-height: 1.05; text-align: center; }
.pct b { font-size: 17px; font-weight: 700; } .pct small { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.band { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: color-mix(in srgb, var(--strong) 14%, transparent);
  color: var(--strong); line-height: 1.05; text-align: center; }
.band b { font-size: 15px; font-weight: 700; } .band small { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.band.avoid { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.band.neutral { background: var(--surface-2); color: var(--text-2); }
.band.favored { background: color-mix(in srgb, var(--strong) 14%, transparent); color: var(--strong); }
.plan b { display: block; font-size: 14px; } .plan small { font-size: 12px; color: var(--text-2); }
.sig-legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: 10px; padding: 14px; border-bottom: 1px solid var(--line); }
.sig-legend div { font-size: 13px; color: var(--text-2); line-height: 1.5; }
.sig-legend b { display: block; margin-bottom: 2px; color: var(--text); }
.sig-legend b.avoid { color: var(--danger); } .sig-legend b.favored { color: var(--strong); }

/* Forward test (views/forwardTest.js): progress of each signal in daily paper trading. */
.fwd h3 { display: none; } /* the section head already says it */
.fwd > .note { margin: 0; max-width: 820px; line-height: 1.6; }
.fwd-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); gap: 12px; margin-top: 12px; }
.fwd-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; font-size: 13.5px; box-shadow: var(--shadow-sm); }
.fwd-card p { margin: 6px 0 0; }
.fwd-head { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; font-size: 15px; }
.fwd-head b { font-weight: 600; color: var(--text-2); } .fwd-head b.pass { color: var(--strong); } .fwd-head b.fail { color: var(--danger); }
.fwd-bar { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-top: 12px; }
.fwd-bar i { display: block; height: 100%; min-width: 2px; background: var(--accent); }
.fwd-count { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.fwd-trades { background: var(--surface); border-radius: 14px; }
.fwd-trades caption { text-align: left; padding-bottom: 4px; }

@media (max-width: 960px) {
  .mt-steps { grid-template-columns: 1fr 1fr; }
  #signals .trow, #buylist .trow { grid-template-columns: 52px minmax(0, 1fr) 140px; }
}
@media (max-width: 640px) {
  .mt-user { display: none; }
  .mt-steps, .mt-cols { grid-template-columns: 1fr; }
  .mt-card { padding: 18px 16px; }
  .mt-pipe-head { display: none; }
  .mt-pipe-row { grid-template-columns: 1fr 1fr; padding: 14px 16px; gap: 8px 12px; }
  .mt-pipe-row > a { grid-column: 1 / -1; }
  .mt-pipe .stage { align-items: flex-start; }
  .mt-pipe .stage i { margin-top: 3px; }
  .mt-pipe .stage { min-width: 0; }
  .mt-pipe .stage em, .mt-legend .stage { white-space: normal; }
  .mt-source { overflow-wrap: anywhere; }
  .mt-pipe .stage em::before { content: attr(data-label) ": "; color: var(--text-3); }
  /* Each check stacks: name, then the bar and each period's result with its label. */
  .mt-checks thead { display: none; }
  .mt-checks caption { display: block; width: 100%; }
  .mt-checks, .mt-checks tbody, .mt-checks tr, .mt-checks td { display: block; }
  .mt-checks tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  .mt-checks tr:last-child { border-bottom: 0; }
  .mt-checks td { border: 0; padding: 2px 0; white-space: normal !important; }
  .mt-checks td.check { font-weight: 600; padding-bottom: 4px; }
  .mt-checks td[data-label]::before { content: attr(data-label); display: inline-block; width: 64px; font-size: 12px; color: var(--text-3); }
  #signals .trow, #buylist .trow { grid-template-columns: 52px minmax(0, 1fr) auto; }
}
