/* sitemap.css: the handoff sitemap for the locked version of the HighWire
   prototype. The page links ../prototype/css/tokens.css and sets
   data-direction="F" data-hero="3" data-brand="5" data-room="0" on <html>,
   so every size, face, radius and color below comes from brand 5's tokens.

   The status colors are defined once, in the block below, and nowhere else.
   Four of the five point at tokens that already exist. Red has no token to
   point at: brand 5's one accent is gold and it belongs to live states, so
   --status-red is the one literal color in this file. The site tree's sizes
   and its colors on a filled head are tokens in the same block. */

:root {
  /* Final: built and locked. The lit calendar's navy-teal (the feature navy,
     --room-1-* until the rooms became feature colors). */
  --status-final: var(--feature-navy-ground-a);
  --status-final-fill: var(--tint-teal-a);
  --status-final-ink: var(--feature-navy-ground-b);
  --status-final-on: var(--feature-navy-ink);      /* text on a filled Final head */

  /* Final, edits coming: the show pages. The brand's gold. */
  --status-edits: var(--accent);
  --status-edits-fill: var(--accent-soft);
  --status-edits-ink: var(--accent-text);
  --status-edits-on: var(--text-on-accent);

  /* Not designed: the one literal. */
  --status-red: #b42318;
  --status-red-fill: var(--status-red);
  --status-red-ink: var(--g0);
  --status-red-wash: color-mix(in srgb, var(--status-red) 7%, var(--raised));
  --status-red-rule: color-mix(in srgb, var(--status-red) 18%, var(--raised));

  /* Outside this design: sign-in, profile, Learn, forum, shop, search
     results, About, Contact, Privacy and Terms. */
  --status-outside: var(--border-strong);
  --status-outside-fill: var(--sunk);
  --status-outside-ink: var(--text-3);
  --status-outside-on: var(--text);

  /* Needs Jeremy's call. */
  --status-call: var(--g700);
  --status-call-fill: var(--tint-slate-b);
  --status-call-ink: var(--feature-navy-ground-b);
  --status-call-on: var(--g0);

  /* A link wired to a stand-in page while the right template exists. */
  --status-standin: var(--text-2);
  --status-standin-fill: transparent;
  --status-standin-ink: var(--text-2);

  --sitemap-rule: var(--border);
  --sitemap-rule-strong: var(--border-strong);

  /* The newest version's mark: ink on a row's Changed tag, the same
     inverted ink as the prototype's "New in" tab and the library's tag. */
  --sitemap-new-fill: var(--text);
  --sitemap-new-ink: var(--raised);

  /* The top bar with the way back to the hub, the same height and link as
     the component library's (--lib-top-h, .lib-top__home). */
  --sitemap-top-h: 56px;

  /* A row a link jumps to clears the sticky filter bar. */
  --sitemap-anchor-offset: var(--space-12);

  /* The site tree: Home, a rule, a column per section with a filled head,
     the pages hanging off a line on the left of each column. Seven columns
     fit the 1184 column at 1280; narrower, the tree scrolls inside its frame. */
  --tree-col-min: 144px;                         /* the narrowest a column gets before the frame scrolls */
  --tree-gap: var(--space-2);                    /* between columns */
  --tree-drop: var(--space-3);                   /* the line down from Home, and from the rule to each head */
  --tree-indent: var(--space-3);                 /* how far a page box sits in from its column's edge */
  --tree-spine: calc(var(--tree-indent) / 2);   /* where the line on the left runs */
  --tree-kid-gap: var(--space-1);                /* between page boxes */
  --tree-tick-y: calc(var(--target) / 2);        /* where a tick meets a box: the middle of one line */
  --tree-line: 2px;
  --tree-line-color: var(--sitemap-rule-strong);
  --tree-box-border: 1px;
  --tree-box-radius: var(--radius-card);
  --tree-head-radius: var(--radius-button);
  --tree-root-width: 14rem;
  --tree-frame-fill: var(--raised);
  --tree-swatch: var(--space-2);

  /* The tree's New in view (Jeremy, 20 October): a page the newest version
     added is filled in the brand's gold with a New tag; a page it changed
     keeps a light box, outlined in ink, with an Updated tag; everything
     else steps back to a faint outline and muted type (no opacity, so it
     stays legible). */
  --tree-new-fill: var(--accent);
  --tree-new-edge: var(--accent);
  --tree-new-ink: var(--text-on-accent);
  --tree-new-tag-fill: var(--text);
  --tree-new-tag-ink: var(--raised);
  --tree-updated-fill: var(--raised);
  --tree-updated-edge: var(--text);
  --tree-updated-ink: var(--text);
  --tree-updated-ring: var(--tree-line);
  --tree-updated-tag-fill: var(--accent-soft);
  --tree-updated-tag-ink: var(--text);
  --tree-same-fill: var(--ground);
  --tree-same-edge: var(--sitemap-rule);
  --tree-same-ink: var(--text-3);
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--ground); color: var(--text); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-body);
}
a { color: var(--accent-text); text-underline-offset: 3px; }
a:hover { color: var(--text); }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--radius-sm); }
h1, h2, h3 { font-family: var(--font-display); font-weight: var(--display-weight, 700); letter-spacing: var(--tracking-display); line-height: var(--leading-tight); margin: 0; }
h1 { font-size: var(--text-2xl); }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-md); letter-spacing: 0; }
p { margin: 0; }
code, .mono { font-family: var(--font-ui); font-size: var(--text-sm); }
.num { font-variant-numeric: tabular-nums; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: var(--space-2); top: var(--space-2); display: inline-flex; align-items: center; min-height: var(--target); padding: 0 var(--space-2); background: var(--raised); border-radius: var(--radius-sm); transform: translateY(-200%); }
.skip:focus { transform: none; }

