/* Stat Dojo: topic pages and hub. Builds on toolbox.css (glance strip, jump nav, steps, grids) and the site's theme variables (light and dark). */
.sd-page .page-header { margin-bottom: 0.5rem; }
.sd-badges { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.6rem 0 0; padding: 0; list-style: none; }
.sd-badge { padding: 0.15rem 0.65rem; border: 1px solid var(--border); border-radius: 999px; font-size: 0.82rem; background: var(--surface-muted); }
.sd-badge-level { border-color: var(--brand); color: var(--brand); font-weight: 700; }
.sd-badge-soft { color: var(--muted); }

.sd-body { max-width: 1000px; }
.sd-sec { margin: 2.25rem 0 0; padding-top: 1.5rem; border-top: 1px solid var(--border); scroll-margin-top: calc(var(--tb-header-offset, 58px) + 1rem); }
.sd-sec:first-of-type { border-top: none; }
.sd-sec h2 { margin: 0 0 0.5rem; font-size: 1.55rem; }
.sd-sec h3 { margin: 1.4rem 0 0.4rem; font-size: 1.2rem; }
.sd-sec p, .sd-sec li { max-width: 78ch; }

/* Excel and Minitab side by side */
.sd-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1rem; margin: 1rem 0; }
.sd-tool { border: 1px solid var(--border); border-radius: 14px; background: var(--card); padding: 1rem 1.1rem; }
.sd-tool h3 { margin: 0 0 0.5rem; font-size: 1.15rem; display: flex; align-items: center; gap: 0.5rem; }
.sd-tool-tag { font-size: 0.72rem; letter-spacing: 0.07em; text-transform: uppercase; padding: 0.1rem 0.5rem; border-radius: 6px; background: var(--brand); color: var(--surface); font-weight: 700; }
.sd-tool ol { margin: 0.4rem 0 0.2rem; padding-left: 1.25rem; }
.sd-tool li { margin: 0.35rem 0; }
.sd-menu { display: inline-block; padding: 0.05rem 0.45rem; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-muted); font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace; font-size: 0.86em; white-space: nowrap; }
.sd-note { font-size: 0.9rem; color: var(--muted); }

/* Software output, shown as typed text */
.sd-output { margin: 1rem 0; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-muted); overflow: hidden; }
.sd-output figcaption { padding: 0.45rem 0.9rem; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--border); }
.sd-output pre { margin: 0; padding: 0.8rem 0.9rem; overflow-x: auto; font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace; font-size: 0.84rem; line-height: 1.5; color: var(--text); }
.sd-hl { background: color-mix(in srgb, var(--accent) 28%, transparent); border-radius: 3px; padding: 0 0.15rem; }

.sd-try { margin: 1.25rem 0; border: 1px solid var(--border); border-radius: 12px; padding: 0.9rem 1.1rem; background: var(--card); }
.sd-try summary { cursor: pointer; font-weight: 700; }
.sd-try[open] summary { margin-bottom: 0.6rem; }
.sd-eq { margin: 0.6rem 0; padding: 0.6rem 0.9rem; border-left: 4px solid var(--brand); background: var(--surface-muted); font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace; font-size: 0.92rem; overflow-x: auto; }
.sd-sibs { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: space-between; margin: 2.5rem 0 0; }
.sd-sibs a { text-decoration: none; }

/* Hub */
.sd-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 300px); gap: 1.5rem; align-items: center; margin: 0 0 1.5rem; }
.sd-hero img { width: 100%; height: auto; border-radius: 16px; display: block; box-shadow: 0 14px 30px var(--shadow-strong); }
.sd-group { margin: 2rem 0 0; }
.sd-group h3 { margin: 0 0 0.2rem; font-size: 1.35rem; }
.sd-group > p { margin: 0 0 0.75rem; color: var(--muted); max-width: 70ch; }
.sd-topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 0.8rem; margin: 0; padding: 0; list-style: none; }
.sd-topic { display: flex; flex-direction: column; gap: 0.3rem; padding: 0.9rem 1rem; border: 1px solid var(--border); border-radius: 12px; background: var(--card); min-height: 100%; }
.sd-topic a { text-decoration: none; font-weight: 700; color: var(--brand); }
.sd-topic a:hover { text-decoration: underline; }
.sd-topic p { margin: 0; font-size: 0.92rem; color: var(--muted); line-height: 1.45; }
.sd-topic .sd-badges { margin-top: auto; padding-top: 0.4rem; }
.sd-topic-soon { background: var(--surface-muted); border-style: dashed; }
.sd-topic-soon .sd-name { font-weight: 700; color: var(--text); }
.sd-soon { font-size: 0.78rem; color: var(--accent); font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }

/* Method selector */
.sd-selector { border: 2px solid var(--brand); border-radius: 16px; background: var(--card); padding: 1.1rem 1.25rem; margin: 1rem 0 1.5rem; box-shadow: 0 14px 30px var(--shadow-strong); }
.sd-selector h2 { margin: 0 0 0.25rem; font-size: 1.5rem; }
.sd-sel-crumbs { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.6rem 0; padding: 0; list-style: none; font-size: 0.85rem; }
.sd-sel-crumbs li { padding: 0.1rem 0.55rem; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-muted); }
.sd-sel-q { font-size: 1.2rem; font-weight: 700; margin: 0.6rem 0; }
.sd-sel-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0.6rem; margin: 0; padding: 0; list-style: none; }
.sd-sel-options button { width: 100%; text-align: left; font: inherit; padding: 0.7rem 0.9rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); cursor: pointer; line-height: 1.35; }
.sd-sel-options button:hover { border-color: var(--brand); background: var(--surface-soft); }
.sd-sel-options button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.sd-sel-options small { display: block; color: var(--muted); margin-top: 0.15rem; }
.sd-sel-actions { display: flex; gap: 0.6rem; margin-top: 0.9rem; flex-wrap: wrap; }
.sd-sel-actions button { cursor: pointer; font: inherit; font-size: 0.9rem; padding: 0.45rem 0.85rem; border: none; }
.sd-result h3 { margin: 0.3rem 0; font-size: 1.4rem; }
.sd-result-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0.8rem; margin: 0.8rem 0; }
.sd-result-card { border: 1px solid var(--border); border-radius: 12px; padding: 0.8rem 1rem; background: var(--surface); }
.sd-result-card h4 { margin: 0 0 0.3rem; font-size: 0.8rem; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
.sd-result-card ul { margin: 0; padding-left: 1.1rem; }
.sd-noscript { color: var(--muted); }

@media (max-width: 720px) {
  .sd-hero { grid-template-columns: 1fr; }
  .sd-pair { grid-template-columns: 1fr; }
}
@media print {
  .sd-selector, .sd-sibs, .tb-jump { display: none !important; }
  .sd-try { display: block; }
}
