/* The wiki — the reading surface, in the dark treatment the operator asked for.
 *
 * TASK-2026-11-05-002, corrected 2026-11-06. This shipped as a LIGHT paper surface, because
 * the reference page it came from renders light in a browser set to light. The operator was
 * reading the same page on a phone set to dark and meant THAT: near-black with a teal accent,
 * Spectral headings, mono identifiers. Same design, the other half of its theme.
 *
 * It is also the better fit here. micyte.com is single-theme dark, so a paper body sat under
 * a dark masthead as a visitor; this sits under it as part of the page. The accent stays TEAL
 * rather than the site's ochre: the wiki is its own section with its own pine button, and the
 * two greens read as one place.
 *
 * Everything is scoped under `.wiki`, so none of it can reach the bar, the footer or any
 * other page. Dropping the treatment is deleting this file and two <link> lines. */

.wiki {
  --w-paper:  #0e1413;   /* the ground */
  --w-card:   #151d1c;   /* a code block, a plate: one step up from the ground */
  --w-ink:    #e7edea;
  --w-soft:   #9aaca8;
  --w-rule:   #273331;
  --w-teal:   #55b8ab;
  --w-wash:   #15302c;   /* a chip's fill, an inline code's fill */
  --w-display: "Spectral", "Iowan Old Style", Palatino, Georgia, serif;
  --w-body:   "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --w-mono:   "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  background: var(--w-paper);
  color: var(--w-ink);
  font-family: var(--w-body);
  line-height: 1.65;
  color-scheme: dark;
  display: block;
  padding-block: clamp(2rem, 6vh, 3.5rem) clamp(3rem, 9vh, 5rem);
}

/* ---------- the reading layout ----------
   A wiki is not a page, it is a corpus you move around inside. So a document page is three
   columns: the whole corpus on the left with where you are marked, the document in the
   middle at a 40rem measure, and the shape of that document on the right. Under 72rem the
   right rail folds into a disclosure above the body; under 56rem the left one does too. The
   prose keeps its measure at every width — the rails give way, never the reading. */
/* The wiki pages do not load tools-gallery.css, where the site's other visually-hidden
   rule lives, so the label on the filter was printed above it. */