/* ---------------------------------------------------------------- top bar */
.top { background: var(--raised); border-bottom: var(--frame-rule) solid var(--sitemap-rule); }
.top__inner { display: flex; align-items: center; min-height: var(--sitemap-top-h); }
.top__home {
  display: inline-flex; align-items: center;
  min-height: var(--target); padding: 0 var(--space-1);
  margin-inline-start: calc(-1 * var(--space-1));
  border-radius: var(--radius-sm);
  font-family: var(--font-ui); font-size: var(--text-sm); color: var(--text-3);
  text-decoration: none; white-space: nowrap;
}
.top__home:hover { background: var(--accent-soft); color: var(--text); }

/* ---------------------------------------------------------------- head */
.page-head { padding: var(--space-8) 0 var(--space-6); border-bottom: 1px solid var(--sitemap-rule); }
.kicker { font-family: var(--font-ui); font-size: var(--text-xs); font-weight: var(--weight-medium); letter-spacing: var(--tracking-kicker); text-transform: uppercase; color: var(--text-3); }
.page-head h1 { margin-top: var(--space-1); }
.lede { margin-top: var(--space-2); max-width: var(--measure); font-size: var(--text-md); line-height: var(--leading-snug); color: var(--text-2); }
.facts { margin: var(--space-3) 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); font-family: var(--font-ui); font-size: var(--text-sm); color: var(--text-2); }
.facts strong { color: var(--text); font-weight: var(--weight-medium); }

.overview { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-6); padding: var(--space-6) 0; border-bottom: 1px solid var(--sitemap-rule); }
.overview h2 { font-size: var(--text-lg); }
.overview p { margin-top: var(--space-1); color: var(--text-2); max-width: var(--measure); }
.counts { margin: var(--space-2) 0 0; padding: 0; list-style: none; display: grid; gap: var(--space-1); }
.counts li { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding: var(--space-1) 0; }
.counts .count { font-family: var(--font-ui); font-size: var(--text-lg); font-weight: var(--weight-medium); font-variant-numeric: tabular-nums; }
.legend { margin: var(--space-2) 0 0; padding: 0; list-style: none; display: grid; gap: var(--space-2); }
.legend li { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: var(--space-2); align-items: start; }
.legend .chip { justify-self: start; }
.legend p { margin: 0; font-size: var(--text-sm); color: var(--text-2); }
.note-mobile { margin-top: var(--space-3); padding: var(--space-2) var(--space-3); border-radius: var(--radius-card-lg); background: var(--sunk); font-size: var(--text-sm); color: var(--text-2); }

/* ---------------------------------------------------------------- chips */
.chip {
  display: inline-flex; align-items: center; gap: var(--space-1);
  padding: var(--space-half) var(--space-1);
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-family: var(--font-ui); font-size: var(--text-xs); font-weight: var(--weight-medium); line-height: 1.3;
  white-space: nowrap;
}
.chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.chip[data-status="final"] { background: var(--status-final-fill); color: var(--status-final-ink); }
.chip[data-status="final"]::before { background: var(--status-final); }
.chip[data-status="final-edits"] { background: var(--status-edits-fill); color: var(--status-edits-ink); }
.chip[data-status="final-edits"]::before { background: var(--status-edits); }
.chip[data-status="not-designed"] { background: var(--status-red-fill); color: var(--status-red-ink); }
.chip[data-status="outside"] { background: var(--status-outside-fill); color: var(--status-outside-ink); }
.chip[data-status="outside"]::before { background: var(--status-outside); }
.chip[data-status="needs-call"] { background: var(--status-call-fill); color: var(--status-call-ink); }
.chip[data-status="needs-call"]::before { background: var(--status-call); }
.chip[data-status="stand-in"] { background: var(--status-standin-fill); color: var(--status-standin-ink); border: 1px dashed var(--sitemap-rule-strong); }
.chip[data-status="stand-in"]::before { background: var(--status-standin); }

