/* SOSEC editorial paper layer.
   Loaded after cosmos.css. It re-points the screen canvas tokens to a warm
   paper / ink / vermilion palette, gives page and section titles a system
   serif, and replaces boxed cards with rules. Print keeps tokens.css. */

@media screen {
  :root {
    --cosmos-ground: #f3eee3;
    --cosmos-reading: #faf7f0;
    --canvas-soft: #e9e2d4;
    --canvas-field: #fbf8f2;
    --canvas-field-active: #fffdf8;
    --canvas-output: #efe9dc;
    --canvas-ink: #1c1a16;
    --canvas-secondary: #4a453c;
    --canvas-muted: #6a6357;
    --canvas-line: #d9d0bf;
    --canvas-field-line: #8c8270;
    --canvas-strong-line: #4a453c;
    --canvas-gold: #a33a22;
    --canvas-gold-hover: #7f2c19;
    --canvas-accent-wash: rgba(163, 58, 34, .08);
    --cosmos-edge: #d9d0bf;
    --cosmos-shadow: none;
    --canvas-cool-light: transparent;
    --canvas-warm-light: transparent;
    --ed-rule-ink: #1c1a16;
    --ed-sev-critical: #a33a22;
    --ed-sev-high: #8a5410;
    --ed-sev-medium: #56622f;
    --ed-sev-low: #4f5b68;
    --ed-sev-info: #4f5b68;
    --ed-ok: #2d6a4f;
    --radius-sm: 2px;
    --radius-md: 2px;
    --radius-lg: 2px;
  }

  :root[data-theme="dark"] {
    --cosmos-ground: #1a1814;
    --cosmos-reading: #221f1a;
    --canvas-soft: #2a2620;
    /* As on paper: editable fields sit a step above the page, readonly
       output a step below it. */
    --canvas-field: #27231d;
    --canvas-field-active: #2d2922;
    --canvas-output: #15130f;
    --canvas-ink: #ede6d6;
    --canvas-secondary: #c8bfae;
    --canvas-muted: #a49b8b;
    --canvas-line: #3a352c;
    --canvas-field-line: #7d7465;
    --canvas-strong-line: #c8bfae;
    --canvas-gold: #e2785a;
    --canvas-gold-hover: #f09878;
    --canvas-accent-wash: rgba(226, 120, 90, .1);
    --cosmos-edge: #3a352c;
    --cosmos-shadow: none;
    --ed-rule-ink: #ede6d6;
    --ed-sev-critical: #e2785a;
    --ed-sev-high: #d9a05a;
    --ed-sev-medium: #a9b57e;
    --ed-sev-low: #9fb0c2;
    --ed-sev-info: #9fb0c2;
    --ed-ok: #8cc5a2;
  }

  /* Covers and figures are warm paper rasters, the brightest blocks on a dark
     page, and outshone the titles. Screen only: print and the original image
     files keep their pixels. A reader who asks for more contrast keeps them. */
  :root[data-theme="dark"] main img {
    filter: brightness(.9);
  }

  @media (prefers-contrast: more) {
    :root[data-theme="dark"] main img {
      filter: none;
    }
  }

  html[lang^="zh"] body[data-page] {
    --font-heading: "SOSEC CJK Dash", "Iowan Old Style", Charter, Georgia, "Songti SC", "STSong", "Source Han Serif SC", "Noto Serif CJK SC", "Noto Serif SC", serif;
  }

  html body[data-page] {
    --font-heading: "Iowan Old Style", Charter, Georgia, "Songti SC", "STSong", "Source Han Serif SC", "Noto Serif CJK SC", "Noto Serif SC", serif;
    --focus-ring: 0 0 0 3px var(--focus-color);
    --radius-control: 2px;
    --radius-panel: 2px;
    --red: var(--ed-sev-critical);
    --danger: var(--ed-sev-critical);
    --orange: var(--ed-sev-high);
    --yellow: var(--ed-sev-medium);
    --green: var(--ed-ok);
    --tool-hairline: var(--canvas-line);
    background: var(--cosmos-ground);
    color: var(--canvas-ink);
  }

  html body[data-page] ::selection {
    background: var(--canvas-accent-wash);
    color: var(--canvas-ink);
  }

  .site-cosmos {
    background-image: none;
  }

  /* Titles: a system serif for page and section titles only. Body text,
     navigation, controls and the table of contents stay in the UI sans. */
  html body[data-page] :is(main h1, main h2, .report-title, .tool-card-head h3) {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -.005em;
    text-wrap: pretty;
  }

  /* Balanced wrapping alone breaks Chinese titles inside words, so only
     English titles are balanced here. Chinese titles break between any two
     characters on phones; from 721px, and on paper, article.css keeps the
     words of a report's Chinese title whole and balances its lines. */
  html:lang(en) body[data-page] :is(main h1, main h2, .report-title, .tool-card-head h3, .home-recent-item strong) {
    text-wrap: balance;
  }

  /* Tool search results title: the page's own rule carries an ID, so the
     title face of the directory headings is restated here. */
  html body[data-page] .tools-index #tool-search-results > h2 {
    font-family: var(--font-heading);
    font-weight: 700;
  }

  /* Tools directory category names are section titles too. A rule of their
     own, not an entry in the title list above, so that list keeps its
     specificity. */
  html body[data-page] .tools-index details.tool-category > summary strong {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -.005em;
    text-wrap: pretty;
  }

  /* The skip link's lifted shadow leaked into the top edge of every page
     while the link sat off screen; keyboard focus keeps the focus ring. */
  html body[data-page] .skip-link {
    border-radius: 0;
  }

  html body[data-page] .skip-link:not(:focus-visible) {
    box-shadow: none;
  }

  html body[data-page] main h1 {
    line-height: 1.22;
  }

  /* ---------- Header ---------- */
  html body[data-page] > .site-header {
    position: sticky;
    min-height: 72px;
    margin-bottom: 7px;
    border-bottom: 0;
    background: var(--cosmos-ground);
    backdrop-filter: none;
  }

  html body[data-page] > .site-header::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -7px;
    left: 0;
    height: 7px;
    box-sizing: border-box;
    border-top: 2px solid var(--ed-rule-ink);
    border-bottom: 1px solid var(--ed-rule-ink);
    background: var(--cosmos-ground);
    pointer-events: none;
  }

  html body[data-page] .site-header .brand {
    gap: 10px;
    color: var(--canvas-ink);
    font-family: var(--font-brand);
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -.01em;
  }

  html body[data-page] .site-header .brand-mark {
    color: var(--canvas-ink);
  }

  html body[data-page] .site-header .brand-domain-dot {
    color: var(--canvas-gold);
  }

  html body[data-page] .site-header .brand-descriptor {
    margin-left: 6px;
    padding-left: 12px;
    border-left: 1px solid var(--canvas-line);
    color: var(--canvas-muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .12em;
  }

  html body[data-page] .site-header .site-home,
  html body[data-page] .site-header .site-preferences > summary {
    border-radius: 0;
    color: var(--canvas-secondary);
    font-weight: 500;
  }

  html body[data-page] .site-header .site-home:hover,
  html body[data-page] .site-header .site-preferences > summary:hover,
  html body[data-page] .site-header .site-preferences[open] > summary {
    background: transparent;
    color: var(--canvas-ink);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 6px;
  }

  html body[data-page] .site-header .primary-navigation a {
    color: var(--canvas-ink);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .02em;
  }

  html body[data-page] .site-header .primary-navigation a::after {
    bottom: 6px;
    height: 2px;
    background: var(--canvas-gold);
  }

  html body[data-page] .site-header .primary-navigation a[aria-current="page"] {
    color: var(--canvas-gold);
  }

  html body[data-page] .site-header .preferences-panel {
    border: 1px solid var(--ed-rule-ink);
    border-radius: 0;
    background: var(--cosmos-reading);
    box-shadow: 4px 4px 0 var(--canvas-line);
  }

  html body[data-page] .site-header .preferences-languages a,
  html body[data-page] .site-header .preferences-appearance label {
    border-radius: 0;
  }

  html body[data-page] .site-header .preferences-languages a[aria-current]::after {
    color: var(--canvas-gold);
  }

  html body[data-page] .site-header .preferences-appearance input {
    accent-color: var(--canvas-gold);
  }

  /* ---------- Footer ---------- */
  /* A double rule closes the page; forced-colors mode drops background
     images, so it falls back to a real double border there. */
  html body[data-page] > footer {
    gap: 16px;
    margin-top: 24px;
    border-top: 0;
    padding: 22px 0 40px;
    background:
      linear-gradient(var(--ed-rule-ink), var(--ed-rule-ink)) top / 100% 1px no-repeat,
      linear-gradient(var(--ed-rule-ink), var(--ed-rule-ink)) 0 4px / 100% 2px no-repeat;
    color: var(--canvas-muted);
    font-size: 13px;
    letter-spacing: .02em;
  }

  /* ---------- Shared components ---------- */
  html body[data-page] :is(.severity, .confidence, .chip, .badge, .tag) {
    min-height: 22px;
    border: 0;
    border-image: none;
    border-radius: 0;
    padding: 0;
    background: transparent;
    color: var(--canvas-secondary);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
  }

  html body[data-page] .severity::before {
    width: 8px;
    height: 8px;
    margin-right: 7px;
    border-radius: 0;
    background: var(--canvas-muted);
  }

  html body[data-page] .severity.critical { color: var(--ed-sev-critical); }
  html body[data-page] .severity.critical::before { background: var(--ed-sev-critical); }
  html body[data-page] .severity.high { color: var(--ed-sev-high); }
  html body[data-page] .severity.high::before { background: var(--ed-sev-high); }
  html body[data-page] .severity.medium { color: var(--ed-sev-medium); }
  html body[data-page] .severity.medium::before { background: var(--ed-sev-medium); }
  html body[data-page] :is(.severity.low, .severity.info) { color: var(--ed-sev-info); }
  html body[data-page] :is(.severity.low, .severity.info)::before { background: var(--ed-sev-info); }

  html body[data-page] .section-kicker {
    color: var(--canvas-gold);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .12em;
  }

  html body[data-page] :is(.article-link, .home-report-cta) {
    color: var(--canvas-gold);
    font-weight: 700;
  }

  html body[data-page] :is(button, .button, input, select, textarea) {
    border-radius: var(--radius-control);
  }

  /* The report print button keeps its pill shape from article.css. */
  html body[data-page] .report-print-button {
    border-radius: 999px;
  }

  /* Text fields share one paper surface. This selector outranks the older
     field rules, so it restates their states: read-only and disabled output
     keep a separate surface, hover darkens the edge, and keyboard focus
     shows the ring. */
  html body[data-page] main :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="hidden"]):not([type="file"]), select, textarea) {
    border-color: var(--canvas-field-line);
    background-color: var(--canvas-field);
    box-shadow: none;
  }

  html body[data-page] main :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="hidden"]):not([type="file"]), select, textarea):is([readonly], :disabled) {
    background-color: var(--canvas-output);
  }

  html body[data-page] main :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="hidden"]):not([type="file"]), select, textarea):hover:not(:disabled):not([readonly]) {
    border-color: var(--canvas-strong-line);
  }

  html body[data-page] main :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="hidden"]):not([type="file"]), select, textarea):focus-visible {
    border-color: var(--focus-color);
    box-shadow: var(--focus-ring);
    /* Invisible on screen, where the ring shows focus; forced colors drop
       the ring and paint this outline in a system color instead. */
    outline: 2px solid transparent;
  }

  /* Search and paste fields outside the tool panels fell back to the
     browser's cool #757575 placeholder (3.39:1 on the dark field). */
  html body[data-page] main :is(input, textarea)::placeholder {
    color: var(--canvas-muted);
    opacity: 1;
  }

  /* Tool and analysis buttons set box-shadow: none above the shared focus
     rule, which left keyboard focus on them with no mark at all. A file picker
     is hidden inside its drop zone, so the zone shows that focus. The outline
     stands 2px off the edge, so a strip of paper separates it from a solid
     ink button, as in the header. On the analysis hub it also replaces the
     hub's own offset outline, which drew a second frame. */
  html body[data-page="analysis"] main .analysis-hub :is(button, summary, a):focus-visible,
  html body:is([data-surface="tool"], [data-page^="analysis-"]) main :is(button, .button):focus-visible,
  html body[data-page] main .analysis-drop:has(input:focus-visible) {
    border-color: var(--focus-color);
    box-shadow: none;
    outline: 2px solid var(--focus-color);
    outline-offset: 2px;
  }

  html body main :is(
    .csp-table td:nth-child(3),
    .cookie-table td:nth-child(4),
    .security-headers-table td:nth-child(3),
    .pem-table td:is(:nth-child(1), :nth-child(2), :nth-child(5)),
    .cache-control-table td:nth-child(4),
    .analysis-ioc-table td:is(:nth-child(1), :nth-child(7))
  ) {
    white-space: nowrap;
  }

  /* Codec chain: a partial result (a later step failed) keeps its warning
     edge and surface over the shared read-only field state. */
  html body[data-page] main .codec-chain-grid textarea.is-partial-result {
    background-color: color-mix(in srgb, var(--ed-sev-high) 12%, var(--canvas-output)) !important;
  }

  html body[data-page] main .codec-chain-grid textarea.is-partial-result:not(:focus-visible) {
    border-color: var(--ed-sev-high) !important;
  }

  html body[data-page] :is(button.primary, .button.primary) {
    border-color: var(--canvas-ink);
    background: var(--canvas-ink);
    color: var(--cosmos-ground);
  }

  /* Hover lightens the ink by a step. Vermilion here matched the error text
     that appears right under a run button. */
  html body[data-page] :is(button.primary, .button.primary):hover:not(:disabled) {
    border-color: var(--canvas-secondary);
    background: var(--canvas-secondary);
    color: var(--cosmos-ground);
  }

  /* The unscoped summary rule in the layout drops the disclosure marker; the
     analysis hub's standalone-tools disclosure and the radar archive draw no
     marker of their own. */
  html body[data-page] :is(.analysis-hub .hub-bottom details, .report-archive) > summary::before {
    content: "";
    flex: 0 0 auto;
    width: 6px;
    height: 6px;
    margin-right: 10px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(-45deg);
    transition: transform 120ms ease;
  }

  html body[data-page] :is(.analysis-hub .hub-bottom details, .report-archive)[open] > summary::before {
    transform: rotate(45deg);
  }

  /* The hub template fixes light field colours and rounded panels inline;
     re-point them at the canvas so the workspace follows the theme. */
  html body[data-page] .analysis-hub {
    --hub-field: var(--canvas-field);
    --hub-panel: var(--cosmos-reading);
    font-family: inherit;
    padding-top: 28px;
  }

  html body[data-page] .analysis-hub h1 {
    font-family: var(--font-heading);
    font-size: clamp(30px, 3vw, 40px);
    font-weight: 700;
    letter-spacing: 0;
  }

  html body[data-page] .analysis-hub .hub-workspace {
    border: 1px solid var(--canvas-line);
    border-top: 2px solid var(--ed-rule-ink);
    border-radius: 0;
  }

  html body[data-page] .analysis-hub :is(.hub-input, .hub-exports, .hub-settings, .hub-result-group + .hub-result-group) {
    border-color: var(--canvas-line);
  }

  html body[data-page] .analysis-hub .hub-input.is-dragging {
    background: var(--canvas-accent-wash);
  }

  html body[data-page] .analysis-hub :is(button, select, textarea, input[type="text"], .hub-file) {
    border-radius: 2px;
  }

  html body[data-page] .analysis-hub .hub-primary {
    border-color: var(--canvas-ink);
    background: var(--canvas-ink);
    color: var(--cosmos-ground);
  }

  /* The hub's own button rule resets the weight to the page's 400, which
     left its run button lighter than every other one. */
  html body[data-page] .analysis-hub button:not(.hub-quiet) {
    font-weight: 600;
  }

  html body[data-page] .analysis-hub .hub-primary:hover:not(:disabled) {
    border-color: var(--canvas-secondary);
    background: var(--canvas-secondary);
  }

  html body[data-page] .analysis-hub #hub-status.error {
    color: var(--ed-sev-critical);
  }

  /* Analysis reports, CVSS, the key-address tool and the about actions fix
     their own 4-12px corners in page templates; square them with the rest.
     Status dots keep their round shape. */
  html body[data-page] :is(
    .analysis-drop, .analysis-hash-file-zone, .analysis-badge, .analysis-file-button,
    .analysis-button, .analysis-card-cta, .analysis-score-card, .analysis-table,
    .analysis-chip-row, .analysis-chip, .analysis-report-output, .analysis-note,
    .analysis-resource-table, .analysis-card, .analysis-email-summary-card,
    .analysis-email-table-wrap, .analysis-email-list li, .analysis-email-trust-list p,
    .analysis-hash-summary-card, .analysis-hash-preview-list li,
    .analysis-hash-finding-list li, .analysis-hash-table-wrap, .analysis-hash-trust-list p,
    .analysis-ioc-check, .analysis-ioc-summary-card, .analysis-ioc-table-wrap,
    .analysis-ioc-trust-list p, .about-page .about-actions a, .hub-file
  ),
  html body[data-page] #cvss-app :is(
    button, input[type="text"], input[type="search"], textarea, select,
    .cvss-version-options, .cvss-version span, .cvss-option span, .cvss-result,
    #cvss-vector, .cvss-differences span
  ),
  html body[data-page] #cvss-dialog,
  html body[data-page] .ka :is(.ka-tabs button, input:not([type="checkbox"]), select, textarea, button) {
    border-radius: 2px;
  }

  /* The page-frame rule for header, main and footer also caught headers nested
     in content and indented them by the frame gutter. */
  html body[data-page] main header {
    width: auto;
    margin-inline: 0;
  }

  /* Boxed reading and workspace containers become open pages on paper. */
  html body[data-page] :is(.article-main, .about-page),
  html body[data-surface="tool"] main > .tool-panel {
    border: 0;
    border-radius: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
  }

  /* The about page's phone padding was a gutter for its old boxed panel;
     the open page now aligns with the header like every other page. */
  html body[data-page="about"] #main-content {
    padding-inline: 0;
  }

  /* Tool titles sat 12-16px under the header rule, against about 30px on
     the directories and the analysis hub. */
  html body[data-surface="tool"] main > .tool-header {
    padding-top: 16px;
  }

  html body[data-page] :is(.radar-panel, .paper-card, .tools-discovery, .empty-state, .code-block, .flow-step, .sosec-perspective) {
    border-radius: 0;
    box-shadow: none;
  }

  /* ---------- Home ---------- */
  html body[data-page="home"] .home-report {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: clamp(36px, 4.5vw, 64px);
    align-items: start;
    border-bottom: 0;
    padding: 44px 0 48px;
  }

  html body[data-page="home"] .home-report-copy {
    order: 2;
    padding-top: 4px;
  }

  html body[data-page="home"] .home-report-visual {
    order: 1;
    border: 1px solid var(--canvas-line);
    background: var(--canvas-soft);
  }

  html body[data-page="home"] .home-report-topline {
    gap: 6px 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--canvas-line);
  }

  html body[data-page="home"] .home-report-kicker {
    margin: 0;
    color: var(--canvas-gold);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
  }

  html body[data-page="home"] .home-report-breadcrumb {
    color: var(--canvas-secondary);
    font-size: 13px;
    font-weight: 600;
  }

  html body[data-page="home"] .home-report-meta {
    margin-left: auto;
    font-variant-numeric: tabular-nums;
  }

  html body[data-page="home"] .home-report h1 {
    margin: 22px 0 18px;
    font-size: clamp(30px, 3vw, 42px);
    line-height: 1.24;
  }

  html body[data-page="home"] .home-report-summary {
    color: var(--canvas-secondary);
    font-size: 17px;
    line-height: 1.8;
  }

  html body[data-page="home"] .home-report-cta {
    margin-top: 18px;
    border-bottom: 2px solid currentColor;
    min-height: 44px;
  }

  html body[data-page="home"] .home-report-cta:hover {
    text-decoration: none;
    color: var(--canvas-gold-hover);
  }

  html body[data-page="home"] :is(.home-recent, .home-toolkit) {
    border-top: 2px solid var(--ed-rule-ink);
  }

  html body[data-page="home"] .home-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0 6px;
  }

  html body[data-page="home"] .home-section-head h2,
  html body[data-page="home"] .home-toolkit-title {
    margin: 0;
    font-size: 24px;
    line-height: 1.3;
  }

  html body[data-page="home"] .home-section-head a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    color: var(--canvas-gold);
    font-size: 14px;
    font-weight: 700;
  }

  html body[data-page="home"] .home-recent {
    padding-bottom: 40px;
  }

  html body[data-page="home"] .home-recent-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0 28px;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  html body[data-page="home"] .home-recent-list > li {
    min-width: 0;
    border-top: 1px solid var(--canvas-line);
    padding-top: 16px;
  }

  html body[data-page="home"] .home-recent-item {
    display: grid;
    gap: 12px;
    color: var(--canvas-ink);
  }

  html body[data-page="home"] .home-recent-item:hover {
    text-decoration: none;
  }

  html body[data-page="home"] .home-recent-item:hover strong {
    color: var(--canvas-gold);
  }

  html body[data-page="home"] .home-recent-item img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    border: 1px solid var(--canvas-line);
    background: var(--canvas-soft);
  }

  html body[data-page="home"] .home-recent-kicker {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    color: var(--canvas-muted);
    font-size: 12px;
    font-weight: 600;
  }

  html body[data-page="home"] .home-recent-item strong {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
    overflow-wrap: anywhere;
    text-wrap: pretty;
  }

  html body[data-page="home"] .home-recent-date {
    color: var(--canvas-muted);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }

  html body[data-page="home"] .home-toolkit {
    padding: 0 0 64px;
  }

  html body[data-page="home"] .home-toolkit-title {
    max-width: none;
    padding: 14px 0 6px;
  }

  /* With "All tools", the tool heading shares the recent-research head row,
     which already carries the padding. */
  html body[data-page="home"] .home-toolkit-head .home-toolkit-title {
    padding: 0;
  }

  html body[data-page="home"] .home-search {
    margin-top: 14px;
  }

  html body[data-page="home"] .home-search-field {
    min-height: 56px;
    border: 1px solid var(--canvas-strong-line);
    border-radius: 0;
    background: var(--canvas-field);
  }

  /* The home search input drops its own focus shadow; the field shows it. */
  html body[data-page="home"] .home-search-field:focus-within {
    border-color: var(--focus-color);
    box-shadow: var(--focus-ring);
  }

  html body[data-page="home"] .home-search button {
    border: 1px solid var(--canvas-strong-line);
    background: var(--canvas-ink);
    color: var(--cosmos-ground);
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 700;
  }

  html body[data-page="home"] .home-featured-head {
    margin-top: 32px;
  }

  html body[data-page="home"] .home-featured-head h3 {
    color: var(--canvas-muted);
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .12em;
  }

  html body[data-page="home"] .home-featured-item {
    border-top-color: var(--ed-rule-ink);
  }

  html body[data-page="home"] .home-featured-item strong {
    font-family: var(--font-heading);
    font-weight: 700;
  }

  html body[data-page="home"] .home-featured-index {
    color: var(--canvas-gold);
    font-weight: 700;
  }

  /* ---------- Radar directory ---------- */
  html body[data-page] .radar-directory .filter-bar {
    gap: 12px;
    margin: 28px 0 0;
    border: 0;
    border-bottom: 1px solid var(--canvas-line);
    border-radius: 0;
    padding: 0 0 20px;
    background: transparent;
    box-shadow: none;
  }

  /* The filter controls are interface text, not code. The base field rule
     set them in the monospace face, which spaced the placeholder's ellipsis
     wide. */
  html body[data-page] .radar-directory .filter-bar :is(input, select) {
    font-family: var(--font-ui);
  }

  /* While a filter is active, the line under the bar counts the reports
     shown and offers to clear the filter. The paragraph stays in the page,
     since a status region must exist before it speaks; only its text comes
     and goes, and an empty line takes no room. */
  html body[data-page] .radar-directory .radar-filter-status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0 16px;
  }

  html body[data-page] .radar-directory .radar-filter-status > p {
    margin: 0;
    color: var(--canvas-secondary);
    font: 600 14px/1.5 var(--font-ui);
    font-variant-numeric: tabular-nums;
  }

  html body[data-page] .radar-directory .radar-filter-status > :is(p:not(:empty), button:not([hidden])) {
    margin-top: 12px;
  }

  html body[data-page] .radar-directory .radar-filter-clear {
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid var(--canvas-field-line);
    border-radius: 0;
    background: transparent;
    color: var(--canvas-ink);
    font: 600 14px/1 var(--font-ui);
    cursor: pointer;
  }

  @media (hover: hover) {
    html body[data-page] .radar-directory .radar-filter-clear:hover {
      border-color: var(--canvas-strong-line);
    }
  }

  /* The base button rule sets a display, and no site rule enforces
     [hidden], so the hidden button would still show. */
  html body[data-page] .radar-directory .radar-filter-clear[hidden] {
    display: none;
  }

  html body[data-page] .radar-directory :is(.radar-panel, .featured-report) {
    border: 0;
    border-radius: 0;
    padding: 0;
    background: transparent;
  }

  html body[data-page] .radar-directory .featured-report {
    gap: clamp(28px, 4vw, 56px);
    padding: 32px 0 36px;
    border-bottom: 2px solid var(--ed-rule-ink);
  }

  html body[data-page] .radar-directory .featured-report-cover img,
  html body[data-page] .report-card-cover img {
    border: 1px solid var(--canvas-line);
    border-radius: 0;
    background: var(--canvas-soft);
  }

  html body[data-page] .radar-directory .featured-report h2 {
    font-size: clamp(28px, 2.8vw, 38px);
    line-height: 1.25;
  }

  html body[data-page] .radar-directory .radar-panel > h2 {
    margin: 0;
    padding: 18px 0 8px;
    font-size: 24px;
    letter-spacing: 0;
    text-transform: none;
  }

  html body[data-page] .report-list {
    gap: 0;
  }

  html body[data-page] .report-card {
    border: 0;
    border-top: 1px solid var(--canvas-line);
    border-radius: 0;
    padding: 22px 0;
    background: transparent;
    box-shadow: none;
  }

  html body[data-page] .report-card:hover,
  html body[data-page] .report-card:focus-within {
    border-color: var(--canvas-line);
    background: transparent;
    transform: none;
  }

  html body[data-page] .report-card .report-title {
    color: var(--canvas-ink);
    font-size: 21px;
    line-height: 1.38;
  }

  html body[data-page] .report-card:hover .report-title {
    color: var(--canvas-gold);
  }

  html body[data-page] .report-card-summary {
    color: var(--canvas-secondary);
  }

  html body[data-page] .report-card-meta {
    color: var(--canvas-muted);
    font-variant-numeric: tabular-nums;
  }

  html body[data-page] .report-card .report-arrow {
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--canvas-gold);
    font-size: 20px;
  }

  html body[data-page] .report-archive {
    border: 0;
    border-top: 2px solid var(--ed-rule-ink);
    border-radius: 0;
    background: transparent;
  }

  /* The base rule spreads the summary with space-between and turns it into a
     grid on phones; keep the marker beside its label at every width. */
  html body[data-page] .report-archive > summary {
    display: flex;
    justify-content: flex-start;
    gap: 0;
    align-items: center;
    border-radius: 0;
    cursor: pointer;
    font-size: 17px;
    font-weight: 700;
  }

  html body[data-page] .report-archive > summary:hover {
    color: var(--canvas-gold);
  }

  /* The archive's size, or while filtering how many shown reports it holds,
     sits beside its label. The summary's gap is 0 here, hence the margin. */
  html body[data-page] .report-archive > summary small {
    margin-left: 10px;
    color: var(--canvas-muted);
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }

  /* ---------- Article ---------- */
  html body[data-page="radar-report-detail"] .report-title-hero h1 {
    font-size: clamp(32px, 3.4vw, 46px);
    line-height: 1.22;
  }

  /* Rating, dates, tags and the print button sit between the summary and the
     cover, so they show on the first screen; the hero's gap spaces them. */
  html body[data-page="radar-report-detail"] .report-title-hero > .report-meta-block {
    margin: 0;
  }

  html body[data-page="radar-report-detail"] .report-cover {
    border: 1px solid var(--canvas-line);
    border-radius: 0;
    background: var(--canvas-soft);
    box-shadow: none;
  }

  html body[data-page="radar-report-detail"] .report-cover img {
    border-radius: 0;
  }

  html body[data-page="radar-report-detail"] .article-prose :is(h2, h3) {
    font-family: var(--font-heading);
    font-weight: 700;
  }

  html body[data-page="radar-report-detail"] .article-prose .article-heading-number {
    color: var(--canvas-muted);
    font-family: var(--font-ui);
    font-weight: 700;
  }

  /* A subsection title stands clear of the paragraph above it, but stays
     close to a chapter title right above it and to a divider rule. A
     response block's title keeps its place under the block's own rule. */
  html body[data-page="radar-report-detail"] .article-prose :not(.article-code-response) > h3 {
    margin-top: 36px;
  }

  html body[data-page="radar-report-detail"] .article-prose :is(h2 + h3, :is(h2, section) + section:not(.article-code-response) > h3:first-child) {
    margin-top: 24px;
  }

  html body[data-page="radar-report-detail"] .toc {
    border: 0;
    border-top: 2px solid var(--ed-rule-ink);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  /* The contents panel on a narrow screen sits under its summary: a hairline,
     not the sidebar's heavy rule. */
  html body[data-page="radar-report-detail"] .article-mobile-toc {
    border-top: 1px solid var(--canvas-line);
  }

  /* Both contents lists: plain section numbers instead of boxed ones, and a
     single mark for the section being read. The mark is a border, which
     forced colors keep. Hover underlines the title and leaves the number
     alone. The focus ring is drawn inside the entry, since the sidebar clips
     what reaches past its edge. */
  html body[data-page="radar-report-detail"] .article-aside > .toc {
    padding: 16px 0 18px;
  }

  html body[data-page="radar-report-detail"] .toc a,
  html body[data-page="radar-report-detail"] .toc a[data-heading-number] {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 4px;
    align-items: baseline;
    min-height: 0;
    padding: 0 0 0 10px;
    font-size: 14.5px;
  }

  html body[data-page="radar-report-detail"] .toc a + a {
    margin-top: 2px;
  }

  html body[data-page="radar-report-detail"] .toc a > span {
    padding: 4px 0;
    line-height: 1.4;
  }

  html body[data-page="radar-report-detail"] .toc a::before {
    display: block;
    width: auto;
    height: auto;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    color: var(--canvas-muted);
    font: 600 13px/1.4 var(--font-ui);
    font-variant-numeric: tabular-nums;
    opacity: 1;
    transition: none;
  }

  html body[data-page="radar-report-detail"] .toc a[data-toc-level="3"] {
    margin-left: 36px;
    color: var(--canvas-secondary);
    font-size: 13.5px;
  }

  html body[data-page="radar-report-detail"] .toc a:hover {
    color: var(--canvas-ink);
  }

  html body[data-page="radar-report-detail"] .toc a:hover > span {
    text-decoration: underline;
    text-underline-offset: .2em;
  }

  html body[data-page="radar-report-detail"] .toc a:focus-visible {
    outline: 2px solid var(--focus-color);
    outline-offset: -2px;
    box-shadow: none;
  }

  html body[data-page="radar-report-detail"] .toc a[aria-current="true"] {
    border-left: 2px solid var(--canvas-gold);
    padding-left: 8px;
    color: var(--canvas-ink);
    font-weight: 650;
  }

  html body[data-page="radar-report-detail"] .toc a[aria-current="true"]::before {
    color: var(--canvas-gold);
  }

  html body[data-page="radar-report-detail"] .article-prose :is(pre, table) {
    border-radius: 0;
  }

  html body[data-page="radar-report-detail"] .article-prose pre {
    border: 1px solid var(--canvas-line);
    border-top: 2px solid var(--ed-rule-ink);
    background: var(--canvas-field);
  }

  html body[data-page="radar-report-detail"] .article-prose figure img {
    border: 1px solid var(--canvas-line);
    border-radius: 0;
  }

  /* ---------- Tools and other directories ---------- */
  html body[data-page] .tool-card {
    border-radius: 0;
    box-shadow: none;
    border: 1px solid var(--canvas-line);
    border-top: 2px solid var(--ed-rule-ink);
    background: var(--cosmos-reading);
  }

  html body[data-page] .tool-card:hover {
    border-color: var(--canvas-strong-line);
    border-top-color: var(--canvas-gold);
    background: var(--cosmos-reading);
    transform: none;
  }

  html body[data-page] .tool-card:hover .tool-card-head h3 a {
    color: var(--canvas-gold);
  }

  html body[data-page] :is(.topic-button, .tags-list .chip) {
    border-radius: 0;
  }

  html body[data-page] :is(.report-tags, .category-grid, .tags-list) .chip {
    border: 1px solid var(--canvas-line);
    padding: 0 7px;
  }

  html body[data-surface="tool"] .related-tools-list a {
    border-radius: 0;
  }

  /* The tools directory search pins the old hand-drawn field with
     !important; bring it onto the same field surface as other inputs. */
  html body[data-page="tools"] .tools-search input {
    border: 1px solid var(--canvas-field-line) !important;
    border-image: none !important;
    border-radius: 2px !important;
    background: var(--canvas-field) !important;
    font-family: var(--font-ui) !important;
    box-shadow: none !important;
  }

  html body[data-page="tools"] .tools-search input:hover:not(:disabled) {
    border-color: var(--canvas-strong-line) !important;
    background: var(--canvas-field) !important;
  }

  html body[data-page="tools"] .tools-search input:focus-visible {
    border-color: var(--focus-color) !important;
    background: var(--canvas-field) !important;
    box-shadow: var(--focus-ring) !important;
  }

  /* WebKit's own clear button is a blue cross on the paper field; draw it
     in the muted ink instead. Escape also clears the field. */
  html body[data-page="tools"] .tools-search input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    margin-inline-end: 2px;
    background:
      linear-gradient(45deg, transparent 43%, var(--muted) 43% 57%, transparent 57%),
      linear-gradient(-45deg, transparent 43%, var(--muted) 43% 57%, transparent 57%);
    cursor: pointer;
  }

  html body[data-page="tools"] .tools-search input::-webkit-search-cancel-button:hover {
    background:
      linear-gradient(45deg, transparent 43%, var(--canvas-ink) 43% 57%, transparent 57%),
      linear-gradient(-45deg, transparent 43%, var(--canvas-ink) 43% 57%, transparent 57%);
  }

  /* Warnings take the amber risk tone; the old mapping to the dark accent
     made them read as errors. */
  html body[data-surface="tool"] :is(.tool-status, .status)[data-state="warning"] {
    color: var(--ed-sev-high);
  }

  /* The tools directory pins its pill buttons with !important. */
  html body[data-page] .tools-index .topic-button {
    border-radius: 0 !important;
  }

  html body[data-page] .tools-index .topic-button[aria-pressed="true"] {
    border-color: var(--canvas-ink) !important;
    background: var(--canvas-ink) !important;
    color: var(--cosmos-ground) !important;
  }

  html body[data-page] .topic-button[aria-pressed="true"] {
    border-color: var(--canvas-ink);
    background: var(--canvas-ink);
    color: var(--cosmos-ground);
  }

  html body[data-page] .topic-button[aria-pressed="true"] .topic-count {
    color: inherit;
  }

  html body[data-page] :is(.radar-directory, .featured-report) .article-link {
    min-height: 44px;
    border: 0;
    border-bottom: 2px solid currentColor;
    border-radius: 0;
    padding: 0;
    background: transparent;
  }
}