.wiki .vh {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.wiki-grid {
  display: grid;
  grid-template-columns: 15.5rem minmax(0, 1fr) 13rem;
  gap: clamp(1.5rem, 3vw, 3rem);
  max-width: 82rem; margin: 0 auto;
  padding-left: max(1.1rem, env(safe-area-inset-left, 0px));
  padding-right: max(1.1rem, env(safe-area-inset-right, 0px));
  align-items: start;
}
.wiki-doc { min-width: 0; }
.wiki-rail, .wiki-toc {
  position: sticky; top: 1rem; min-width: 0;
  max-height: calc(100vh - 2rem); overflow-y: auto; overscroll-behavior: contain;
  font-size: .84rem; line-height: 1.5;
  scrollbar-width: thin; scrollbar-color: var(--w-rule) transparent;
}

/* A <details> because it has to fold on a phone and must work with no script. Open above the
   fold-away widths, and the summary is hidden there: a disclosure arrow over a column that
   cannot close is a control that lies. */
.wiki-fold { border: 0; }
.wiki-fold > summary {
  display: none; width: 100%;
  cursor: pointer; list-style: none;
  font-family: var(--w-mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--w-teal);
  padding: .55rem .75rem; border: 1px solid var(--w-rule); border-radius: 3px;
  background: var(--w-card);
}
.wiki-fold > summary::-webkit-details-marker { display: none; }
.wiki-fold > summary::after { content: "\203A"; float: right; transform: rotate(90deg); }
.wiki-fold[open] > summary::after { transform: rotate(-90deg); }

.wiki-filter { display: block; margin: 0 0 .7rem; }
.wiki-filter input {
  width: 100%; font: inherit; font-family: var(--w-body); font-size: .84rem; color: var(--w-ink);
  background: var(--w-paper); border: 1px solid var(--w-rule); border-radius: 3px;
  padding: .42rem .6rem;
}
.wiki-filter input::placeholder { color: var(--w-soft); opacity: .75; }
.wiki-filter input:focus-visible { outline: 2px solid var(--w-teal); outline-offset: 1px; }

/* ---------- the corpus, on the left ---------- */
.wiki-rail__l, .wiki-rail__l ul { list-style: none; margin: 0; padding: 0; }
.wiki-rail__b { margin: 0 0 1.1rem; }
.wiki-rail__b[hidden] { display: none; }
/* `.wiki h2` sets Spectral at a clamp, and at equal specificity it would win on source
   order — so the rail's own heading is said with one more class than that rule has. */
.wiki .wiki-rail__b h2 {
  font-family: var(--w-mono); font-size: .68rem; font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase; color: var(--w-soft);
  line-height: 1.4; margin: 0 0 .3rem; padding-bottom: .3rem;
  border-bottom: 1px solid var(--w-rule);
}
.wiki-rail__i[hidden] { display: none; }
.wiki-rail__i a {
  display: grid; grid-template-columns: 1.6rem minmax(0, 1fr) auto; gap: .5rem;
  align-items: baseline;
  padding: .26rem .4rem .26rem 0; border-radius: 3px;
  color: var(--w-soft); text-decoration: none;
}
.wiki-rail__i a:hover { color: var(--w-ink); background: var(--w-card); }
.wiki-rail__i a:focus-visible { outline: 2px solid var(--w-teal); outline-offset: -2px; }
.wiki-rail__i a[aria-current="page"] {
  color: var(--w-ink); background: var(--w-wash);
  box-shadow: inset 2px 0 0 var(--w-teal);
  padding-left: .55rem;
}
.wiki-rail__n { font-family: var(--w-mono); font-size: .72rem; color: var(--w-teal); text-align: right; }
.wiki-rail__n--none { color: var(--w-rule); }
.wiki-rail__i a[aria-current="page"] .wiki-rail__n { color: var(--w-teal); }
.wiki-rail__t { min-width: 0; }
.wiki-rail__none { color: var(--w-soft); font-size: .84rem; margin: .4rem 0 0; }

/* the stage, as a dot: a full chip per row would cost more width than the title */
.wiki-dot { width: .45rem; height: .45rem; border-radius: 50%; flex: none; align-self: center; background: var(--w-rule); }
.wiki-dot--as-built    { background: #7fd6a4; }
.wiki-dot--design-spec { background: var(--w-teal); }
.wiki-dot--how-to      { background: #d8b472; }
.wiki-dot--stale       { background: #d99071; }

/* ---------- the shape of this page, on the right ---------- */
.wiki-toc ul { list-style: none; margin: 0; padding: 0; }
.wiki-toc li { margin: 0; }
.wiki-toc a {
  display: block; padding: .22rem 0 .22rem .7rem;
  border-left: 1px solid var(--w-rule);
  color: var(--w-soft); text-decoration: none;
}
.wiki-toc a:hover { color: var(--w-ink); border-left-color: var(--w-soft); }
.wiki-toc a:focus-visible { outline: 2px solid var(--w-teal); outline-offset: -2px; }
.wiki-toc a.is-here { color: var(--w-teal); border-left-color: var(--w-teal); }
.wiki-toc__3 a { padding-left: 1.5rem; font-size: .95em; }

/* ---------- where this page sits in the order ---------- */
.wiki-nears {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: .6rem;
  margin-top: clamp(2.4rem, 6vh, 3.5rem);
  padding-top: clamp(1.2rem, 3vh, 1.8rem); border-top: 1px solid var(--w-rule);
}
.wiki-near {
  display: block; padding: .8rem .9rem;
  border: 1px solid var(--w-rule); border-radius: 4px;
  color: var(--w-ink); text-decoration: none;
}
.wiki-near:hover { border-color: var(--w-teal); }
.wiki-near span {
  display: block; font-family: var(--w-mono); font-size: .68rem;
  letter-spacing: .12em; text-transform: uppercase; color: var(--w-soft); margin-bottom: .2rem;
}
.wiki-near b { font-weight: 500; }
.wiki-near--next { text-align: right; }

@media (max-width: 72rem) {
  .wiki-grid { grid-template-columns: 14rem minmax(0, 1fr); }
  /* the shape of the page moves above it, and closes */
  .wiki-toc {
    grid-column: 2; grid-row: 1; position: static; max-height: none; overflow: visible;
    margin-bottom: 1.4rem;
  }
  .wiki-toc .wiki-fold > summary { display: block; }
  .wiki-toc .wiki-fold:not([open]) ul { display: none; }
  .wiki-toc ul { margin-top: .7rem; }
  .wiki-doc { grid-column: 2; grid-row: 2; }
}
@media (max-width: 56rem) {
  .wiki-grid { grid-template-columns: minmax(0, 1fr); gap: 1.2rem; }
  .wiki-rail, .wiki-toc { position: static; max-height: none; overflow: visible; grid-column: 1; }
  .wiki-rail { grid-row: 1; }
  .wiki-toc { grid-row: 2; margin-bottom: 0; }
  /* `grid-column: 2` is set in the wider block above, and this grid has ONE column — without
     resetting it the document was placed in an implicit second column and the first collapsed
     to min-content. The whole page was three narrow boxes at 390px. */
  .wiki-doc { grid-column: 1; grid-row: 3; }
  .wiki-rail .wiki-fold > summary { display: block; }
  .wiki-rail .wiki-fold:not([open]) .wiki-filter,
  .wiki-rail .wiki-fold:not([open]) .wiki-rail__l,
  .wiki-rail .wiki-fold:not([open]) .wiki-rail__none { display: none; }
  .wiki-rail .wiki-filter { margin-top: .7rem; }
  /* on a phone the corpus starts closed: it is 31 rows between the reader and the document */
  .wiki-rail .wiki-fold[open] .wiki-rail__l { max-height: 60vh; overflow-y: auto; }
}

/* ---------- the index: one filter, and bands you can jump to ---------- */
.wiki-find {
  display: flex; flex-wrap: wrap; gap: .7rem 1.2rem; align-items: center;
  margin: 0 0 clamp(1.6rem, 4vh, 2.4rem);
}
.wiki-filter--wide { flex: 1 1 20rem; max-width: 28rem; margin: 0; }
.wiki-jump { display: flex; flex-wrap: wrap; gap: .3rem .5rem; }
.wiki-jump a {
  display: inline-flex; align-items: baseline; gap: .35rem;
  font-size: .78rem; color: var(--w-soft); text-decoration: none;
  padding: .25rem .55rem; border: 1px solid var(--w-rule); border-radius: 3px;
}
.wiki-jump a:hover { color: var(--w-ink); border-color: var(--w-soft); }
.wiki-jump span { font-family: var(--w-mono); font-size: .68rem; color: var(--w-teal); }

.wiki-paper {
  max-width: 56rem; margin: 0 auto;
  padding-left: max(1.1rem, env(safe-area-inset-left, 0px));
  padding-right: max(1.1rem, env(safe-area-inset-right, 0px));
}

.wiki h1, .wiki h2, .wiki h3 {
  font-family: var(--w-display); font-weight: 600; color: var(--w-ink);
  text-wrap: balance; line-height: 1.2;
}
.wiki h1 { font-size: clamp(1.9rem, 5vw, 2.7rem); margin: 0 0 .5rem; letter-spacing: -.01em; }
.wiki h2 { font-size: clamp(1.3rem, 3.2vw, 1.6rem); margin: 0; }
.wiki h3 { font-size: 1.08rem; margin: 1.8rem 0 .4rem; }
.wiki p, .wiki li { max-width: 40rem; }
.wiki p { margin: 0 0 1rem; }
.wiki a { color: var(--w-teal); text-decoration-thickness: 1px; text-underline-offset: 2px; }
.wiki strong { font-weight: 600; }

.wiki-eyebrow {
  font-family: var(--w-mono); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--w-teal); margin: 0 0 .9rem;
}
.wiki-lede { font-size: 1.1rem; color: var(--w-soft); max-width: 38rem; margin-bottom: 2.4rem; }
.wiki-blurb { color: var(--w-soft); margin: 0 0 .9rem; }
.wiki-crumb { font-family: var(--w-mono); font-size: .8rem; margin: 0 0 1.2rem; }
.wiki-crumb--end { margin: 2.5rem 0 0; padding-top: 1.2rem; border-top: 1px solid var(--w-rule); }
/* The provenance line was a whole sentence set in mono, which is a sentence nobody reads.
   Body type for the words; the filename, which IS an identifier, keeps the mono. */
.wiki-source {
  display: flex; flex-wrap: wrap; gap: .4rem .7rem; align-items: baseline;
  font-size: .88rem; color: var(--w-soft); margin: 0 0 1.6rem;
}
.wiki-source > span { min-width: 0; }
.wiki-source code { font-family: var(--w-mono); font-size: .92em; }

/* The reference devices, on paper. */
.wiki .ref-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem 1rem; margin: 0 0 .4rem; }
.wiki .ref-count {
  font-family: var(--w-mono); font-size: .68rem; letter-spacing: .09em; text-transform: uppercase;
  color: var(--w-teal); background: var(--w-wash); border: 1px solid rgba(85, 184, 171, .34);
  padding: .1rem .45rem; border-radius: 3px;
}

.wiki-band { border-top: 1px solid var(--w-rule); padding-block: 1.5rem 0; margin-top: 1.8rem; }
.wiki-band[hidden] { display: none; }
/* Three up rather than one down: at one row per document the index was 6,200px of scrolling
   for 31 entries, which is a list you read by luck. */
.wiki-idx {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: .5rem; align-items: start;
  grid-template-columns: repeat(auto-fill, minmax(min(17rem, 100%), 1fr));
}
.wiki-idx__i[hidden] { display: none; }
.wiki-idx a {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .25rem .55rem;
  height: 100%; padding: .7rem .8rem;
  border: 1px solid var(--w-rule); border-radius: 4px;
  text-decoration: none; color: inherit; align-items: start;
}
/* `baseline` put the number level with whichever line the title happened to end on. Both
   inherit the same line-height, so aligning to the start puts them on the same first line. */
.wiki-idx a:hover, .wiki-idx a:focus-visible { border-color: var(--w-teal); }
.wiki-idx a:hover .wiki-idx__t, .wiki-idx a:focus-visible .wiki-idx__t { color: var(--w-teal); }
.wiki-idx__n { font-family: var(--w-mono); font-size: .72rem; color: var(--w-teal); line-height: 1.85; }
.wiki-idx__t { font-family: var(--w-display); font-size: 1rem; font-weight: 600; line-height: 1.35; min-width: 0; }
.wiki-idx__d { grid-column: 1 / -1; color: var(--w-soft); font-size: .86rem; line-height: 1.5; min-width: 0; }
.wiki-idx__f { font-family: var(--w-mono); font-size: .68rem; color: var(--w-soft); opacity: .75; white-space: nowrap; }
@media (max-width: 46rem) {
  .wiki-idx a { grid-template-columns: 1fr; }
  .wiki-idx__f { display: none; }
}

/* The documents themselves. */
.wiki-body { margin-top: 1.5rem; }
.wiki-body h2 { margin: 2.4rem 0 .5rem; padding-top: 1.2rem; border-top: 1px solid var(--w-rule); }
.wiki-body ul, .wiki-body ol { padding-left: 1.15rem; margin: 0 0 1.1rem; }
.wiki-body li { margin-bottom: .3rem; }
.wiki-body hr { border: 0; border-top: 1px solid var(--w-rule); margin: 2rem 0; }
/* Inline code in this corpus is mostly FILE PATHS -- `fnd_app/instances/_shared/runtime/
 * portal_datum_workbench.py` and longer. At 390px an unbreakable one pushed the page 407px
 * sideways: the code BLOCKS and the TABLES were already contained by their own scrollers, and
 * these were not, because they sit inside a paragraph. They break anywhere rather than widen
 * the page; a path with a line break in it is still readable, a page that scrolls sideways is
 * not. */
.wiki-body :not(.wiki-code) > code,
.wiki-body p code, .wiki-body li code, .wiki-body td code, .wiki-body th code {
  font-family: var(--w-mono); font-size: .86em; background: var(--w-wash);
  padding: .08em .32em; border-radius: 3px; overflow-wrap: anywhere;
}
.wiki p, .wiki li, .wiki dd { overflow-wrap: break-word; }
.wiki-body blockquote {
  margin: 1.2rem 0; padding: .1rem 0 .1rem 1rem; border-left: 2px solid var(--w-teal);
  color: var(--w-soft);
}
.wiki-body blockquote p { margin: .5rem 0; }

.wiki-code { overflow-x: auto; background: var(--w-card); border: 1px solid var(--w-rule); border-radius: 4px; margin: 0 0 1.2rem; }
.wiki-code pre { margin: 0; padding: .85rem 1rem; }
.wiki-code code { font-family: var(--w-mono); font-size: .8rem; line-height: 1.6; background: none; padding: 0; white-space: pre; }

.wiki-table { overflow-x: auto; margin: 0 0 1.3rem; }
.wiki-table table { border-collapse: collapse; width: 100%; font-size: .92rem; }
.wiki-table th, .wiki-table td { text-align: left; padding: .45rem .8rem .45rem 0; border-bottom: 1px solid var(--w-rule); vertical-align: top; }
.wiki-table th { font-family: var(--w-mono); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--w-soft); font-weight: 500; }
.wiki-table td { color: var(--w-ink); }
/* On a phone `width: 100%` made every table squeeze instead of scroll, and the identifiers in
   them broke one character per line — `micyte/ports` / `/port_catalog` / `/contracts.p` / `y`.
   A table is a grid of facts, so it keeps its shape and the WRAPPER scrolls; the page itself
   cannot move sideways because `.wiki-doc` is `min-width: 0` and this box owns the overflow. */
@media (max-width: 46rem) {
  .wiki-table { -webkit-overflow-scrolling: touch; }
  .wiki-table table { width: auto; min-width: 100%; }
  .wiki-table th, .wiki-table td { padding-right: 1.1rem; }
  .wiki-table td code, .wiki-table th code { overflow-wrap: normal; white-space: nowrap; }
}

/* ---------- development status: the chip, and the panel it opens ----------
 * Every value shown is READ: the stage is each page's own `> Status:` line, which
 * mycite-core holds to a known vocabulary, and the app versions are the vendored catalogue.
 * The panel is a <details> so it opens with no JavaScript and find-in-page can reach it. */

.wiki-stage {
  font-family: var(--w-mono); font-size: .62rem; letter-spacing: .08em; text-transform: uppercase;
  padding: .1rem .4rem; border-radius: 2px; border: 1px solid; white-space: nowrap;
  display: inline-block; line-height: 1.5;
}
.wiki-stage--as-built    { color: #7fd6a4; border-color: rgba(127, 214, 164, .34); background: #17301f; }
.wiki-stage--design-spec { color: var(--w-teal); border-color: rgba(85, 184, 171, .34); background: var(--w-wash); }
.wiki-stage--how-to      { color: #d8b472; border-color: rgba(216, 180, 114, .34); background: #2c2415; }
.wiki-stage--stale       { color: #d99071; border-color: rgba(217, 144, 113, .34); background: #2d1d16; }
.wiki-stage--index,
.wiki-stage--none        { color: var(--w-soft); border-color: var(--w-rule);       background: var(--w-card); }

.wiki-idx a { align-items: center; }
.wiki-idx .wiki-stage { justify-self: end; align-self: start; margin-top: .15rem; }

.wiki-status { margin: 0 0 2.4rem; border: 1px solid var(--w-rule); border-radius: 4px; background: var(--w-card); }
.wiki-status > summary { cursor: pointer; list-style: none; padding: .7rem .9rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem .9rem; }
.wiki-status > summary::-webkit-details-marker { display: none; }
.wiki-status__btn {
  font-family: var(--w-mono); font-size: .76rem; letter-spacing: .04em;
  color: var(--w-paper); background: var(--w-teal); border-radius: 2px; padding: .25rem .6rem;
}
.wiki-status > summary:hover .wiki-status__btn { background: #6cc7b9; }
.wiki-status[open] .wiki-status__btn { background: var(--w-wash); color: var(--w-teal); border: 1px solid rgba(85, 184, 171, .4); padding: calc(.25rem - 1px) calc(.6rem - 1px); }
.wiki-status__hint { font-size: .85rem; color: var(--w-soft); }
.wiki-status__body { padding: 0 .9rem .5rem; border-top: 1px solid var(--w-rule); }
.wiki-status .ref-head { margin-top: 1.1rem; }
.wiki-status h3 { margin: 0; font-size: 1rem; }

.wiki-stage-list { list-style: none; margin: 0 0 .4rem; padding: 0; }
.wiki-stage-list li { display: grid; grid-template-columns: minmax(0, 18rem) minmax(0, 1fr); gap: .1rem .9rem; padding: .3rem 0; border-top: 1px solid var(--w-rule); align-items: baseline; }
.wiki-stage-list li > span { color: var(--w-soft); font-size: .86rem; min-width: 0; }
.wiki-stage-list a { min-width: 0; }
.wiki-ver { font-family: var(--w-mono); font-size: .76rem; }
@media (max-width: 40rem) { .wiki-stage-list li { grid-template-columns: 1fr; } }
