/* THE FORGE: Joint Distributions. Additions to forge.css for this page. The step strip, captions, keys,
   and Script tab rules are the Maximum Likelihood page's (mle.css), so every Forge page works the same way. */

.caption { color: var(--muted); font-size: 0.8em; margin: 6px 2px 0; line-height: 1.45; }
.caption b { color: var(--warm-white); font-weight: 600; }
.clickable svg { cursor: crosshair; }

/* keys above plots */
.key { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 0.8em; color: var(--warm-white); margin: 0 0 6px; }
.key span { display: inline-flex; align-items: center; gap: 6px; }
.key i { display: inline-block; width: 18px; height: 3px; border-radius: 2px; }
.key i.dash { height: 0; border-top: 2px dashed; background: none !important; }
.key i.fill { height: 10px; width: 14px; border-radius: 2px; }

/* tiles in one column beside a plot */
.tiles.col { grid-template-columns: minmax(0, 1fr); }
.tiles.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 760px) { .tiles.two { grid-template-columns: minmax(0, 1fr); } }
.tile.full { grid-column: 1 / -1; }
.t-mean b { color: var(--warm-white); font-weight: 600; }
.t-math .katex-display { margin: 0.4em 0; }
.t-math { overflow-x: auto; overflow-y: hidden; margin: 5px 0 4px; line-height: 2; }
.main { padding-bottom: 72px; }

/* controls this page adds */
.radios.stack { flex-direction: column; }
.radios.stack { gap: 4px; }
.radios.stack button { padding: 4px 8px; text-align: left; line-height: 1.35; }
#tab-rel .ctl[data-ctl="topo"] label { margin-top: 10px; }
select.pick { width: 100%; background: #404040; border: 1px solid #555; color: var(--warm-white); font: inherit; font-size: 0.86em; padding: 6px 8px; border-radius: 4px; }
.two-btn { display: flex; gap: 8px; margin-top: 12px; }
.two-btn .btn { flex: 1; }
.re-lam-i { margin-top: 2px; }

/* the Anvil's prompt */
.prompt { background: var(--card-bg); border: 1px solid var(--border); border-radius: 6px; padding: 8px 12px; margin: 12px 0 4px; }
.prompt .p-lab { color: var(--gold); font-weight: 600; font-size: 0.74em; text-transform: uppercase; letter-spacing: 0.3px; }
.prompt .p-joint { color: var(--warm-white); overflow-x: auto; }
.prompt .p-joint .katex-display { margin: 0.35em 0; }
.prompt .p-task { color: var(--ember); font-weight: 700; font-size: 0.92em; }
.an-hint { color: var(--muted); font-size: 0.85em; font-style: italic; margin: 2px 0 0; }

/* the score table */
table.stab { width: 100%; border-collapse: collapse; font-size: 0.84em; }
table.stab th { color: var(--gold); font-weight: 600; text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--border); }
table.stab th:last-child, table.stab td:last-child { text-align: right; }
table.stab td { padding: 5px 6px; border-bottom: 1px solid #3e3e3e; }
table.stab tr.row { cursor: pointer; }
table.stab tr.row:hover td { background: rgba(255,255,255,0.04); }
table.stab tr.sel td { background: rgba(197,165,90,0.14); }
table.stab td.sc { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; }
.s-avg { margin-top: 10px; color: var(--warm-white); font-size: 0.9em; }
.s-avg b { color: var(--gold); }

/* the reliability diagram (the original app's design) */
.rdiag { display: flex; align-items: center; justify-content: center; padding: 10px 8px; min-height: 92px; flex-wrap: nowrap; overflow-x: auto; }
.rdiag .node { width: 8px; height: 8px; border-radius: 50%; background: var(--steel); flex-shrink: 0; }
.rdiag .wire { width: 26px; height: 2px; background: var(--steel); flex-shrink: 0; }
.rdiag .comp { display: inline-flex; flex-direction: column; align-items: center; padding: 6px 12px; border: 2px solid var(--gold); border-radius: 6px; background: rgba(197,165,90,0.08); min-width: 92px; }
.rdiag .comp .c-name { color: var(--warm-white); font-weight: 700; font-size: 0.84em; }
.rdiag .comp .c-rate { color: var(--muted); font-size: 0.76em; }
.rdiag .par { display: flex; flex-direction: column; gap: 6px; border-left: 2px solid var(--blue); border-right: 2px solid var(--blue); padding: 6px 12px; border-radius: 4px; }

/* the step strip above each tab's plots: every step's name in order, the current one lit */
.recipe { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 4px; }
.recipe .r-step { display: inline-flex; align-items: center; gap: 7px; background: none; border: 1px solid #555; border-radius: 4px; color: var(--muted); font: inherit; font-size: 0.84em; padding: 5px 10px; cursor: pointer; }
.recipe .r-step:hover { color: var(--warm-white); border-color: #777; }
.recipe .r-num { color: var(--gold); font-weight: 700; }
.recipe .r-step.done { color: var(--warm-white); }
.recipe .r-step.now { color: var(--gold); border-color: var(--gold); background: rgba(197,165,90,0.12); font-weight: 600; }
.recipe .r-arrow { color: #6a6a6a; font-size: 0.8em; padding: 0 2px; }
.recipe .r-item { display: inline-flex; align-items: center; gap: 4px; }

/* The Script */
#tab-script .sidebar label { margin-top: 20px; }
.s-jumps { display: flex; flex-direction: column; gap: 6px; }
.s-jumps button { background: #404040; border: 1px solid #555; color: var(--warm-white); font: inherit; font-size: 0.86em; padding: 6px 10px; border-radius: 4px; cursor: pointer; text-align: left; }
.s-jumps button:hover { background: #4a4a4a; }
.s-msg { color: var(--gold); font-size: 0.82em; min-height: 1.2em; margin: 8px 0 0; }
.s-note { margin-top: 20px; font-size: 0.84em; line-height: 1.5; }
pre.printout.script { white-space: pre; overflow-x: auto; font-size: 0.82em; line-height: 1.5; max-height: none; }
pre.printout.script .sec { color: var(--gold); font-weight: 700; scroll-margin-top: 80px; }
table.s-funcs { width: 100%; border-collapse: collapse; font-size: 0.88em; }
table.s-funcs th { color: var(--gold); text-align: left; font-weight: 600; padding: 4px 10px; border-bottom: 1px solid var(--border); }
table.s-funcs td { padding: 6px 10px; border-bottom: 1px solid #3e3e3e; vertical-align: top; line-height: 1.45; }
table.s-funcs td:first-child { white-space: nowrap; }
table.s-funcs code { color: var(--gold); }
#sc-download { text-transform: none; }

.card-header .sym { text-transform: none; }
.g-lines .katex, .t-mean .katex, .caption .katex, .key .katex { font-size: 1.08em; }

@media (max-width: 1100px) {
  .main > .span-4, .main > .span-6, .main > .span-8 { grid-column: span 12; }
}