/* ---------- Article contents on narrow screens ----------
   Without the sidebar, a long report's only contents list is near its top.
   Once that list has scrolled away, toc.js shows a fixed button that opens
   it again and names the section being read. It sits below the sticky
   header (z-index 20), so the header menu covers it. Focus moved to the
   foot of the page stops above it. Contents entries are 44px tall here. */
@media screen and (max-width: 1040px) {
  html body[data-page="radar-report-detail"] .article-toc-jump:not([hidden]) {
    position: fixed;
    right: 14px;
    bottom: 14px;
    z-index: 15;
    display: inline-flex;
    gap: 8px;
    align-items: center;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid var(--canvas-strong-line);
    background: var(--cosmos-reading);
    color: var(--canvas-ink);
    font: 700 14px/1 var(--font-ui);
    text-decoration: none;
  }

  html body[data-page="radar-report-detail"] .article-toc-jump-current {
    color: var(--canvas-muted);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
  }

  html body[data-page="radar-report-detail"] .article-toc-jump-current:empty {
    display: none;
  }

  html:has(.article-toc-jump:not([hidden])) {
    scroll-padding-bottom: 72px;
  }

  html body[data-page="radar-report-detail"] .toc.article-mobile-toc a {
    min-height: 44px;
    align-content: center;
  }
}

