/* Tokamak Toolkit pages only. Inherits the site's monochrome theme; adds one accent colour. */
:root {
  --tk-accent: #1d4ed8;
  --tk-muted: #6b6b6b;
  --tk-rule: #d9d9d9;
  --tk-soft: #f6f6f6;
}

/* kind chips on narrative entries */
.chip {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.1rem 0.45rem;
  margin-right: 0.35rem;
  border: 1px solid #000;
  border-radius: 3px;
  line-height: 1.4;
}
.chip.fixed { background: #000; color: #fff; }
.chip.hardened { border-color: var(--tk-accent); color: var(--tk-accent); }
.chip.measured, .chip.negative { border-style: dashed; }
.chip.decision { background: var(--tk-soft); }

.entry-meta { color: var(--tk-muted); font-size: 0.9rem; margin-bottom: 1.2rem; }
.entry-links {
  border-top: 1px solid var(--tk-rule);
  margin-top: 2rem;
  padding-top: 0.8rem;
  font-size: 0.92rem;
}

/* cited claims: the value, then its ID as a small status-coded link */
.claim { font-variant-numeric: tabular-nums; }
a.cid {
  font-size: 0.66em;
  vertical-align: super;
  margin-left: 0.15em;
  text-decoration: none;
  color: var(--tk-muted);
}
a.cid.st-tested, a.cid.st-reviewed { color: var(--tk-accent); }
a.cid.st-preliminary { font-style: italic; }
a.cid.st-superseded, a.cid.st-retracted { text-decoration: line-through; }

/* status badges in the registers */
.badge {
  display: inline-block;
  font-size: 0.72rem;
  padding: 0.05rem 0.4rem;
  border-radius: 3px;
  border: 1px solid var(--tk-muted);
  white-space: nowrap;
}
.badge.st-tested, .badge.st-reviewed { border-color: var(--tk-accent); color: var(--tk-accent); }
.badge.st-preliminary { border-style: dashed; }
.badge.st-superseded, .badge.st-retracted { text-decoration: line-through; color: var(--tk-muted); }
.badge.st-lifted { color: var(--tk-muted); }

table.claims { width: 100%; font-size: 0.88rem; border-collapse: collapse; }
table.claims th, table.claims td {
  border-bottom: 1px solid var(--tk-rule);
  padding: 0.45rem 0.5rem;
  vertical-align: top;
  text-align: left;
}
table.claims td.cid-cell, table.claims td.val { white-space: nowrap; }
table.claims tr:target { background: #eef3ff; }
table.claims .tol, table.claims .caveat { color: var(--tk-muted); font-size: 0.85em; }

/* provenance and build-recipe boxes */
.provenance {
  background: var(--tk-soft);
  border-left: 3px solid var(--tk-rule);
  padding: 0.6rem 0.9rem;
  font-size: 0.85rem;
}

.tk-footer {
  max-width: 62rem;
  margin: 3rem auto 1rem;
  padding: 0.8rem 1rem 0;
  border-top: 1px solid var(--tk-rule);
  color: var(--tk-muted);
  font-size: 0.85rem;
}

@media (max-width: 600px) {
  table.claims { font-size: 0.8rem; }
  table.claims td.cid-cell, table.claims td.val { white-space: normal; }
}

/* workflow states (home page flowchart and milestone table); colours match the
   classDef lines in the flowchart. Owner decision 9: done green, under construction
   yellow, critical red, pending white. Border styles differ too, for greyscale. */
.wf {
  display: inline-block;
  font-size: 0.8rem;
  padding: 0.05rem 0.45rem;
  border-radius: 3px;
  border: 1px solid #8a8a8a;
  color: #000;
  white-space: nowrap;
}
.wf.done { background: #cdeccd; border: 1.5px solid #2e7d32; }
.wf.wip  { background: #fff1a8; border: 1.5px dashed #9a7400; }
.wf.crit { background: #f6c6c6; border: 3px solid #b71c1c; }
.wf.todo { background: #ffffff; border: 1px solid #8a8a8a; }
.wf-key { margin: 0.4rem 0 1.6rem; }
.wf-key .wf { margin-right: 0.4rem; }

/* wide pages for the Tokamak Toolkit only (owner preference: laptop screens, use the width). The site caps
   .content at 780px (custom.scss), and Quarto's page grid keeps text in a narrower column
   inside it; these pages use no margin columns, so a plain block lets text, tables and the
   flowchart use the whole width. */
@media (min-width: 992px) {
  .page-layout-full main.content { max-width: min(94vw, 1480px); }
  .page-layout-full main.content.page-columns,
  .page-layout-full main.content .page-columns { display: block; }
}

/* side-by-side sections on wide screens; they stack below 1200px */
.tk-cols { display: block; }
@media (min-width: 1200px) {
  .tk-cols {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: 0 3rem;
    align-items: start;
  }
  .tk-cols.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .tk-cols > * > :first-child { margin-top: 0; }
}

/* home page side panel: status figures and reading order */
.tk-panel {
  background: var(--tk-soft);
  border-left: 3px solid var(--tk-rule);
  padding: 0.9rem 1.1rem 0.4rem;
  font-size: 0.92rem;
}
.tk-panel h3 { font-size: 1rem; margin: 0 0 0.5rem; }
.tk-panel table { margin-bottom: 0.8rem; }
.tk-panel td { font-variant-numeric: tabular-nums; padding: 0.2rem 0.4rem; }
.tk-panel td:first-child { color: var(--tk-muted); white-space: nowrap; }

/* small screens: wide tables scroll sideways instead of widening the page */
@media (max-width: 991.98px) {
  main.content table { display: block; overflow-x: auto; }
}

/* Mermaid diagrams fit the content width (Mermaid caps them at their natural size) */
main.content svg.mermaid-js { max-width: 100% !important; height: auto; }

/* home page diagrams (inline SVG from blog/figures/make_*.py): full
   width up to its drawn size; below 760px it scrolls sideways instead of shrinking the text */
.tk-flow { overflow-x: auto; }
.tk-physics-fig { margin: 0.5rem 0 1.6rem; }
.tk-flow svg.tk-diagram {
  display: block;
  width: 100%;
  max-width: 1200px;
  min-width: 760px;
  height: auto;
  margin: 0 auto;
}
.tk-flow figcaption { text-align: center; color: var(--tk-muted); font-size: 0.9rem; }

/* hover descriptions on diagram boxes (text in .tk-notes, script in index.md) */
.tk-notes { display: none; }
.tk-flow g.tk-has-note { cursor: help; }
.tk-flow g.tk-has-note:hover rect,
.tk-flow g.tk-has-note:hover polygon,
.tk-flow g.tk-has-note:hover path { filter: brightness(0.94); }
.tk-tip {
  display: none;
  position: fixed;
  z-index: 1000;
  max-width: 360px;
  padding: 0.6rem 0.8rem;
  background: #fff;
  border: 1px solid var(--tk-rule);
  border-left: 3px solid var(--tk-accent);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  font-size: 0.85rem;
  line-height: 1.45;
  pointer-events: none;
}
.tk-tip p { margin: 0; }

/* the log listing sits in a drop-down on the home page */
details.tk-log { border: 1px solid var(--tk-rule); border-radius: 3px; padding: 0.5rem 0.9rem; }
details.tk-log > summary { cursor: pointer; font-weight: 500; }
details.tk-log[open] > summary { margin-bottom: 0.6rem; }