/* ---------------------------------------------------------------- site tree */
.glance { padding: var(--space-6) 0; border-bottom: 1px solid var(--sitemap-rule); scroll-margin-top: var(--space-2); }
.glance__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-2) var(--space-6); }
.glance__head h2 { font-size: var(--text-lg); }
.glance__intro { margin-top: var(--space-1); max-width: var(--measure); color: var(--text-2); }
.glance__legend { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); font-family: var(--font-ui); font-size: var(--text-sm); color: var(--text-2); }
.glance__legend li { display: inline-flex; align-items: center; gap: var(--space-1); }
.glance__hint, .glance__foot { margin-top: var(--space-2); font-size: var(--text-sm); color: var(--text-3); }
.glance__hint[hidden], .glance__legend[hidden], .tree-view[hidden] { display: none; }
/* links inside a sentence: a 44px target that doesn't open up the line */
.glance__foot a { display: inline-block; padding: calc(var(--space-1) + var(--space-half)) var(--space-half); margin: calc(-1 * (var(--space-1) + var(--space-half))) calc(-1 * var(--space-half)); }

/* The frame scrolls sideways when the tree is wider than it; the page never does. */
.site-tree__frame {
  margin-top: var(--space-3);
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  padding: var(--space-3) var(--space-2);
  background: var(--tree-frame-fill);
  border: 1px solid var(--sitemap-rule);
  border-radius: var(--radius-card-lg);
}
.site-tree {
  min-width: calc(var(--tree-cols, 7) * var(--tree-col-min) + (var(--tree-cols, 7) - 1) * var(--tree-gap));
}
.site-tree ol, .site-tree ul { list-style: none; margin: 0; padding: 0; }

/* Home, and the line down to the rule */
.site-tree__root { position: relative; display: flex; justify-content: center; padding-bottom: var(--tree-drop); }
.site-tree__root > .tnode { width: var(--tree-root-width); }
.site-tree__root > .tnode::after,
.site-tree__col::before,
.site-tree__col::after,
.site-tree__kids > li::before,
.site-tree__kids > li::after { content: ""; position: absolute; background: var(--tree-line-color); }
/* the drop hangs off Home itself, so it follows the box when it moves to the start at narrow widths */
.site-tree__root > .tnode::after { left: calc(50% - var(--tree-line) / 2); top: calc(100% + var(--tree-box-border)); width: var(--tree-line); height: var(--tree-drop); }

/* The rule across the columns, and the drop to each head */
/* Two rows shared by every column (subgrid), so the heads line up at the
   height of the tallest one and the pages start on one line. */
.site-tree__cols { display: grid; grid-template-columns: repeat(var(--tree-cols, 7), minmax(var(--tree-col-min), 1fr)); grid-template-rows: auto auto; column-gap: var(--tree-gap); align-items: start; }
.site-tree__col { position: relative; min-width: 0; padding-top: var(--tree-drop); display: grid; grid-row: span 2; grid-template-rows: subgrid; row-gap: 0; }
.site-tree__col > .tnode--head { align-self: stretch; }
.site-tree__col > *, .site-tree__kids > li { min-width: 0; }
.site-tree__col::before { top: 0; left: calc(var(--tree-gap) / -2); right: calc(var(--tree-gap) / -2); height: var(--tree-line); }
.site-tree__col:first-child::before { left: calc(50% - var(--tree-line) / 2); }
.site-tree__col:last-child::before { right: calc(50% - var(--tree-line) / 2); }
.site-tree__col::after { top: 0; left: calc(50% - var(--tree-line) / 2); width: var(--tree-line); height: var(--tree-drop); }