/* Phones set subsection titles a little closer than the desktop 36px. */
@media screen and (max-width: 720px) {
  html body[data-page="radar-report-detail"] .article-prose :not(.article-code-response) > h3 {
    margin-top: 30px;
  }
}

@media screen and (max-width: 900px) {
  html body[data-page] > .site-header {
    min-height: 60px;
  }

  html body[data-page] .site-header .brand {
    font-size: 24px;
  }

  html body[data-page] .site-header .site-navigation {
    border: 1px solid var(--ed-rule-ink);
    border-radius: 0;
    background: var(--cosmos-reading);
    box-shadow: 4px 4px 0 var(--canvas-line);
  }

  html body[data-page] .site-header .primary-navigation a {
    border-radius: 0;
  }

  html body[data-page] .site-header .site-nav-toggle {
    border-color: var(--canvas-strong-line);
    border-radius: 0;
  }

  html body[data-page] > footer {
    flex-direction: column;
    gap: 6px;
  }

  html body[data-page="home"] .home-report {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 28px 0 36px;
  }

  html body[data-page="home"] .home-report-copy,
  html body[data-page="home"] .home-report-visual {
    order: 0;
  }

  html body[data-page="home"] .home-recent-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 20px;
  }

  html body[data-page="home"] .home-recent-list > li {
    padding-bottom: 20px;
  }

  /* iOS Safari zooms the page when a field under 16px takes focus. Read-only
     output keeps its denser size. !important outranks the tools' ID rules. */
  html body[data-page] main :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="hidden"]):not([type="file"]):not([readonly]), textarea:not([readonly]), select) {
    font-size: 16px !important;
  }
}

