/* GENERATED by marketing/build-tool-partials.py — DO NOT EDIT.
   The seam between an embedded tool and the Reading Room theme. Authored in the
   build script (there is no standalone-tool equivalent of this relationship). */

/* THEME-BLEED RESET. Specificity alone cannot fix a theme rule that sets a
   property the tool never re-declares — the theme's `.verdict { padding }` and
   `.eyebrow { letter-spacing }` both reach tool elements that way. So revert
   author styling on every descendant, then let tools-core paint.

   The specificity is deliberately ONE CLASS BELOW the hardened tool scope — it
   carries TOOL_SCOPE_HARD minus one `.ist-tool` — so it can never beat the
   tool's own styling; and, living in <body>, it is strictly LATER than the
   theme's <head> stylesheets, so it wins ties against them.
   :where() keeps the exclusion list at zero specificity.

   RAISED FROM (0,3,0) TO (0,4,0) on 2026-07-27, together with TOOL_SCOPE_HARD
   (see the note there). At (0,3,0) it LOST to the theme's
   `:root[data-theme="light"] .post-content h2` at (0,3,1) — which reaches every
   tool that an author mounts inside the prose, i.e. the live Charter post. Seven
   headings rendered `WHAT IS THIS MONEY FOR?` in the article's uppercase-with-a-
   rule costume instead of the sentence case the tool designs. Found by the
   embedded-context harness (tools-core/test/embed-harness.js); no source
   assertion could have seen it. */
.ist-tool.ist-tool.ist-tool.ist-tool :where(*:not(iframe, svg, svg *, script, style)) {
  all: revert;
}

/* The tool is an instrument island: it keeps its own dark ground inside the
   light post theme, which is why the :root rewrite below matters so much. */
/* scroll-margin-top clears the sticky site header when a reader arrives on the
   #tool-<slug> anchor — without it the tool's eyebrow and title land underneath
   the header and the reader appears to have jumped into the middle of the card. */
.ist-tool-slot { margin: 34px 0; scroll-margin-top: 84px; }
/* `var(--line)` — it was a literal that duplicated the token exactly (T-186), which
   this generator was the ONLY file able to hide, being outside the brand guard's root,
   extension list AND pre-commit trigger. All three are now closed; see the guard.
   The token is declared ON `.ist-tool` by the derived core sheet (the `:root {` →
   `.ist-tool {` rewrite below), and a custom property declared on an element resolves
   for that element's own declarations — so this is the same pixel.
   NO FALLBACK, deliberately. `var(--line, <hex>)` would re-introduce the literal this
   row exists to remove, and the fallback is unreachable anyway: emit_partial() writes
   tool-embed.css and tools-core.css as an adjacent PAIR into all six partials, so the
   sheet that declares --line ships wherever this rule does. A fallback here would be a
   dead branch carrying the defect. */
.ist-tool.ist-tool.ist-tool {
  border-radius: var(--r, 14px);
  border: 1px solid var(--line);
}

/* PRINT CONTAINMENT. A tool that emits a printable document (the Charter's
   #print-doc) hides everything but that document — scoped to `.ist-tool > *`,
   which is correct on a standalone page. On a POST the article itself is
   outside that scope, so Cmd-P would print the whole essay stapled to the
   charter. Hide the article furniture too, but ONLY on a page that actually
   carries a printable tool. :has() is required; where it is unsupported the
   rule is dropped and behaviour is exactly today's.

   The `:not(:has(.ist-tool-slot))` halves are load-bearing since the tool can be
   author-mounted INSIDE .post-content: without them the slot's own ancestor
   would be hidden, taking the printable document with it. */
@media print {
  body:has(.ist-tool-slot #print-doc) .site,
  body:has(.ist-tool-slot #print-doc) .how,
  body:has(.ist-tool-slot #print-doc) .post-wrap > *:not(.ist-tool-slot):not(:has(.ist-tool-slot)),
  body:has(.ist-tool-slot #print-doc) .post-content > *:not(.ist-tool-slot):not(:has(.ist-tool-slot)) {
    display: none !important;
  }
}