/* The pages, hanging off a line on the left of the column */
.site-tree .site-tree__kids { padding-left: var(--tree-indent); }
.site-tree__kids > li { position: relative; padding-top: var(--tree-kid-gap); }
.site-tree__kids > li::before { left: calc(var(--tree-spine) - var(--tree-indent) - var(--tree-line) / 2); top: 0; bottom: 0; width: var(--tree-line); }
.site-tree__kids > li:last-child::before { bottom: auto; height: calc(var(--tree-kid-gap) + var(--tree-tick-y)); }
.site-tree__kids > li::after { left: calc(var(--tree-spine) - var(--tree-indent)); width: calc(var(--tree-indent) - var(--tree-spine)); top: calc(var(--tree-kid-gap) + var(--tree-tick-y) - var(--tree-line) / 2); height: var(--tree-line); }

/* A box. Its status sets four values; the rules below only read them. */
.tnode {
  --node-fill: var(--raised); --node-edge: var(--sitemap-rule-strong); --node-ink: var(--text); --node-meta: var(--text-2);
  position: relative;
  display: flex; flex-direction: column; justify-content: center; gap: 2px;
  min-height: var(--target);
  padding: var(--space-1) var(--space-1) var(--space-1) calc(var(--space-1) + var(--space-half));
  background: var(--node-fill); color: var(--node-ink);
  border: var(--tree-box-border) solid var(--node-edge);
  border-radius: var(--tree-box-radius);
  font-family: var(--font-ui); font-size: var(--text-sm); font-weight: var(--weight-medium); line-height: 1.25;
  text-decoration: none; overflow-wrap: anywhere;
  transition: box-shadow var(--hover-duration, 150ms);
}
a.tnode:hover { color: var(--node-ink); box-shadow: 0 0 0 var(--tree-line) var(--node-edge); }
a.tnode:hover .tnode__label { text-decoration: underline; text-underline-offset: 3px; }
a.tnode:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--tree-box-radius); }
.tnode__count { font-weight: var(--weight-regular); }
.tnode__sub { font-size: var(--text-xs); font-weight: var(--weight-regular); color: var(--node-meta); }
.tnode__status { font-size: var(--text-xs); font-weight: var(--weight-regular); color: var(--node-meta); }

/* A page box: the status's soft fill with its color as the outline. Not
   designed is the one solid box, so red reads first. */
.tnode[data-status="final"] { --node-fill: var(--status-final-fill); --node-edge: var(--status-final); --node-ink: var(--status-final-ink); --node-meta: var(--status-final-ink); }
.tnode[data-status="final-edits"] { --node-fill: var(--status-edits-fill); --node-edge: var(--status-edits); --node-ink: var(--text); --node-meta: var(--status-edits-ink); }
.tnode[data-status="not-designed"] { --node-fill: var(--status-red-fill); --node-edge: var(--status-red); --node-ink: var(--status-red-ink); --node-meta: var(--status-red-ink); }
.tnode[data-status="outside"] { --node-fill: var(--status-outside-fill); --node-edge: var(--status-outside); --node-ink: var(--status-outside-ink); --node-meta: var(--status-outside-ink); }
.tnode[data-status="needs-call"] { --node-fill: var(--status-call-fill); --node-edge: var(--status-call); --node-ink: var(--status-call-ink); --node-meta: var(--status-call-ink); }

/* A head: the status color filled, centered, in the display face. */
.tnode--head { align-items: center; text-align: center; padding: var(--space-1) var(--space-2); border-radius: var(--tree-head-radius); font-family: var(--font-display); font-size: var(--text-ui); font-weight: var(--weight-bold); }
.tnode--head .tnode__sub, .tnode--head .tnode__status { font-family: var(--font-ui); }
.tnode--head[data-status="final"] { --node-fill: var(--status-final); --node-ink: var(--status-final-on); --node-meta: var(--status-final-on); }
.tnode--head[data-status="final-edits"] { --node-fill: var(--status-edits); --node-ink: var(--status-edits-on); --node-meta: var(--status-edits-on); }
.tnode--head[data-status="outside"] { --node-fill: var(--status-outside); --node-ink: var(--status-outside-on); --node-meta: var(--status-outside-on); }
.tnode--head[data-status="needs-call"] { --node-fill: var(--status-call); --node-ink: var(--status-call-on); --node-meta: var(--status-call-on); }
/* A group label with no page of its own: an outline, no status. */
.tnode--group { --node-fill: var(--raised); --node-edge: var(--sitemap-rule-strong); border-style: dashed; }