/* From 601px the CVSS import box is fixed at 44px; a 16px line and its
   padding need about 49px. At 600px and below it is 62px already. */
@media screen and (min-width: 601px) and (max-width: 900px) {
  html body[data-page] #cvss-app .cvss-import textarea {
    min-height: 50px;
  }
}

@media screen and (max-width: 600px) {
  html body[data-page="home"] .home-recent-list {
    grid-template-columns: 1fr;
  }

  html body[data-page="home"] .home-recent-item {
    grid-template-columns: 112px minmax(0, 1fr);
    align-items: start;
  }

  html body[data-page="home"] .home-recent-item img {
    grid-row: span 3;
  }

  html body[data-page="home"] .home-recent-item strong {
    font-size: 16px;
  }

  html body[data-page="home"] .home-report-meta {
    margin-left: 0;
  }
}

/* ---------- Radar list on phones ----------
   Recent reports, and archived ones while a category is chosen, become
   112px thumbnail rows as on the home page: kicker and title beside the
   cover, then the summary, topic fields and date across the row. Only the
   featured report keeps the full-width image. The card body's own boxes
   join the card's grid; the DOM order is the reading order. Screen only:
   paper keeps its layout. */
@media screen and (max-width: 740px) {
  html body[data-page] .radar-directory .report-card:not(.report-archive-card),
  html body[data-page] .radar-directory[data-category-active="true"] .report-archive-card {
    grid-template-columns: 112px minmax(0, 1fr) !important;
    grid-template-areas:
      "cover kicker"
      "cover title"
      "summary summary"
      "fields fields"
      "meta meta";
    align-items: start;
    gap: 6px 14px;
  }

  html body[data-page] .radar-directory .report-card:not(.report-archive-card) .report-card-body,
  html body[data-page] .radar-directory[data-category-active="true"] .report-archive-card .report-card-body {
    display: contents;
  }

  html body[data-page] .radar-directory .report-card:not(.report-archive-card) .report-card-cover,
  html body[data-page] .radar-directory[data-category-active="true"] .report-archive-card .report-card-cover {
    grid-area: cover;
    width: 112px;
    align-self: start;
  }

  html body[data-page] .radar-directory .report-card:not(.report-archive-card) .report-card-kicker,
  html body[data-page] .radar-directory[data-category-active="true"] .report-archive-card .report-card-kicker {
    grid-area: kicker;
  }

  html body[data-page] .radar-directory .report-card:not(.report-archive-card) .report-card-heading,
  html body[data-page] .radar-directory[data-category-active="true"] .report-archive-card .report-card-heading {
    grid-area: title;
  }

  html body[data-page] .radar-directory .report-card:not(.report-archive-card) .report-title,
  html body[data-page] .radar-directory[data-category-active="true"] .report-archive-card .report-title {
    font-size: 18px;
  }

  html body[data-page] .radar-directory .report-card:not(.report-archive-card) .report-card-summary,
  html body[data-page] .radar-directory[data-category-active="true"] .report-archive-card .report-card-summary {
    grid-area: summary;
    margin-top: 6px;
  }

  html body[data-page] .radar-directory .report-card:not(.report-archive-card) .radar-catalog-fields,
  html body[data-page] .radar-directory[data-category-active="true"] .report-archive-card .radar-catalog-fields {
    grid-area: fields;
  }

  html body[data-page] .radar-directory .report-card:not(.report-archive-card) .report-card-meta,
  html body[data-page] .radar-directory[data-category-active="true"] .report-archive-card .report-card-meta {
    grid-area: meta;
    white-space: nowrap;
  }
}

