/* THE FORGE: Gauss-Markov. Additions to forge.css for this page: the guided steps, the step strip,
   the formula tiles, and captions. The guide rules are ported from the Maximum Likelihood page. */

.hidden { display: none !important; }
.sidebar code, .says code { color: var(--gold); font-size: 0.92em; }
.btn.wide { width: 100%; margin-top: 12px; }
.btn.ghost { background: #404040; border: 1px solid #555; }
.btn.ghost:hover { background: #4a4a4a; }
.btn:disabled { opacity: 0.35; cursor: default; }
.sidebar label.check { color: var(--warm-white); font-weight: 400; text-transform: none; letter-spacing: 0; font-size: 0.9em; margin: 12px 0 5px; }
.sidebar label .sym { text-transform: none; }

/* a control the current step asks the student to touch */
.ctl { border-radius: 6px; transition: box-shadow 0.2s; }
.ctl.glow { box-shadow: 0 0 0 2px var(--gold), 0 0 14px rgba(197,165,90,0.45); padding: 2px 8px 8px; margin: 6px -8px; animation: glow 1.6s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 0 0 2px var(--gold), 0 0 4px rgba(197,165,90,0.2); } }
@media (prefers-reduced-motion: reduce) { .ctl.glow { animation: none; } }

/* the step card, at the top of the left column beside the controls it names */
.sidebar .guide { background: var(--card-bg); border: 1px solid var(--border); border-left: 4px solid var(--gold); border-radius: 6px; padding: 10px 12px 12px; margin: 6px 0 10px; }
.g-top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.g-count { color: var(--ember); font-weight: 800; font-size: 0.74em; text-transform: uppercase; letter-spacing: 0.6px; }
.g-dots { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.g-dot { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--gold); background: transparent; padding: 0; cursor: pointer; }
.g-dot.done { background: rgba(197,165,90,0.45); }
.g-dot.now { background: var(--gold); box-shadow: 0 0 0 3px rgba(197,165,90,0.3); }
.g-dot.free { border-radius: 2px; }
.g-title { order: 3; flex-basis: 100%; color: var(--gold); font-weight: 700; font-size: 1.04em; line-height: 1.3; margin-top: 2px; }
.g-lines p { margin: 7px 0 0; font-size: 0.9em; line-height: 1.45; }
.g-tag { display: inline-block; font-size: 0.68em; font-weight: 800; text-transform: uppercase; letter-spacing: 0.6px; border-radius: 9px; padding: 1px 8px; margin-right: 6px; vertical-align: 1px; }
.g-tag.do { background: var(--ember); color: #fff; }
.g-tag.watch { background: var(--gold); color: var(--dark-bg); }
.g-tag.why { background: #4a4a4a; color: var(--warm-white); }
.g-nav { display: flex; gap: 8px; margin-top: 10px; }
.g-nav .btn { flex: 1; padding: 7px 6px; }

/* 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 formula tiles: one line of math each */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 10px; align-content: start; }
.tiles:empty { display: none; }
.tile { background: var(--card-bg); border: 1px solid var(--border); border-radius: 6px; padding: 7px 12px 5px; min-width: 0; }
.tile.wide { grid-column: span 2; }
@media (max-width: 760px) { .tile.wide { grid-column: span 1; } }
.tile.active { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 2px 12px rgba(197,165,90,0.22); }
.t-head { display: flex; align-items: center; gap: 8px; }
.t-name { font-weight: 700; color: var(--warm-white); font-size: 0.95em; flex: 1; min-width: 0; }
.t-val { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; color: var(--warm-white); white-space: nowrap; }
.t-mean { color: var(--muted); font-size: 0.78em; margin: 1px 0 0; line-height: 1.4; }
.t-mean b { color: var(--warm-white); font-weight: 600; }
.t-mean code { color: var(--gold); font-size: 0.95em; }
.t-math { overflow-x: auto; overflow-y: hidden; font-size: 0.88em; }
.t-math .katex-display { margin: 0.3em 0 0.1em; text-align: left; }
.t-math .katex-display > .katex { text-align: left; }

/* plain words under a plot */
.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; }

/* the R printout: the test line the step reads is marked */
pre.printout .focus { background: rgba(197,165,90,0.18); outline: 1px solid var(--gold); border-radius: 2px; }

/* the truth panel: sentence-case labels, and the rows the current step reads lit */
.metric .lab { text-transform: none; letter-spacing: 0; font-size: 0.86em; }
.metric.now .lab { color: var(--gold); }
.truth-cap { color: var(--muted); font-size: 0.8em; margin: 0 0 4px; line-height: 1.45; }

/* the dial's memo notch, in sentence case */
.file-badge { text-transform: none; letter-spacing: 0; }
.dial-value { flex-wrap: wrap; gap: 4px 8px; }
.dial-value .val { font-size: 0.95em; }
.file-badge { white-space: nowrap; }

/* The Anvil's mystery cases */
.mystery .check { margin: 6px 0; }
.mystery .btns { display: flex; gap: 8px; }
.mystery .btns .btn { flex: 1; margin-top: 10px; }
.m-feedback { margin-top: 10px; font-size: 0.86em; line-height: 1.45; }
.m-feedback p { margin: 4px 0; }
.m-feedback .ok { color: var(--green); }
.m-feedback .no { color: var(--ember); }
.m-feedback .score { color: var(--gold); font-weight: 700; }
.planted { margin-top: 12px; }

/* The Script (ported from the Maximum Likelihood page) */
#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 .cmt { color: var(--steel); }
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); }
#s-download { text-transform: none; }
@media (max-width: 760px) {
  table.s-funcs td:first-child { white-space: normal; }
  table.s-funcs code { word-break: break-word; }
  .card-body { min-width: 0; overflow-x: auto; }
}

/* the fixed BLUEPRINT button never covers the last card or tile */
.main { padding-bottom: 84px; }
.t-math { padding: 0.25em 0 0.15em; line-height: 1.9; }

/* The Anvil's four dials, two by two; each readout names its level */
.adials { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 14px; }
.adial { min-width: 0; }
.anvil-dials .adial label { display: block; font-size: 0.72em; line-height: 1.25; min-height: 2.5em; margin: 8px 0 0; }
.adial label .sym { display: block; font-weight: 400; color: var(--muted); }
.adial .dial-value { font-size: 0.82em; margin-top: 0; }