/* ---- The New in view: the switch over the tree, then the marks ---- */
.tree-view { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); margin-top: var(--space-3); }
.tree-view__label { font-family: var(--font-ui); font-size: var(--text-sm); color: var(--text-2); }
.tree-view__switch { display: inline-flex; border: 1px solid var(--sitemap-rule-strong); border-radius: var(--radius-button); overflow: hidden; }
.tree-view__switch button { display: inline-flex; align-items: center; min-height: var(--target); padding: 0 var(--space-2); border: 0; background: var(--raised); color: var(--text); font-family: var(--font-ui); font-size: var(--text-ui); cursor: pointer; }
.tree-view__switch button + button { border-left: 1px solid var(--sitemap-rule-strong); }
.tree-view__switch button:hover { background: var(--sunk); }
.tree-view__switch button[aria-pressed="true"] { background: var(--sitemap-new-fill); color: var(--sitemap-new-ink); }
.tree-view__switch button:focus-visible { outline-offset: calc(-1 * var(--space-half)); }
.tnode__fresh { display: none; }
.site-tree[data-view="new"] .tnode__fresh { display: inline-flex; align-self: flex-start; margin-bottom: var(--space-half); padding: 0 var(--space-half); border-radius: var(--radius-sm); font-family: var(--font-ui); font-size: var(--text-xs); font-weight: var(--weight-bold); letter-spacing: 0; }
.site-tree[data-view="new"] .tnode--head .tnode__fresh { align-self: center; }
.site-tree[data-view="new"] .tnode__fresh[data-fresh="new"] { background: var(--tree-new-tag-fill); color: var(--tree-new-tag-ink); }
.site-tree[data-view="new"] .tnode__fresh[data-fresh="updated"] { background: var(--tree-updated-tag-fill); color: var(--tree-updated-tag-ink); }
/* Unchanged has no tag to see; a screen reader still hears it. */
.site-tree[data-view="new"] .tnode__fresh[data-fresh="same"] { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.site-tree[data-view="new"] .tnode[data-fresh="new"] { --node-fill: var(--tree-new-fill); --node-edge: var(--tree-new-edge); --node-ink: var(--tree-new-ink); --node-meta: var(--tree-new-ink); }
.site-tree[data-view="new"] .tnode[data-fresh="updated"] { --node-fill: var(--tree-updated-fill); --node-edge: var(--tree-updated-edge); --node-ink: var(--tree-updated-ink); --node-meta: var(--text-2); box-shadow: 0 0 0 calc(var(--tree-updated-ring) - var(--tree-box-border)) var(--tree-updated-edge); }
.site-tree[data-view="new"] .tnode[data-fresh="same"], .site-tree[data-view="new"] .tnode--group { --node-fill: var(--tree-same-fill); --node-edge: var(--tree-same-edge); --node-ink: var(--tree-same-ink); --node-meta: var(--tree-same-ink); }
.tnode-swatch[data-fresh="new"] { --node-fill: var(--tree-new-fill); --node-edge: var(--tree-new-edge); }
.tnode-swatch[data-fresh="updated"] { --node-fill: var(--tree-updated-fill); --node-edge: var(--tree-updated-edge); box-shadow: 0 0 0 calc(var(--tree-updated-ring) - var(--tree-box-border)) var(--tree-updated-edge); }
.tnode-swatch[data-fresh="same"] { --node-fill: var(--tree-same-fill); --node-edge: var(--tree-same-edge); }

/* The legend's swatch is a small page box. */
.tnode-swatch { --node-fill: var(--raised); --node-edge: var(--sitemap-rule-strong); flex: none; width: var(--tree-swatch); height: var(--tree-swatch); border-radius: var(--radius-sm); background: var(--node-fill); border: var(--tree-box-border) solid var(--node-edge); }
.tnode-swatch[data-status="final"] { --node-fill: var(--status-final-fill); --node-edge: var(--status-final); }
.tnode-swatch[data-status="final-edits"] { --node-fill: var(--status-edits-fill); --node-edge: var(--status-edits); }
.tnode-swatch[data-status="not-designed"] { --node-fill: var(--status-red-fill); --node-edge: var(--status-red); }
.tnode-swatch[data-status="outside"] { --node-fill: var(--status-outside-fill); --node-edge: var(--status-outside); }
.tnode-swatch[data-status="needs-call"] { --node-fill: var(--status-call-fill); --node-edge: var(--status-call); }

/* ---------------------------------------------------------------- changed, pending */
.changed-note { margin-top: var(--space-1); max-width: var(--measure); font-size: var(--text-sm); color: var(--text-2); }
.changed { display: inline-flex; align-items: center; margin-right: var(--space-half); padding: 0 var(--space-1); border: 1px solid var(--sitemap-rule-strong); border-radius: var(--radius-sm); font-family: var(--font-ui); font-size: var(--text-xs); font-weight: var(--weight-medium); color: var(--text); background: var(--raised); max-width: 100%; white-space: normal; /* wraps rather than widen the page at 320 */ }
.changed[data-newest] { background: var(--sitemap-new-fill); border-color: var(--sitemap-new-fill); color: var(--sitemap-new-ink); }
.pending { margin-top: var(--space-1); max-width: var(--measure); padding-left: var(--space-1); border-left: var(--tree-line) solid var(--sitemap-rule-strong); font-size: var(--text-sm); color: var(--text-2); }
.red-group[id], .fn-list > li[id], .plain-list > li[id] { scroll-margin-top: var(--sitemap-anchor-offset); }

/* ---------------------------------------------------------------- Jeremy to revisit */
.changes:not([hidden]) + .revisit { margin-top: var(--space-2); }
/* The New in box and Jeremy's list sit under the tree (20 October); with
   neither showing, their strip goes too. */
.lead-boxes { padding-bottom: var(--space-6); border-bottom: 1px solid var(--sitemap-rule); }
.lead-boxes:not(:has(> :not([hidden]))) { display: none; }
.revisit { margin-top: var(--space-4); padding: var(--space-3); border-radius: var(--radius-card-lg); background: var(--sunk); max-width: 60rem; }
.revisit h2 { font-size: var(--text-md); }
.revisit > p { margin-top: var(--space-half); font-size: var(--text-sm); color: var(--text-2); }
.revisit__list { margin: var(--space-1) 0 0; padding: 0; list-style: none; display: grid; gap: 0; }
.revisit__list li { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--space-2); font-size: var(--text-sm); color: var(--text-2); }
.revisit__list a { display: inline-flex; align-items: center; min-height: var(--target); font-weight: var(--weight-medium); }
.revisit[hidden] { display: none; }
.revisit-note { margin-top: var(--space-1); max-width: var(--measure); font-size: var(--text-sm); color: var(--text); }
.revisit-chip, .tnode__flag { display: inline-flex; align-items: center; padding: 0 var(--space-1); border-radius: var(--radius-sm); background: var(--status-edits-fill); border: 1px solid var(--status-edits); color: var(--status-edits-ink); font-family: var(--font-ui); font-size: var(--text-xs); font-weight: var(--weight-medium); white-space: nowrap; }
.revisit-chip { margin-right: var(--space-half); }
.tnode__flag { align-self: flex-start; margin-top: var(--space-half); white-space: normal; }