/* From 641px to 1040px the filter bar has two columns. The search field
   takes the first row, so the two selects sit side by side instead of the
   severity select wrapping to a half-empty row. */
@media screen and (min-width: 641px) and (max-width: 1040px) {
  html body[data-page] .radar-directory .filter-bar > input {
    grid-column: 1 / -1;
  }
}

@media screen and (forced-colors: active) {
  html body[data-page] > footer {
    border-top: 4px double CanvasText;
  }

  /* Forced colors remove box-shadow focus rings; fields, including the home
     search input inside its frame, show keyboard focus with a system-color
     outline. */
  html body[data-page] main :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="hidden"]):not([type="file"]), select, textarea):focus-visible {
    outline: 2px solid Highlight;
    outline-offset: 1px;
  }
}

@media screen and (prefers-reduced-motion: reduce) {
  html body[data-page] main details > summary::before {
    transition: none;
  }
}

/* The skip link moves focus to main, which is a landmark and not a control;
   a click in the page and a later key press must not ring the whole page. */
html body[data-page] main:focus-visible {
  outline: none;
}

/* Chinese sets two em dashes as one long dash, but the Latin fonts first in
   these stacks draw each with space around it, so it prints as two strokes.
   On Chinese pages only, U+2014 comes from a CJK system font. */
@font-face {
  font-family: "SOSEC CJK Dash";
  font-weight: 100 500;
  src: local("PingFangSC-Regular"), local("Microsoft YaHei"), local("Noto Sans CJK SC"), local("Hiragino Sans GB W3");
  unicode-range: U+2014;
}

@font-face {
  font-family: "SOSEC CJK Dash";
  font-weight: 600 900;
  src: local("PingFangSC-Semibold"), local("Microsoft YaHei Bold"), local("Noto Sans CJK SC Bold"), local("Hiragino Sans GB W6");
  unicode-range: U+2014;
}

html[lang^="zh"] {
  --font-ui: "SOSEC CJK Dash", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", Arial, sans-serif;
}

/* Exists only while printing; see showTextareaValuesForPrint in main.js. */
.print-value {
  display: none;
}

/* Tool and analysis tables keep their words whole, on screen and on paper.
   Templates let cells break "anywhere", and the table layout then squeezed a
   short column below its words ("REDAC/TED", "未配/置"). Only a token wider
   than its column breaks now. Headers and the columns main.js marks
   data-column="whole" keep Chinese words together ("类型", not "类/型"); a
   long token main.js wraps in a span marked data-long-value (a digest, an
   encoded value) may still break anywhere, but not the cell's other words or
   its buttons ("Sh/ow"); a column of longer values keeps eight characters'
   room through an empty block. main.js turns a table that cannot fit this way into cards
   on screen and labelled rows on paper. */
html body:is([data-surface="tool"], [data-page^="analysis-"]) main table:not(.print-cards) :is(th, td, th *, td *) {
  overflow-wrap: break-word;
  word-break: normal;
}

html body:is([data-surface="tool"], [data-page^="analysis-"]) main table:not(.print-cards) :is(th, [data-column="whole"], th *, [data-column="whole"] *) {
  word-break: keep-all;
}

html body:is([data-surface="tool"], [data-page^="analysis-"]) main table:not(.print-cards) td [data-long-value] {
  overflow-wrap: anywhere;
}

html body:is([data-surface="tool"], [data-page^="analysis-"]) main table:not(.print-cards, [data-print-table="keep"]) td[data-column="text"]::after {
  content: "";
  display: block;
  width: 8em;
  height: 0;
}

/* Set for one measure; see measureTable in main.js. The rules above decide
   where a cell may break; these keep a template's own rules from changing
   that during the measure. */
html body main table.table-measuring {
  table-layout: auto !important;
  width: min-content !important;
  min-width: 0 !important;
  max-width: none !important;
}

html body main table.table-measuring :is(th, td, th *, td *) {
  overflow-wrap: normal !important;
  word-break: normal !important;
}

html body main table.table-measuring :is(th, [data-column="whole"], th *, [data-column="whole"] *) {
  word-break: keep-all !important;
}

html body main table.table-measuring td [data-long-value] {
  overflow-wrap: anywhere !important;
}

/* Set while main.js lays a tool page out as paper to measure its table
   rows before printing; see layOutAsPaper there. A sheet is 680px wide, A4
   less its 15mm side margins. Transitions stay off while the layout changes
   and changes back, so nothing animates. */
html.print-layout {
  width: 680px !important;
  min-width: 0 !important;
  max-width: none !important;
}

html.print-still,
html.print-still *,
html.print-still *::before,
html.print-still *::after {
  transition: none !important;
}

/* Print keeps the reviewed tokens.css palette; these rules only remove screen
   controls from paper and fix page breaks on the directories. */
/* Written only while printing; see the print block. */
.print-filter-note {
  display: none;
}

/* A tool's result table wider than its column stacks into cards on screen,
   one per row, each value under its column's name; main.js decides and names
   the cells. A template's widths, caps and unbroken columns give way, since a
   card needs none of them. The header row stays for screen readers. */
@media screen {
  html body main table.is-stacked,
  html body main table.is-stacked :is(tbody, tr, th, td) {
    display: block !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
  }

  html body main table.is-stacked {
    border: 0;
    background: none;
  }

  /* A card gives each value the whole width, so a long token inside it may
     break anywhere instead of widening the card. */
  html body main table.is-stacked :is(th, td) * {
    overflow-wrap: anywhere !important;
    word-break: normal !important;
  }

  html body main table.is-stacked thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  html body main table.is-stacked tbody {
    display: grid !important;
    gap: 10px;
  }

  html body main table.is-stacked tr {
    padding: 6px 14px;
    border: 1px solid var(--line-container);
    border-radius: var(--radius-control);
    background: var(--surface-output);
  }

  html body main table.is-stacked :is(th, td) {
    padding: 8px 0;
    border: 0;
    border-bottom: 1px dotted var(--line-hairline);
    text-align: start;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
  }

  html body main table.is-stacked :is(th, td):last-child {
    border-bottom: 0;
  }

  html body main table.is-stacked :is(th, td):empty {
    display: none !important;
  }

  html body main table.is-stacked :is(th, td)[data-cell-label]:not([data-cell-label=""], [data-card-title])::before {
    content: attr(data-cell-label);
    display: block;
    margin-bottom: 2px;
    color: var(--text-secondary);
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: normal;
  }

  html body main table.is-stacked [data-card-title] {
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.45;
  }
}