/* ---------------------------------------------------------------- filter */
.filter { position: sticky; top: 0; z-index: 2; background: var(--ground); border-bottom: 1px solid var(--sitemap-rule); }
.filter__inner { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1); padding-top: var(--space-2); padding-bottom: var(--space-2); }
.filter__label { font-family: var(--font-ui); font-size: var(--text-sm); color: var(--text-2); margin-right: var(--space-1); }
.filter button {
  min-height: var(--target); padding: 0 var(--space-2);
  display: inline-flex; align-items: center; gap: var(--space-1);
  border: 1px solid var(--sitemap-rule-strong); border-radius: var(--radius-pill);
  background: var(--raised); color: var(--text);
  font-family: var(--font-ui); font-size: var(--text-ui); cursor: pointer;
  transition: background var(--hover-duration, 150ms);
}
.filter button:hover { background: var(--sunk); }
.filter button[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--raised); }
.filter button .num { color: inherit; opacity: 0.8; }
.filter__sep { align-self: stretch; width: 1px; margin: var(--space-1) var(--space-1); background: var(--sitemap-rule-strong); }
.filter-empty-all { margin-top: var(--space-6); padding: var(--space-3); max-width: 60rem; border-radius: var(--radius-card-lg); background: var(--sunk); color: var(--text-2); font-size: var(--text-md); }
.filter__jump { margin-left: auto; display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-2); font-family: var(--font-ui); font-size: var(--text-sm); }
.filter__jump a { display: inline-flex; align-items: center; min-height: var(--target); color: var(--text-2); }
.filter__jump a:hover { color: var(--text); }

/* ---------------------------------------------------------------- sections */
.section { padding: var(--space-8) 0 var(--space-4); border-bottom: 1px solid var(--sitemap-rule); scroll-margin-top: var(--space-12); }
.section:last-of-type { border-bottom: 0; }
.section__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-3); }
.section__intro { margin-top: var(--space-2); max-width: var(--measure); color: var(--text-2); }
.section__empty { margin-top: var(--space-3); color: var(--text-3); font-size: var(--text-sm); }
.sub { margin-top: var(--space-6); }
.sub > h3 { font-size: var(--text-lg); }
.sub > p { margin-top: var(--space-1); max-width: var(--measure); color: var(--text-2); font-size: var(--text-sm); }