@media print {
  /* Every page prints on white, as reports already do. A paper-coloured page
     sat inside the white margin as a tinted box with text at its very edge. */
  html,
  html body[data-page] {
    background: #fff !important;
  }

  html body[data-page] > .site-header {
    background: none;
  }

  /* Radar directory on paper: no card arrows and no closed archive (its
     label printed with nothing under it). An archive opened by the reader or
     by a filter prints with its reports, and the filter bar prints only while
     a filter hides reports, so the page says what it was narrowed to. The
     list heading stays with its first card, and a card never splits into an
     empty frame. The filter bar is hidden everywhere and shown again by a
     :has() rule, so a browser without :has() prints no empty controls.
     The clear-filters button has nothing to press on paper. */
  .radar-directory :is(.filter-bar, .report-archive:not([open]), .report-arrow, .radar-filter-clear) {
    display: none !important;
  }

  /* The count follows the filter line: "Category: Phishing", then "1 report
     found". Unfiltered, the status line is empty and takes no room. */
  .radar-directory .radar-filter-status > p:not(:empty) {
    margin: 0 0 12px;
    font-weight: 700;
    break-after: avoid;
  }

  .radar-directory .radar-filter-status > p:empty {
    display: none;
  }

  .radar-directory:has([data-report-card][hidden]) .filter-bar {
    display: flex !important;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 0;
    margin: 14px 0 18px;
  }

  /* On paper the filter reads as a line of text, "Category: Phishing".
     The controls stay off paper: a typed search box pushed the results to
     page two and printed its focus ring and clear button. filters.js copies
     each active value onto its label; a label without one is not printed. */
  .radar-directory .filter-bar :is(input, select),
  .radar-directory .filter-bar label:not([data-value]) {
    display: none !important;
  }

  .radar-directory .filter-bar label {
    display: inline !important;
    min-width: 0;
    margin-right: 22px;
    font-weight: 700;
    overflow-wrap: anywhere;
  }

  .radar-directory .filter-bar label::after {
    content: ":\00a0" attr(data-value);
    font-weight: 400;
  }

  .radar-directory .filter-bar label:lang(zh)::after {
    content: "：" attr(data-value);
  }

  .radar-directory .radar-panel > h2 {
    break-after: avoid;
  }

  /* The archive's label prints, and the list's top rule ran straight into the
     first card's frame as a double line. A grid list also let the label close
     a page alone. */
  .radar-directory :is(.report-archive, .report-archive-list) {
    border-top: 0;
  }

  /* The archive's count stays beside its label. Below 720px the base rule
     makes the summary a grid, which would drop the count to its own line.
     The 50px height and padding are a tap target; on paper they only pushed
     the last of five search results onto a page of its own. */
  .radar-directory .report-archive > summary {
    display: flex;
    justify-content: flex-start;
    align-items: baseline;
    gap: 10px;
    min-height: 0;
    padding: 0;
    break-after: avoid;
  }

  .radar-directory .report-archive-list {
    display: block;
  }

  /* A grid row that fits on the next page moves there whole, which left page
     one with nothing but the search when it matched only archived reports. */
  .radar-directory :is(.report-index-grid, .radar-main-stack) {
    display: block;
  }

  .radar-directory .radar-main-stack > * + * {
    margin-top: 20px;
  }

  .radar-directory .report-archive-list > * + * {
    margin-top: 10px;
  }

  .radar-directory .report-card {
    break-inside: avoid;
  }

  /* Tools directory on paper: the directory itself, without the search,
     topic filters, the quick-link strip that repeats it, or the open and
     close markers. While a search or topic replaces the directory with
     results, :has() rules print the search field and its result count, and
     for an empty result the chosen topic, which the count then omits, so
     the page says what it was narrowed to. A browser without :has() prints
     no controls. The page's own style block pins these with !important, so
     the html body prefix is needed to outrank it. */
  html body .tools-index :is(.tools-search, .tool-topics, .featured-tools, .tools-search-shortcut),
  html body .tools-index details.tool-category > summary::after,
  html body .tools-index .topic-button[aria-pressed="false"] {
    display: none !important;
  }

  html body .tools-index:has(.tools-directory[hidden]) .tools-search {
    display: grid !important;
  }

  html body .tools-index:has(#tools-empty:not([hidden])):has(.topic-button[aria-pressed="true"]:not([data-topic-filter="all"])) .tool-topics {
    display: flex !important;
  }

  /* The search reads as text, "Search tools: jwt", and a card's link has
     nothing to press on paper. */
  /* The page-frame rule for header also caught this one and indented it. */
  html body .tools-index .tools-catalog-head {
    width: auto;
    margin-inline: 0;
  }

  html body .tools-index .tools-search input,
  html body .tools-index .tools-search input:focus {
    min-height: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: none !important;
    box-shadow: none !important;
    appearance: none;
  }

  html body .tools-index .tools-search input::-webkit-search-cancel-button {
    display: none;
  }

  html body .tools-index .tool-card-action {
    display: none !important;
  }

  html body .tools-index .tool-card {
    break-inside: avoid;
  }

  /* A category label stays with its first row of cards instead of closing
     a page on its own. */
  html body .tools-index details.tool-category > summary {
    break-after: avoid;
  }

  html body .tools-index details.tool-category .tool-list {
    break-before: avoid;
  }

  /* Each category's closing rule is a divider; the last one had nothing
     after it and ended the document on a stray line. */
  html body .tools-index details.tool-category:last-of-type {
    border-bottom: 0 !important;
  }

  /* Directory, home and tool titles on paper avoid a lone character on the
     last line, as on screen; report pages keep the balanced headings that
     article.css gives them on paper. */
  html body[data-page]:not([data-page="radar-report-detail"]) :is(main h1, main h2, .report-title, .tool-card-head h3) {
    text-wrap: pretty;
  }

  /* About sections print as a one-column grid, which moved a whole section
     to the next page and left half of page one blank; as plain blocks they
     break between subsections. */
  html body .about-page .about-section {
    display: block;
  }

  html body .about-page .about-section > h2 {
    margin-bottom: 12px;
  }

  html body .about-page .about-prose > div {
    break-inside: avoid;
  }

  /* The recent-research strip, the "latest" kicker and the tool search form
     are screen navigation aids; print keeps the home page to its lead report
     and the featured tool list. The fixed skip link and the menu button were
     printing at the foot of every home and directory page. */
  .home-recent,
  .home-report-kicker,
  .home-search,
  .home-toolkit-head > a,
  .skip-link,
  .site-nav-toggle {
    display: none !important;
  }

  /* "Read the report" links print as bordered buttons that cannot be
     pressed; the lead report's title and summary already stand for it. */
  .radar-directory .featured-report .article-link,
  .home-report-cta {
    display: none !important;
  }

  /* The "copy page link" button under each tool does nothing on paper. */
  html body .safe-share {
    display: none !important;
  }

  /* The site footer is one tagline under a page whose header already
     carries the name. When the content above filled a page, it printed a
     page of its own; report pages already leave it off paper. */
  html body[data-page] > footer {
    display: none !important;
  }

  /* Nothing follows main on paper, and a browser keeps a box's bottom padding
     with its last child, so this space pushed a last card off a page it fit on. */
  html body[data-page]:not([data-page="radar-report-detail"]) main {
    padding-bottom: 0;
  }

  /* Without the link, the home tool heading could close page one alone. The
     lead report's closing rule then stayed on page one with nothing under it. */
  html body .home-toolkit-head,
  html body .home-toolkit-title,
  html body .home-featured-head {
    break-after: avoid;
  }

  html body[data-page="home"] .home-report {
    border-bottom: 0;
  }

  html body[data-page="home"] .home-toolkit {
    padding-top: 0;
    break-inside: avoid;
  }

  /* The analysis page after a run keeps its results; the input stays folded
     away, and its buttons and closed disclosures are screen controls, as on
     the tool pages. */
  html body .analysis-hub :is(button, .hub-exports, details:not([open])) {
    display: none !important;
  }

  /* A tool page on paper records what the tool produced. Buttons, output
     toolbars, file pickers, closed disclosures and the options that were
     not chosen do nothing there; a chosen option prints as its label. */
  html body:is([data-surface="tool"], [data-page^="analysis-"]) main :is(
    button,
    .button,
    .output-toolbar,
    .output-toolbar-compact,
    [class*="file-drop"],
    input[type="file"],
    input[type="radio"],
    input[type="checkbox"],
    details:not([open])
  ),
  html body:is([data-surface="tool"], [data-page^="analysis-"]) main label:has(> :is(input[type="radio"], input[type="checkbox"]):not(:checked), > * > input[type="checkbox"]:not(:checked)) {
    display: none !important;
  }

  /* Until a tool has something to show, its panel is an empty form, so the
     page prints its title, description and related tools. A prefilled demo
     has text in a textarea and prints; fields in a [hidden] region do not
     count either way, so a tab of results is not judged by a closed tab's
     empty form. Every tool textarea has a placeholder, which makes it the
     test. The key tool has one masked field and shows its own empty message,
     and so does the CVSS comparison. The TOTP tool has a prefilled secret and
     no code until asked for one. */
  html:not([data-print-judged]) body[data-surface="tool"] .tool-panel:is(:has(textarea:placeholder-shown:not([hidden] *)):not(:has(textarea:not(:placeholder-shown):not([hidden] *))), :has(.ka-empty:not([hidden] *), .cvss-empty:not([hidden], [hidden] *), #totp-generated-details[hidden])) {
    display: none !important;
  }

  /* main.js judges each panel and each [data-print-unit] in it by what the
     reader did there; see judgeUnitsForPrint. When no panel was used, the page
     keeps its related tools. */
  html body main [data-print-unused] {
    display: none !important;
  }

  /* Related tools are links to go on with, of no use on paper beside a
     result, where they often took the last page alone. An unused tool keeps
     them; with the panel gone, the header's rule already separates them and
     theirs would print as a second line beneath it. */
  html body[data-surface="tool"] .related-tools {
    display: none;
  }

  html:not([data-print-judged]) body:is([data-surface="tool"], [data-page^="analysis-"]) main > .tool-panel:is(:has(textarea:placeholder-shown:not([hidden] *)):not(:has(textarea:not(:placeholder-shown):not([hidden] *))), :has(.ka-empty:not([hidden] *), .cvss-empty:not([hidden], [hidden] *), #totp-generated-details[hidden])) ~ .related-tools {
    display: block;
    border-top: 0;
    padding-top: 0;
  }

  html body[data-surface="tool"] main[data-print-idle] .related-tools {
    display: block;
    border-top: 0;
    padding-top: 0;
  }

  /* A second panel left empty in a used tool does not make it unused. */
  html:not([data-print-judged]) body:is([data-surface="tool"], [data-page^="analysis-"]) main:has(.print-value) .related-tools {
    display: none !important;
  }

  /* In a used tool, a field still empty would print as an empty frame around
     its placeholder, and a status line with nothing to report says nothing. */
  html body:is([data-surface="tool"], [data-page^="analysis-"]) main :is(textarea, input):placeholder-shown,
  html body:is([data-surface="tool"], [data-page^="analysis-"]) main label:has(> :is(textarea, input):placeholder-shown),
  html body:is([data-surface="tool"], [data-page^="analysis-"]) main label:has(+ :is(textarea, input):placeholder-shown),
  html body:is([data-surface="tool"], [data-page^="analysis-"]) main :is(.output-field, .tool-verdict):has(textarea:placeholder-shown):not(:has(textarea:not(:placeholder-shown))):not(:has(.status:not(:empty), .tool-status:not(:empty), .error)),
  html body:is([data-surface="tool"], [data-page^="analysis-"]) main :is(.status, .tool-status, .tool-verdict):empty,
  html body:is([data-surface="tool"], [data-page^="analysis-"]) main :is(.sri-result-stage, .timestamp-result-stage):not(:has(.print-value)),
  html body:is([data-surface="tool"], [data-page^="analysis-"]) main .tool-result-list:not(:has(> :not(details:not([open])))),
  html body:is([data-surface="tool"], [data-page^="analysis-"]) main .tool-filter-bar:has(~ .tool-result-list > details:not([open])):not(:has(~ .tool-result-list > details[open])),
  html body:is([data-surface="tool"], [data-page^="analysis-"]) main .http-headers-parser:not(:has(.print-value)),
  html body:is([data-surface="tool"], [data-page^="analysis-"]) main :is(.button-row, .tool-actions):not(:has(> :not(button, .button, input[type="file"]))),
  html body:is([data-surface="tool"], [data-page^="analysis-"]) main .chmod-special-row:not(:has(:checked)),
  html body:is([data-surface="tool"], [data-page^="analysis-"]) main :is(.cron-template-label, .regex-template-row, label:has(> #regex-template), #nel-count, .base64-canvas-head, .color-canvas-head, .diff-canvas-head),
  html body:is([data-surface="tool"], [data-page^="analysis-"]) main :is(.sqlite-topbar, .sqlite-schema-card, .sqlite-shortcuts, .sqlite-history-card),
  html body:is([data-surface="tool"], [data-page^="analysis-"]) main .sqlite-management > section:not(:has(.print-value, .error, [data-state="error"])),
  html body:is([data-surface="tool"], [data-page^="analysis-"]) main .sqlite-result-card:has(.sqlite-empty),
  html body:is([data-surface="tool"], [data-page^="analysis-"]) main:has(.sqlite-result-card .sqlite-empty) #sqlite-status:not(.error, [data-state="error"]),
  html body:is([data-surface="tool"], [data-page^="analysis-"]) main :is(.sqlite-shortcut, .sqlite-evidence:not(:has(.print-value))),
  html body:is([data-surface="tool"], [data-page^="analysis-"]) main :is(.graphql-command-bar, .codec-step-card.is-skipped, .sqlite-evidence-head p),
  html body:is([data-surface="tool"], [data-page^="analysis-"]) main label:has(> :is(select, input, textarea):disabled),
  html body #jwt-verdict-strip[data-state="waiting"] {
    display: none !important;
  }

  /* SQLite keeps its column names in the sort buttons, and Chromium leaves a
     button blank in a header repeated at the top of a page: every column but
     the row number lost its name from the second sheet on. The cell prints
     the name it carries instead, and the button stays off the page like the
     rest. */
  html body:is([data-surface="tool"], [data-page^="analysis-"]) main #sqlite-result-wrap th[data-sqlite-column]::before {
    content: attr(data-sqlite-column);
  }

  html body:is([data-surface="tool"], [data-page^="analysis-"]) main #sqlite-result-wrap .sqlite-sort-indicator {
    display: none;
  }

  /* The result filter prints as an empty box between "结果表" and its
     table. A page could break after it, leaving the heading alone at the
     foot of a sheet, so like the output toolbar row it stays with what
     follows. */
  html body:is([data-surface="tool"], [data-page^="analysis-"]) main .sqlite-result-filter {
    break-after: avoid;
  }

  html body:is([data-surface="tool"], [data-page^="analysis-"]) main .sqlite-evidence-head {
    break-after: avoid;
  }

  /* A field that can hold a secret is off paper by this rule alone, so it
     stays off where the script does not run; main.js leaves a note in its
     place. */
  html body main :is([data-print-omit], [data-print-empty]) {
    display: none !important;
  }

  /* A message that holds a place until there is a result, and a control that
     only changes the screen, such as "show password", have nothing to say on
     paper. Templates set data-print-waiting while they wait. */
  html body main :is([data-print-waiting], [data-print-screen-only]) {
    display: none !important;
  }

  /* A filtered list says what it was narrowed to (main.js writes the line
     from the list's data-filter-* attributes). */
  html body main .print-filter-note {
    display: block;
    margin: 0 0 6px;
    color: var(--text-secondary);
    font-family: var(--font-ui);
    font-size: 12px;
    break-after: avoid;
  }

  /* A row of a data tree, or a card of a filtered list, folded on screen
     prints as its title line, marked as folded, so paper keeps what the
     screen showed. */
  html body:is([data-surface="tool"], [data-page^="analysis-"]) main :is(details[data-print-summary-only], [data-filter-label]:not([data-filter-label=""]) details):not([open]) {
    display: block !important;
  }

  html body:is([data-surface="tool"], [data-page^="analysis-"]) main :is(details[data-print-summary-only], [data-filter-label]:not([data-filter-label=""]) details):not([open]) > :not(summary) {
    display: none !important;
  }

  html body:is([data-surface="tool"], [data-page^="analysis-"]) main :is(details[data-print-summary-only], [data-filter-label]:not([data-filter-label=""]) details):not([open]) > summary::after {
    content: "（已折叠）";
    display: inline !important;
    position: static;
    color: var(--text-secondary);
    font: inherit;
  }

  html body:is([data-surface="tool"], [data-page^="analysis-"]) main :is(details[data-print-summary-only], [data-filter-label]:not([data-filter-label=""]) details):not([open]):lang(en) > summary::after {
    content: " (collapsed)";
  }

  /* A table of short values a template keeps whole on paper. */
  html body main table[data-print-table="keep"] {
    font-size: 11px;
    table-layout: auto;
  }

  /* Its cells still break anywhere: the scope matches the shared table rule
     outside this block, which comes earlier, so this one wins. */
  html body:is([data-surface="tool"], [data-page^="analysis-"]) main table[data-print-table="keep"] :is(th, td) {
    padding: 3px 6px;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  html body main table[data-print-table="keep"] thead {
    display: table-header-group;
  }

  html body main table[data-print-table="keep"] tr {
    break-inside: avoid;
  }

  /* Every row of a tool's table that stays a table is read whole: split at a
     page, a row left its name on one sheet and its values on the next, under
     a repeated header with empty cells. */
  html body:is([data-surface="tool"], [data-page^="analysis"]) main tr {
    break-inside: avoid;
  }

  /* main.js marks a row taller than a sheet. Kept whole, it moved to the
     next sheet, left this one blank below its heading and split there
     anyway, so it breaks like any other block. */
  html body:is([data-surface="tool"], [data-page^="analysis"]) main table tr[data-print-row-flow] {
    break-inside: auto;
  }

  /* A textarea cannot split across pages and a single-line field cuts off
     what does not fit, so while printing main.js gives each filled one a plain
     block of its text. A short value stays whole with its label; a long one
     starts beside its label and runs on. Where the script does not run, a
     textarea still grows to its content instead of ending at the box's edge. */
  html body main :is(textarea, input):has(+ .print-value) {
    display: none !important;
  }

  html body main .print-value {
    display: block;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid var(--line-container);
    border-radius: var(--radius-control);
    background: var(--surface-output);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 400;
    line-height: 1.45;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    orphans: 3;
    widows: 3;
    break-inside: avoid;
  }

  html body main .print-value.print-value-long {
    break-before: avoid;
    break-inside: auto;
  }

  html body main .print-value.print-value-omitted {
    padding: 0;
    border: 0;
    background: none;
    color: var(--text-secondary);
    font-family: var(--font-ui);
  }

  /* A label sets its value under its name the same way whether the value
     came from a text field or a select, so a row of them lines up. */
  html body main :is(label, .output-field):has(> :is(.print-value, select)) {
    display: block;
  }

  html body main label > :is(.print-value, select) {
    margin-top: 4px;
  }

  html body main :is(label, .output-field):has(> :is(.print-value, select)) + :is(.status, .tool-status):not(:empty),
  html body main .tool-panel > :is(.status, .tool-status):not(:empty) {
    margin-top: 10px;
  }

  html body main :is(label, .output-field):has(> .print-value:not(.print-value-long)) {
    break-inside: avoid;
  }

  @supports (field-sizing: content) {
    html body:is([data-surface="tool"], [data-page^="analysis-"]) main textarea {
      field-sizing: content;
      height: auto;
      min-height: 0;
      resize: none;
    }
  }

  /* A frame around a printed value is screen furniture: when its value moved
     to the next page, it stayed behind as an empty box at the foot of this
     one. Its padding goes too: without the frame it only shifted the contents
     out of line, and at the end of a page spilled to a blank one. Side-by-side
     outputs stay top-aligned when their heights differ. */
  html body:is([data-surface="tool"], [data-page^="analysis-"]) main :is(.tool-panel, .tool-panel :is(div, section, details, aside)):has(.print-value) {
    padding-inline: 0;
    padding-bottom: 0;
    border-color: transparent;
    background: none;
    box-shadow: none;
  }

  html body:is([data-surface="tool"], [data-page^="analysis-"]) main :is(div, span):has(> table) {
    border: 0;
    background: none;
  }

  html body:is([data-surface="tool"], [data-page^="analysis-"]) main :is(.output-grid, .tool-output-grid) {
    align-items: start;
  }

  /* See flowGridsForPrint in main.js: a grid's direct text was a row of its
     own, and stays one as a block. */
  html body:is([data-surface="tool"], [data-page^="analysis-"]) main label > .tool-result-list {
    color: var(--text-primary);
    font-weight: 400;
    break-before: avoid;
  }

  /* Kept below the rules that take a box off paper, which it would
     otherwise outrank by coming later. */
  html body main :where(.print-flow) {
    display: block !important;
  }

  html body:is([data-surface="tool"], [data-page^="analysis-"]) main .print-flow > * + * {
    margin-top: min(var(--print-gap-above, 14px), 14px);
  }

  html body:is([data-surface="tool"], [data-page^="analysis-"]) main .print-flow > .print-first {
    margin-top: 0;
  }

  html body:is([data-surface="tool"], [data-page^="analysis-"]) main .print-options {
    align-items: start;
    break-inside: avoid;
  }

  html body:is([data-surface="tool"], [data-page^="analysis-"]) main .print-flow > :is(span, a, label, small, strong, code),
  html body:is([data-surface="tool"], [data-page^="analysis-"]) main .print-flow > a > :is(span, strong) {
    display: block;
  }

  /* A row of short figures stays a row: stacked, each took the full width and
     a tool's numbers ran on to a page of their own. The rule has no weight of
     its own, so its layout is marked important: a tool's own "gap: 0" butted
     the cards together, and its screen columns or spans left a card alone on
     a row. Columns of one width, as many as fit a sheet, keep every card the
     same size; a last card on a row of its own no longer runs the full width,
     and a short row's cards share the width between them. */
  html body main :where(.tool-metric-grid.print-flow:has(> * > :is(strong + span, span + strong))) {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)) !important;
    gap: 8px !important;
    break-inside: avoid;
  }

  html body:is([data-surface="tool"], [data-page^="analysis-"]) main .tool-metric-grid.print-flow:has(> * > :is(strong + span, span + strong)) > * {
    box-sizing: border-box;
    grid-column: auto !important;
    grid-row: auto !important;
    margin-top: 0;
  }

  /* A card the tool marks as holding a long value, such as a namespace URI,
     takes a row of its own after the others: at one card's width the value
     broke every dozen characters and made its whole row as tall. */
  html body:is([data-surface="tool"], [data-page^="analysis-"]) main .tool-metric-grid.print-flow:has(> * > :is(strong + span, span + strong)) > [data-print-wide] {
    grid-column: 1 / -1 !important;
    order: 1;
  }

  /* A card's name wraps between words, not inside one: at one card's width
     "最长行 UTF-8 字节" ended a line on 字 and began the next with 节. A
     name with no space that is wider than its card still breaks. */
  html body:is([data-surface="tool"], [data-page^="analysis-"]) main .tool-metric-grid.print-flow:has(> * > :is(strong + span, span + strong)) > * > * {
    word-break: keep-all;
    overflow-wrap: anywhere;
  }

  html body:is([data-surface="tool"], [data-page^="analysis-"]) main :is(.tool-result-card, .tool-metric, .tool-metric-grid > *, .cvss-result, .cors-guide-block, .pkce-export-row, .ka-field, fieldset, article, li, [class*="-card"]) {
    break-inside: avoid;
  }

  /* Kept whole, a card holding a table or a long list moved to the next page
     and left most of this one blank. Its rows and items still keep whole. */
  html body:is([data-surface="tool"], [data-page^="analysis-"]) main :is(.tool-result-card, .tool-metric, [class*="-card"], fieldset, article):has(table, pre, .print-value-long, ul > li:nth-child(6), ol > li:nth-child(6)) {
    break-inside: auto;
  }

  /* The cron report's cards hold fixed-length lists of fields and runs; kept
     whole, they left blank space on each page and pushed the report's last
     lines onto a sheet of their own. */
  html body[data-surface="tool"] main .cron-card {
    break-inside: auto;
  }

  /* A scroll box cannot split across pages, and paper has no scrollbar: a
     panel with one moved to the next page whole, leaving only the title
     behind. The page's own bottom padding could also spill to a blank page. */
  html body:is([data-surface="tool"], [data-page^="analysis-"]) main,
  html body:is([data-surface="tool"], [data-page^="analysis-"]) main > .tool-panel,
  html body:is([data-surface="tool"], [data-page^="analysis-"]) main .tool-panel > :last-child {
    margin-bottom: 0;
    padding-bottom: 0;
  }

  html body:is([data-surface="tool"], [data-page^="analysis"]) main :is(div, section, form, details, aside, ul, ol, article, pre) {
    overflow: visible !important;
  }

  html body:is([data-surface="tool"], [data-page^="analysis-"]) main :is(h2, h3, summary, .output-toolbar-row) {
    break-after: avoid;
  }

  /* A label, a field's name or a small heading closed a page with its value on
     the next, and so did a section's one-line lead. A lead that ends its box
     has nothing to keep with: the rule would pass to the box and hold a run
     of small cards together, moving all of them to the next page. A heading
     class is one that ends in -head, -heading or -title: matching the text
     anywhere in the class also caught every security-headers-* and
     http-headers-* box, chained a whole result into one block, and left the
     first page as an empty frame. */
  html body:is([data-surface="tool"], [data-page^="analysis"]) main :is(h4, legend, .output-label, :is([class$="-title"], [class*="-title "], [class$="-head"], [class*="-head "], [class$="-heading"], [class*="-heading "], .pkce-result-stage-header, .text-inspector-risk-header):not(:has(textarea, table, ul, ol)), label:has(+ :is(textarea, input, select, .print-value))),
  html body:is([data-surface="tool"], [data-page^="analysis"]) main :is(h2, h3, h4, summary) + :is(p, .tool-note):not(:last-child) {
    break-after: avoid;
  }

  html body:is([data-surface="tool"], [data-page^="analysis"]) main label:has(> :is(select, input:not([type="checkbox"], [type="radio"]))) {
    break-inside: avoid;
  }

  html body:is([data-surface="tool"], [data-page^="analysis"]) main details[open] > summary + * {
    break-before: avoid;
  }

  /* With its frame gone, a disclosure's title kept the frame's inset. */
  html body:is([data-surface="tool"], [data-page^="analysis-"]) main details:has(.print-value) > summary {
    padding-inline: 0;
  }

  /* A disclosure opened for paper prints its title as a heading over what it
     holds. The screen's click-target padding and the contents' inset left
     the heading twice as far from its first field as from the output above,
     so it read as a caption of the wrong box. */
  html body:is([data-surface="tool"], [data-page^="analysis-"]) main details[data-print-open][open] > summary {
    padding-block: 0;
    margin-bottom: 6px;
  }

  html body:is([data-surface="tool"], [data-page^="analysis-"]) main details[data-print-open][open] > summary + * {
    margin-top: 0;
    padding-top: 0;
  }

  /* Values printed one after another need the gap the screen gave them. */
  html body:is([data-surface="tool"], [data-page^="analysis-"]) main :is(details, .output-field, .tool-status:not(:empty)) + :is(details, .output-field) {
    margin-top: 14px;
  }

  /* A select prints as its value, in the box of a text field's value; the
     shared field rule outranks this block, hence !important on its two
     properties. One left on its prompt prints not at all, chosen regex flags
     go under their name, and a metric keeps a gap between its name and its
     value. Character counts and an open disclosure's sign say nothing without
     the live page around them. */
  html body[data-page]:is([data-surface="tool"], [data-page^="analysis-"]) main select {
    display: block;
    width: 100%;
    min-height: 0;
    padding: 8px 10px;
    border: 1px solid var(--line-container);
    border-color: var(--line-container) !important;
    border-radius: var(--radius-control);
    background: none;
    background-color: var(--surface-output) !important;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 400;
    line-height: 1.45;
    appearance: none;
  }

  html body:is([data-surface="tool"], [data-page^="analysis-"]) main label:has(> select option[value=""]:checked),
  html:not([data-print-script]) body:is([data-surface="tool"], [data-page^="analysis-"]) main label:has(> select option[value="all"]:checked) {
    display: none !important;
  }

  html body:is([data-surface="tool"], [data-page^="analysis-"]) main .regex-workbench .regex-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  html body:is([data-surface="tool"], [data-page^="analysis-"]) main .regex-workbench .regex-flags {
    display: flex;
    gap: 8px;
  }

  html body:is([data-surface="tool"], [data-page^="analysis-"]) main .regex-workbench .regex-flags:has(:checked)::before {
    content: "Flags";
    font-weight: 600;
  }

  html body:is([data-surface="tool"], [data-page^="analysis-"]) main .regex-workbench .regex-flag {
    min-height: 0;
    padding: 0;
    border: 0;
    background: none;
  }

  html body:is([data-surface="tool"], [data-page^="analysis-"]) main .tool-metric > strong {
    margin-inline-end: 8px;
  }

  html body:is([data-surface="tool"], [data-page^="analysis-"]) main .cookie-summary strong {
    margin-inline: 4px;
  }

  /* Heights reserved for controls and live results reserve nothing on paper,
     a capped scroll list prints whole, and a label's row held controls that are gone: the empty box they sat in
     squeezed the label to one character a line. A checkbox left on paper was
     ticked, so it says so, and without its control it is plain text. The
     colour swatch and the sample beside it keep the strip height the colour
     tool gives them on paper. */
  html body:is([data-surface="tool"], [data-page^="analysis"]) main .tool-panel *:not(.color-swatch, .color-swatch-fill, .color-preview, .color-preview-sample) {
    min-height: 0;
    max-height: none !important;
    contain: none !important;
  }

  html body:is([data-surface="tool"], [data-page^="analysis-"]) main .output-toolbar-row {
    display: block;
  }

  html body:is([data-surface="tool"], [data-page^="analysis-"]) main :is(label:has(> input[type="checkbox"]), .xml-toggle) {
    padding: 0;
    border: 0;
    background: none;
  }

  html body:is([data-surface="tool"], [data-page^="analysis-"]) main label:has(> input[type="checkbox"]:checked:not(:disabled), > * > input[type="checkbox"]:checked:not(:disabled))::before {
    content: "\2713\00a0";
  }

  html body:is([data-surface="tool"], [data-page^="analysis-"]) main .url-step-count,
  html body:is([data-surface="tool"], [data-page^="analysis-"]) main summary::after {
    display: none !important;
  }

  /* A table that stays a table keeps its words whole by the shared table
     rules outside this block; main.js prints every table that cannot fit the
     sheet that way as labelled rows. */
  html body:is([data-surface="tool"], [data-page^="analysis-"]) main table {
    min-width: 0;
    font-size: 12px;
  }

  /* Four columns or more split ordinary words into fragments on a sheet, so
     main.js labels each cell and the table prints as labelled rows. */
  html body:is([data-surface="tool"], [data-page^="analysis-"]) main .print-cards,
  html body:is([data-surface="tool"], [data-page^="analysis-"]) main .print-cards :is(tbody, tr, th, td) {
    display: block;
    width: auto;
    min-width: 0;
  }

  html body:is([data-surface="tool"], [data-page^="analysis-"]) main .print-cards thead,
  html body:is([data-surface="tool"], [data-page^="analysis-"]) main .print-cards [data-print-label=""] {
    display: none;
  }

  /* The "-card" rule above also catches this class, which moved a long table
     to the next page whole and left most of the sheet before it blank. */
  html body:is([data-surface="tool"], [data-page^="analysis-"]) main .print-cards {
    break-inside: auto;
  }

  html body:is([data-surface="tool"], [data-page^="analysis-"]) main .print-cards tr {
    padding: 6px 0;
    border-bottom: 1px solid var(--line-hairline);
    break-inside: avoid;
  }

  html body:is([data-surface="tool"], [data-page^="analysis-"]) main .print-cards :is(th, td) {
    width: auto;
    min-width: 0;
    max-width: none;
    padding: 1px 0;
    border: 0;
    overflow-wrap: break-word;
    text-align: left;
  }

  html body:is([data-surface="tool"], [data-page^="analysis-"]) main .print-cards [data-print-label]::before {
    content: attr(data-print-label) ":\00a0";
    color: var(--text-secondary);
    font-weight: 700;
  }

  html body:is([data-surface="tool"], [data-page^="analysis-"]) main .print-cards [data-print-label]:lang(zh)::before {
    content: attr(data-print-label) "：";
  }

  /* A short value stays on its label's line ("值：敏感内容，未打印。"); code,
     a list, a table or a long value starts on the line after it. */
  html body:is([data-surface="tool"], [data-page^="analysis-"]) main .print-cards [data-print-label]:has(> :is(pre, ul, ol, table, .print-value-long))::before {
    display: block;
  }

  html body:is([data-surface="tool"], [data-page^="analysis-"]) main .print-cards td[data-print-label]:not(:has(> :is(pre, ul, ol, table, .print-value-long))) > :is(div, p, .print-value) {
    display: inline;
  }

  /* The related tools are a heading and a short row of cards; a page break
     cut the cards through their middle. Keep the block whole, and if it
     still has to break, keep each card whole and the heading with them. */
  html body .related-tools {
    break-inside: avoid;
  }

  html body .related-tools > h2 {
    break-after: avoid;
  }

  html body .related-tools-list > a {
    break-inside: avoid;
  }

  /* The analysis page before anything is analyzed: its result panel only
     says results will appear there, so paper keeps the title and lead. */
  html body .analysis-hub .hub-results:has(> #hub-empty:not([hidden])) {
    display: none !important;
  }

  html body .analysis-hub summary {
    break-after: avoid;
  }

  html body .analysis-hub,
  html body .analysis-hub .hub-results {
    padding-bottom: 0;
  }

  /* A form's parsed table repeats what was just kept off paper, passwords
     included, and a line with no "=" lands in it whole as a parameter name. */
  html body[data-surface="tool"] main .form-urlencoded-table-details {
    display: none !important;
  }

  /* An analysis page prints like a tool page: what the run found. What was
     pasted in is often the evidence itself, so the form stays off paper, along
     with filters that only change the view. Before a run the panels only say
     that results will appear, and the title and lead are all there is. */
  html body[data-page^="analysis-"] main :is(
    section[data-analysis-surface],
    section:has(> .analysis-drop),
    section:has(> .analysis-ioc-filters),
    .analysis-hash-filters,
    .analysis-email-export-control,
    .analysis-hero-art,
    .analysis-result-actions,
    .analysis-related
  ),
  html body[data-page^="analysis-"] main:has(textarea[id$="-report"]:placeholder-shown) section:not(.analysis-hero) {
    display: none !important;
  }

  html body[data-page^="analysis-"] main section:not(.analysis-hero) {
    margin-top: 14px;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
  }

  html body[data-page^="analysis-"] main .analysis-score-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  html body[data-page^="analysis-"] main :is(.analysis-score-row, [class*="-summary-grid"]) {
    gap: 8px;
    break-inside: avoid;
  }

  html body[data-page^="analysis-"] main :is(.analysis-score-card, .analysis-table) {
    break-inside: avoid;
  }

  /* A tool's sentences on paper do not end on a line holding one character
     and a full stop, as a report's conclusion did ("复" / "核。"). */
  html body:is([data-surface="tool"], [data-page^="analysis-"]) main .tool-panel :is(p, li) {
    text-wrap: pretty;
  }
}