/* ---------------------------------------------------------------- tree (pages) */
.tree { margin: var(--space-4) 0 0; padding: 0; list-style: none; border-top: 1px solid var(--sitemap-rule); }
.tree > li { border-bottom: 1px solid var(--sitemap-rule); }
.row {
  display: grid;
  grid-template-columns: 12rem minmax(0, 1.2fr) minmax(0, 1.6fr) 7rem;
  gap: var(--space-2) var(--space-3);
  align-items: start;
  padding: var(--space-2) 0;
}
.row__status { padding-top: 2px; }
.row__name { font-weight: var(--weight-medium); }
.row__name small { display: block; margin-top: var(--space-half); font-family: var(--font-ui); font-size: var(--text-sm); font-weight: var(--weight-regular); color: var(--text-3); overflow-wrap: anywhere; }
.row__note { font-size: var(--text-sm); color: var(--text-2); }
.row__note .from { display: block; margin-top: var(--space-half); color: var(--text-3); }
.row__open { justify-self: end; }
.open {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--target); min-width: var(--target); padding: 0 var(--space-2);
  border: 1px solid var(--sitemap-rule-strong); border-radius: var(--radius-button);
  font-family: var(--font-ui); font-size: var(--text-sm); color: var(--text); text-decoration: none; white-space: nowrap;
  background: var(--raised);
  transition: background var(--hover-duration, 150ms);
}
.open:hover { background: var(--sunk); color: var(--text); }
.tree__sub { padding: var(--space-6) 0 var(--space-2); }
.tree__sub h3 { font-size: var(--text-lg); }
.tree__sub p { margin-top: var(--space-1); max-width: var(--measure); font-size: var(--text-sm); color: var(--text-2); }
.row--instance { grid-template-columns: 12rem minmax(0, 1.2fr) minmax(0, 1.6fr) 7rem; padding-left: 0; }
.row--instance .row__name { font-weight: var(--weight-regular); padding-left: var(--space-3); border-left: 2px solid var(--sitemap-rule); }

details.instances { margin: 0 0 var(--space-2); }
details.instances > summary {
  display: inline-flex; align-items: center; gap: var(--space-1);
  min-height: var(--target); padding: 0 var(--space-2); margin-left: calc(12rem + var(--space-3));
  border-radius: var(--radius-button); cursor: pointer;
  font-family: var(--font-ui); font-size: var(--text-sm); color: var(--text-2);
  list-style: none;
}
details.instances > summary::-webkit-details-marker { display: none; }
details.instances > summary::before { content: "+"; font-weight: var(--weight-bold); width: 1ch; }
details.instances[open] > summary::before { content: "\2212"; }
details.instances > summary:hover { background: var(--sunk); color: var(--text); }
.instance-list { margin: 0; padding: 0; list-style: none; }
.instance-list > li { border-top: 1px solid var(--sitemap-rule); }

/* ---------------------------------------------------------------- red groups */
.red-groups { margin: var(--space-4) 0 0; padding: 0; list-style: none; display: grid; gap: var(--space-4); }
.red-group {
  min-width: 0;
  border-left: 4px solid var(--status-red);
  background: var(--status-red-wash);
  border-radius: 0 var(--radius-card-lg) var(--radius-card-lg) 0;
  padding: var(--space-3) var(--space-4);
}
.red-group__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); }
.red-group__head h3 { font-size: var(--text-lg); }
.red-group__kind { font-family: var(--font-ui); font-size: var(--text-sm); color: var(--text-2); }
.red-group__note { margin-top: var(--space-1); max-width: var(--measure); font-size: var(--text-sm); color: var(--text-2); }
.red-group__where { margin: var(--space-2) 0 0; padding-left: var(--space-3); display: grid; gap: var(--space-half); font-size: var(--text-sm); color: var(--text); max-width: 80ch; }
.red-group__count { margin-top: var(--space-2); font-family: var(--font-ui); font-size: var(--text-sm); color: var(--text); font-weight: var(--weight-medium); }

/* ---------------------------------------------------------------- tables */
.table-wrap { position: relative; margin-top: var(--space-2); overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; min-width: 720px; border-collapse: collapse; table-layout: fixed; font-size: var(--text-sm); }
col.c-page { width: 20%; }
col.c-section { width: 26%; }
col.c-label { width: 26%; }
col.c-goes { width: 20%; }
col.c-open { width: 8%; }
.fn__proto { margin-top: var(--space-1); font-size: var(--text-sm); color: var(--text); }
th, td { text-align: left; vertical-align: top; padding: var(--space-1) var(--space-2) var(--space-1) 0; border-top: 1px solid var(--sitemap-rule); }
th { font-family: var(--font-ui); font-weight: var(--weight-medium); color: var(--text-3); font-size: var(--text-xs); letter-spacing: var(--tracking-kicker); text-transform: uppercase; border-top: 0; padding-bottom: var(--space-1); }
td { color: var(--text-2); }
td:first-child { color: var(--text); }
td a { display: inline-flex; align-items: center; min-height: var(--target); }
td { overflow-wrap: anywhere; }
.red-group table td, .red-group table th { border-color: var(--status-red-rule); }

/* ---------------------------------------------------------------- functions */
.fn-list { margin: var(--space-4) 0 0; padding: 0; list-style: none; border-top: 1px solid var(--sitemap-rule); }
.fn-list > li { border-bottom: 1px solid var(--sitemap-rule); }
.fn { display: grid; grid-template-columns: 12rem minmax(0, 1fr); gap: var(--space-1) var(--space-3); padding: var(--space-3) 0; }
.fn > :first-child { padding-top: 2px; }
.fn__where { grid-column: 2 / -1; }
.fn > *, .plain-list > li > *, .row > * { min-width: 0; }
.fn__note { max-width: var(--measure); }
.fn__name { font-weight: var(--weight-medium); }
.fn__note + .fn__note { margin-top: var(--space-1); }
.fn__note { font-size: var(--text-sm); color: var(--text-2); }
.fn__where { font-size: var(--text-sm); color: var(--text-2); }
.fn__where ul { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--space-half); }
.fn__where details > summary, .where details > summary { cursor: pointer; min-height: var(--target); display: inline-flex; align-items: center; gap: var(--space-1); color: var(--text-2); font-family: var(--font-ui); font-size: var(--text-sm); }
.fn__where details > summary:hover, .where details > summary:hover { color: var(--text); }
.fn__where details > summary::-webkit-details-marker, .where details > summary::-webkit-details-marker { display: none; }
.fn__where details > summary, .where details > summary { list-style: none; }
.fn__where details > summary::before, .where details > summary::before { content: "+"; font-weight: var(--weight-bold); width: 1ch; }
.fn__where details[open] > summary::before, .where details[open] > summary::before { content: "\2212"; }
.more-link { display: inline-flex; align-items: center; min-height: var(--target); font-family: var(--font-ui); font-size: var(--text-sm); }

/* ---------------------------------------------------------------- simple lists (gray, call) */
.plain-list { margin: var(--space-4) 0 0; padding: 0; list-style: none; border-top: 1px solid var(--sitemap-rule); }
.plain-list > li { display: grid; grid-template-columns: 12rem minmax(0, 1fr); gap: var(--space-1) var(--space-3); padding: var(--space-3) 0; border-bottom: 1px solid var(--sitemap-rule); }
.plain-list > li > :first-child { padding-top: 2px; }
.plain-list .where { grid-column: 2 / -1; }
.plain-list p { max-width: var(--measure); }
.plain-list p + p { margin-top: var(--space-1); }
.plain-list h3 { font-size: var(--text-base); font-family: var(--font-body); font-weight: var(--weight-medium); letter-spacing: 0; }
.plain-list p { font-size: var(--text-sm); color: var(--text-2); }
.plain-list .where { font-size: var(--text-sm); color: var(--text-2); }
.plain-list .where ul { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--space-half); }

/* ---------------------------------------------------------------- foot */
.page-foot { padding: var(--space-6) 0 var(--space-12); color: var(--text-3); font-size: var(--text-sm); }
.page-foot p + p { margin-top: var(--space-1); }

/* filtering: rows the chosen status hides */
[data-filter-hidden] { display: none; }

/* ---------------------------------------------------------------- narrow */
@media (width < 900px) {
  /* the frame scrolls from the left, so Home sits over the first columns */
  .site-tree__root { justify-content: flex-start; }
  .glance { padding: var(--space-4) 0; }
  h1 { font-size: var(--text-xl); }
  .overview { grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
  .row, .row--instance, .fn, .plain-list > li { grid-template-columns: minmax(0, 1fr); gap: var(--space-1); }
  .fn__where, .plain-list .where { grid-column: auto; }
  .row__open { justify-self: start; }
  .row--instance .row__name { padding-left: var(--space-2); }
  details.instances > summary { margin-left: 0; }
  .legend li { grid-template-columns: minmax(0, 1fr); gap: var(--space-half); }
  .filter { position: static; }
  .filter__jump { margin-left: 0; }
  .red-group { padding: var(--space-2); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
