@import url("_reset.791019c96817.css");

@font-face {
    font-family: cabin;
    src: url("../type/cabin-latin-standard-normal.486b9da62704.woff2");
    font-weight: 400 700;
    font-stretch: 75% 100%;
}

@font-face {
    font-family: 'Adjusted Arial Fallback';
    src: local(Arial);
    size-adjust: 96%;
    ascent-override: 99%;
    descent-override: normal;
    line-gap-override: 6%;
}

:root {
  --brand-one: #fdc400;
  --brand-two: #1E171B;
  --exit: #02816B;
  --mandatory: #0472B9;
  --caution: var(--mandatory);
  --danger: #D7263D;
  --extra: #414288;

  /* Tints, precomputed as color-mix(in oklch, <colour> N%, white).
     WeasyPrint (server-side PDFs) doesn't support color-mix(). */
  --danger-8: #fff0ef;
  --danger-15: #fee2e1;
  --danger-50: #f59e9c;
  --exit-8: #eef5f2;
  --exit-15: #deece7;
  --exit-50: #93bfb2;
  --mandatory-8: #edf4fa;
  --mandatory-15: #ddeaf6;
  --mandatory-50: #90b9de;
  --text-20: #cdcbcc;
  --muted-4: #f8f8f8;
  --colour-stripe-dark: var(--brand-two);
  --colour-stripe-light: var(--brand-one);
  --stripe-width: 30px;
  --text: var(--brand-two);
  --bg: #fff;
  --muted: #555;
  --stripes: repeating-linear-gradient(
        135deg,
        var(--colour-stripe-dark) 0, var(--colour-stripe-dark) var(--stripe-width),
        var(--colour-stripe-light) var(--stripe-width), var(--colour-stripe-light) calc(var(--stripe-width) * 2)
  );

}

/* @link https://utopia.fyi/type/calculator?c=360,18,1.2,1240,20,1.25,5,2,&s=0.75|0.5|0.25,1.5|2|3|4|6,s-l&g=s,l,xl,12 */

:root {
  --step--2: clamp(0.7813rem, 0.7736rem + 0.0341vw, 0.8rem);
  --step--1: clamp(0.9375rem, 0.9119rem + 0.1136vw, 1rem);
  --step-0: clamp(1.125rem, 1.0739rem + 0.2273vw, 1.25rem);
  --step-1: clamp(1.35rem, 1.2631rem + 0.3864vw, 1.5625rem);
  --step-2: clamp(1.62rem, 1.4837rem + 0.6057vw, 1.9531rem);
  --step-3: clamp(1.944rem, 1.7405rem + 0.9044vw, 2.4414rem);
  --step-4: clamp(2.3328rem, 2.0387rem + 1.3072vw, 3.0518rem);
  --step-5: clamp(2.7994rem, 2.384rem + 1.8461vw, 3.8147rem);
}

/* @link https://utopia.fyi/space/calculator?c=360,18,1.2,1240,20,1.25,5,2,&s=0.75|0.5|0.25,1.5|2|3|4|6,s-l&g=s,l,xl,12 */

:root {
  --space-3xs: clamp(0.3125rem, 0.3125rem + 0vw, 0.3125rem);
  --space-2xs: clamp(0.5625rem, 0.5369rem + 0.1136vw, 0.625rem);
  --space-xs: clamp(0.875rem, 0.8494rem + 0.1136vw, 0.9375rem);
  --space-s: clamp(1.125rem, 1.0739rem + 0.2273vw, 1.25rem);
  --space-m: clamp(1.6875rem, 1.6108rem + 0.3409vw, 1.875rem);
  --space-l: clamp(2.25rem, 2.1477rem + 0.4545vw, 2.5rem);
  --space-xl: clamp(3.375rem, 3.2216rem + 0.6818vw, 3.75rem);
  --space-2xl: clamp(4.5rem, 4.2955rem + 0.9091vw, 5rem);
  --space-3xl: clamp(6.75rem, 6.4432rem + 1.3636vw, 7.5rem);

  /* One-up pairs */
  --space-3xs-2xs: clamp(0.3125rem, 0.1847rem + 0.5682vw, 0.625rem);
  --space-2xs-xs: clamp(0.5625rem, 0.4091rem + 0.6818vw, 0.9375rem);
  --space-xs-s: clamp(0.875rem, 0.7216rem + 0.6818vw, 1.25rem);
  --space-s-m: clamp(1.125rem, 0.8182rem + 1.3636vw, 1.875rem);
  --space-m-l: clamp(1.6875rem, 1.3551rem + 1.4773vw, 2.5rem);
  --space-l-xl: clamp(2.25rem, 1.6364rem + 2.7273vw, 3.75rem);
  --space-xl-2xl: clamp(3.375rem, 2.7102rem + 2.9545vw, 5rem);
  --space-2xl-3xl: clamp(4.5rem, 3.2727rem + 5.4545vw, 7.5rem);

  /* Custom pairs */
  --space-s-l: clamp(1.125rem, 0.5625rem + 2.5vw, 2.5rem);
}

html {
    background: var(--stripes);
    min-block-size: 100%;
    font-size: 100%;
}

body {
  font-family: cabin, "Adjusted Arial Fallback", system-ui, sans-serif;
  font-size: var(--step-0);
  line-height: 1.5;
  color: var(--text);
  margin: 0;
  padding: var(--space-s);
  @media(width >= 500px) {
    padding: var(--space-m);
  }
}

a:link, a:visited {
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

h1, .h1 {
  font-size: var(--step-3);
    color: var(--mandatory);
    & + article {
        margin-block-start: var(--space-s);
    }
}

h2, .h2 {
  font-size: var(--step-2);
    color: var(--extra);
}

h3, .h3 {
  font-size: var(--step-1);
}

h4, .h4 {
  font-size: var(--step-0);
}

header, main, footer {
    margin: 0;
}

header {
    padding: var(--space-l) 0;
    margin-block-end: var(--space-s);
    @media(width >= 500px) {
        margin-block-end: var(--space-xl);
    }
}

main {
    flex: 1 0 auto;
}

footer {
    padding-block: var(--space-m);
    padding-inline: var(--space-s);
    margin-block-start: var(--space-2xl);
    text-align: center;
    width: 100%;
    font-size: var(--step--1);
}

.wrapper {
    background-color: white;
    display:grid;
   grid-template-rows:auto 1fr auto;
   grid-template-columns:100%;
    min-height: calc(100vh - 4rem);
    min-height: calc(100svh - 4rem);
}

.container {
    margin-inline: auto;
    inline-size: 90%;
    @media(width >= 500px) {
        inline-size: min(80%, 1140px);
    }
}

.brand {
    color: var(--exit);
    font-size: var(--step-3);
    font-weight: 700;
    display: flex;
    flex-direction: column-reverse;
    justify-content: space-between;
    align-items: center;
    column-gap: 2ch;
    row-gap: var(--space-xs);
    @media(width >= 500px) {
        font-size: var(--step-5);
        flex-direction: row;
    }
    .title {
        display: flex;
        flex-direction: column;
        row-gap: var(--space-xs);
        text-align: center;
        small {
            font-size: var(--step-1);
            font-weight: 500;
            opacity: 0.8;
            line-height: 1;
        }
        @media(width >= 500px) {
            text-align: left;
            row-gap: 0;
        }
    }
    a:link, a:visited {
        text-decoration: none;
        color: currentcolor;
        line-height: 1;
    }
    svg {
        max-height: 1lh;
        width: auto;
        color: inherit; /* overrides the color= attribute, which is there for WeasyPrint */
    }
}

.intro {
    color: var(--brand-one);
    background-color: var(--brand-two);
    padding: var(--space-s);
    column-gap: var(--space-l);
    display: flex;
    flex-direction: column;
    align-items: center;
    border-radius: 9px;

    svg {
        width: 30px;
        height: auto;
        margin-block-start: 1ex;
        margin-block-end: 2ex;
    }

    h1 {
        font-size: var(--step-1);
        text-wrap: balance;
        line-height: 1.2;
        color: currentColor;
    }

    @media(width >= 500px) {
        padding: var(--space-m);
        flex-direction: row;
        align-items: unset;
        h1 {
            font-size: var(--step-2);
        }
        svg {
            width: 50px;
            margin-block-end: unset;
        }
    }

    & > div:last-of-type > * + * {
        margin-block-start: var(--space-s);
    }
}

a:link, a:visited {
    color: #58355E;
}

.link-with-icon {
    color: #58355E;
}

.link-cancel {
    margin-inline-start: var(--space-xs);
}

.link-icon {
    height: 0.8em;
    width: auto;
    margin-inline-end: 0.5ch;
}
.assessments {
    padding-block-start: var(--space-xl);
    text-align: center;
    .assessment {
        font-size: var(--step-1);
        h2 {
            font-size: var(--step-3);
            color: var(--mandatory);
        }
        p {
            text-wrap: balance;
        }
        small {
            font-weight: 300;
            opacity: 0.8;
        }
        svg {
            height: 3rem;
            width: auto;
            /*margin-block-end: var(--space-m);*/
            color: var(--mandatory);
        }
    }
}


.stack {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  --spacing: var(--space-m);

    &[data-stack-variant=small] {
        --spacing: var(--space-s);
    }

    &[data-stack-variant=large] {
        --spacing: var(--space-l);
    }

    &[data-stack-variant=extralarge] {
        --spacing: var(--space-xl);
    }
}

.stack > * {
  margin-block: 0;
}

.stack > * + * {
  margin-block-start: var(--spacing, 1.5rem);
}

.dual {
    display: flex;
    flex-direction: column;
    row-gap: var(--space-xl);
    @media(width >= 500px) {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: repeat(4, auto);
        column-gap: var(--space-m);
        row-gap: unset;
    }
    & > * {
        grid-row: 1 / -1;
        display: grid;
        grid-template-rows: subgrid;
        row-gap: var(--space-m);
        & > * {
            margin-inline: auto;
        }
    }
    &.dual.boxed {
        & > * {
            /*background-color: #f4f4f4;*/
            border-radius: 9px;
            /*padding: var(--space-s);*/
        }
    }
}

.miniform {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--space-s);
}

.field-stack {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--space-2xs);
    flex-wrap: wrap;
    label {
        margin-inline-end: 0.5ch;
    }
}

/* Tool name autocomplete (see static/js/combobox.js). Inherits the input's font. */
.combobox {
    position: relative;
    display: inline-block;
}
.combobox-options {
    position: absolute;
    inset-block-start: calc(100% + 2px);
    inset-inline-start: 0;
    z-index: 10;
    min-inline-size: 100%;
    max-block-size: 20em;
    overflow-y: auto;
    margin: 0;
    padding: var(--space-3xs) 0;
    list-style: none;
    font: inherit;
    line-height: 1.3;
    color: var(--text);
    background-color: var(--bg);
    border: 2px solid var(--brand-two);
    box-shadow: 0 4px 12px rgb(0 0 0 / 0.15);
    li {
        padding: var(--space-3xs) var(--space-2xs);
        white-space: nowrap;
        cursor: pointer;
    }
    [aria-selected="true"] {
        background-color: var(--brand-one);
    }
    .combobox-label {
        color: var(--muted);
        &::before { content: "("; }
        &::after { content: ")"; }
    }
}

.form {
    & > * + * {
        margin-block-start: var(--space-m);
    }
    label {
        font-weight: 600;
        margin-inline-end: 1ch;
    }
    /*label + input,*/
    /*label + .combobox {*/
    /*    margin-inline-start: 1ch;*/
    /*}*/
    .button {
        font-size: var(--step-0);
    }
    fieldset {
        border: none;
        /* Clear UA defaults: 2px side margin, and min-content sizing that
           lets the fieldset outgrow narrow viewports. */
        margin-inline: 0;
        min-inline-size: 0;
        background-color: #f8f8f8;
        padding: var(--space-s-m) var(--space-m-l);
        legend {
            /* Floated so it sits inside the background instead of
               straddling the fieldset's top edge. */
            float: left;
            inline-size: 100%;
            padding: 0;
            font-size: var(--step-2);
            font-weight: 700;
            margin-block-end: var(--space-s);
            overflow-wrap: anywhere;
            & + * {
                clear: both;
            }
        }
        p {
            text-wrap: pretty;
            margin-block: var(--space-s);
            max-width: 60ch;
        }
    }
    fieldset + fieldset {
        margin-block-start: var(--space-l);
    }

    fieldset:last-of-type {
        margin-block-end: var(--space-xl);
    }
}

.button, a.button {
    display: inline-flex;
  /*display: flex;*/
  overflow: hidden;

  padding: 1ex 2ch;

  cursor: pointer;
  user-select: none;
  transition: all 70ms linear;
  text-align: center;
  white-space: nowrap;
  text-decoration: none;

  border: 0 none;
  border-radius: 9px;

  font-size: var(--step-1);
  font-weight: 600;

  appearance:         none;

  justify-content: center;
  align-items: center;
    flex-wrap: wrap;
    column-gap: 0.5ch;

    background-color: var(--mandatory);
    color: white;

    @media(hover:hover) {
        &:hover {
            transition: all 70ms linear;

            opacity: .85;
        }
    }

  &:active {
    transition: all 70ms linear;
    opacity: .75;
  }

  &:focus {
    outline: 1px dotted #959595;
    outline-offset: -4px;
  }

    &[data-button-variant=extra] {
        background-color: var(--extra);
    }

    &[data-button-variant=delete] {
        background-color: var(--danger);
    }

    &[data-button-variant=copy] {
        background-color: var(--exit);
    }

    &[data-button-size=extrasmall] {
        padding: 0.5ex 1ch;
        font-size: var(--step--1);
    }

    &[data-button-size=small] {
        padding: 0.5ex 1ch;
        font-size: var(--step-0);
    }

    /* A wrapped flex row stretches to the full width of its container, so on
       narrow screens stack the note under the label instead: a column is only
       as wide as its longest line. */
    &:has(small) {
        flex-direction: column;

        @media(width >= 500px) {
            flex-direction: row;
        }
    }

    /* display: flex above would otherwise beat the hidden attribute. */
    &[hidden] {
        display: none;
    }
}

/* A link with a copy button after it. */
.copy-link {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2xs);

    a {
        overflow-wrap: anywhere;
    }
}

/* Radio groups as equal-width buttons.
   The input stays in the DOM (keyboard + screen reader friendly) but is visually
   hidden; the <span> after it is painted as the button, so `:checked + span`
   works in every browser without needing :has(). */

.choices {
    --choice: var(--mandatory);
    /* Shrink-wrap to content: every column is 1fr, so all buttons match the
       widest label rather than stretching across the fieldset. */
    display: inline-grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    max-inline-size: 100%;
    gap: var(--space-2xs);

    /* Stack on narrow screens */
    @media (width < 36em) {
        display: grid;
        grid-auto-flow: row;
    }
    margin-block-start: var(--space-s);

    label {
        position: relative;
        display: grid;
        font-weight: 600;
    }

    [data-value="clear"]     { --choice: var(--exit); }
    /* Same family as clear, but dashed: yes, but nobody has opened that door. */
    [data-value="assumed"]   { --choice: var(--exit); }
    [data-value="assumed"] span { border: 2px dashed var(--exit); }
    [data-value="unchecked"] { --choice: var(--caution); }
    [data-value="blocked"]   { --choice: var(--danger); }
    /* A pass, but not a checked door: the exit doesn't matter here. */
    [data-value="not_needed"] { --choice: var(--muted); }
    [data-value="not_needed"] span { border: 2px dotted var(--muted); }

    input {
        position: absolute;
        inset: 0;
        inline-size: 100%;
        block-size: 100%;
        margin: 0;
        opacity: 0;
        cursor: pointer;
    }

    span {
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 1ex 2ch;
        border: 2px solid transparent;
        /*border-radius: 9px;*/
        background-color: white;
        /* Fallback first, then a soft tint where color-mix() is supported */
        background-color: color-mix(in oklch, var(--choice) 18%, white);
        color: var(--choice);
        text-align: center;
        text-wrap: balance;
        cursor: pointer;
        user-select: none;
        transition: background-color 70ms linear, color 70ms linear, opacity 70ms linear;
    }

    @media (hover: hover) {
        label:hover span {
            background-color: color-mix(in oklch, var(--choice) 18%, white);
        }
    }

    input:checked + span {
        background-color: var(--choice);
        color: white;
    }

    input:focus-visible + span {
        outline: 3px solid var(--choice);
        outline-offset: 3px;
    }

    label:active span {
        opacity: .75;
    }

    /* Progressive enhancement: once an answer is picked, quieten the others */
    &:has(:checked) label:not(:has(:checked)) span {
        opacity: .6;
    }
    &:has(:checked) label:not(:has(:checked)):hover span {
        opacity: 1;
    }

    @media (prefers-reduced-motion: reduce) {
        span { transition: none; }
    }

    @media (forced-colors: active) {
        input:checked + span {
            forced-color-adjust: none;
            background-color: Highlight;
            color: HighlightText;
        }
    }
}

.verdict-wrapper {
    display: flex;
    flex-direction: column;
    column-gap: var(--space-m);
    row-gap: var(--space-s);
    align-items: flex-start;
    @media(width >= 500px) {
        flex-direction: row;
    }
    .verdict {
        margin-block-start: 0.5ex;
        background-color: #eee;
        color: var(--text);
        padding: 0.5ex 1ch;
        height: auto;
        line-height: 1.2;
        text-align: center;
        &[data-level="trapped"] {
            background-color: var(--danger);
            color: white;
        }
        &[data-level="partial"] {
            background-color: var(--mandatory);
            color: white;
        }
        &[data-level="clear"] {
            background-color: var(--exit);
            color: white;
        }
    }
}

.result-action {
    text-align: center;
    @media(width >= 500px) {
        text-align: unset;
    }
}
/* Exits recap on the results page: one row per question, columns aligned. */
table.exits {
    border-collapse: collapse;
    border-block-start: 1px solid #ccc;
    width: 100%;

    th, td {
        padding: 0.75ex 0.5ch;
        text-align: start;
        vertical-align: baseline;
        @media(width >= 500px) {
            padding: 0.75ex 1ch;
        }
    }

    td {
        font-weight: 550;
        &.state {
            &[data-state=blocked] {
                color: var(--danger);
            }
            &[data-state=clear], &[data-state=assumed] {
                color: var(--exit);
            }
            &[data-state=unchecked] {
                color: var(--mandatory);
            }
            &[data-state=not_needed] {
                color: #626262; /* color-mix(in oklch, var(--muted) 70%, gray) */
                font-style: italic;
            }
        }
        &.answer {
            font-weight: 400;
        }
        &.state {
            font-weight: 700;
            &[data-state=blocked] {
                background-color: var(--danger-8);
            }
            &[data-state=clear], &[data-state=assumed] {
                background-color: var(--exit-8);
            }
            &[data-state=unchecked] {
                background-color: var(--mandatory-8);
            }
            &[data-state=not_needed] {
                background-color: var(--muted-4);
            }
        }
    }

    tr {
        border-block-end: 1px solid #ccc;
    }

    th[scope="row"] { font-weight: 550; }

    .number {
        width: 1%;
        padding-inline-start: 0;
        text-align: end;
        font-variant-numeric: tabular-nums;
        white-space: nowrap;
    }

    .state { white-space: nowrap; }

    [data-state="unanswered"] .answer { font-style: italic; }
}

dl {
    dt {
        font-weight: 600;
        margin-block-end: var(--space-2xs);
    }
    dd {
        margin-inline-start: var(--space-xs);
        margin-block-end: var(--space-s);
        &:last-of-type {
            margin-block-end: 0;
        }
        small {
           font-size: var(--step--2);
            margin-inline-start: 1ch;
            opacity: 0.8;
        }
    }
}

ul.links-out {
    list-style: none;
    margin-block-start: var(--space-s);
    li + li {
        margin-block-start: var(--space-xs);
    }
}

.tool-context {
    & > dd {
        margin-inline-start: 0;
        color: #666;
        &[data-criticality="important"] {
            color: var(--danger);
        }
    }
}
article.tool-result {
    border-block-end: 1px dotted #999;
    padding-block-end: var(--space-xl);

    & > * + * {
        margin-block-start: var(--space-m);
    }
    & > h3 {
        font-size: var(--step-2);
            margin-block-start: 0;
    }
    section {
        margin-block-start: var(--space-xl);
        h2, h3 {
            margin-block-start: 0;
        }
    }
}

:is(.jurisdictions, .convert, .export, .sharing, .private-link, .catalogue-facts, .delete, .stack-tools, .add-tool, .next, .risk-map) {
    & > * + * {
        margin-block-start: var(--space-s);
    }
}

.notice {
    background-color: var(--brand-one);
    color: var(--brand-two);
    font-weight: 600;
    padding-inline: 1ch;
    display: inline-flex;
    margin-block-end: var(--space-xs);
}

ul.errors {
    list-style: none;
    background-color: var(--danger);
    color: white;
    font-weight: bold;
    padding-inline: 1ch;
    display: inline-flex;
    margin-block-end: var(--space-xs);
}
.email-pdf {
    border-block: 1px dotted var(--muted);
    padding-block: var(--space-s) var(--space-m);
    & > * + * {
        margin-block-start: var(--space-2xs);
    }
    label {
        font-weight: 600;
        margin-inline-end: 1ch;
    }
    .hint {
        font-size: var(--step--1);
        color: var(--muted);
    }
}

/* "Generated on" date in PDFs (assessments/pdf.html). */
.generated {
    color: var(--muted);
}

.catalogue-facts {
    summary {
        display: flex;
        align-items: baseline;
        gap: var(--space-2xs);
        cursor: pointer;
        list-style: none;

        &::-webkit-details-marker {
            display: none;
        }
        &::before {
            content: "▸";
            transition: rotate 0.15s ease;
        }
        & > * {
            margin: 0;
        }
    }
    details[open] > summary {
        margin-block-end: var(--space-s);
        &::before {
            rotate: 90deg;
        }
    }
}

:is(.retention, .edit-link) {
    margin-block-start: var(--space-s);
}

.stack-questions {
    h2 {
        margin-block-end: var(--space-l);
    }
    & > * + * {
        margin-block-start: var(--space-m);
    }
}

.owner-controls {
    margin-block-start: var(--space-2xl);
    background-color: #f8f8f8;
    padding: var(--space-m);
}

:is(a.share-link,a.owner-link) {
    padding: 0.4ex 1ch;
    border-radius: 9px;
    text-decoration: none;
    font-size: var(--step--1);
    @media(width >= 500px) {
        font-size: unset;
    }
}
a.share-link {
    outline: 1px solid var(--exit);
    color: var(--exit);
}
a.owner-link {
    outline: 1px solid var(--danger);
    color: var(--danger);
}

ul.list-basic {
    list-style: none;
}

.jurisdictions > table {
    border-collapse: collapse;
    table-layout: fixed;
    min-width: 40%;
    th {
        text-align: left;
    }
}
/* Notice under the risk map when several tools sign in with the same outside account. */
.shared-exit {
    padding: var(--space-xs) var(--space-s);
    border-inline-start: 4px solid var(--danger);
    background-color: var(--danger-8);
    max-inline-size: 65ch;
    & + & {
        margin-block-start: var(--space-xs);
    }
}

.risk-legend {
    font-size: var(--step--1);
    margin-block-start: var(--space-2xs);
    .untested-swatch {
        display: inline-block;
        inline-size: 2.5ch;
        block-size: 1em;
        vertical-align: -0.15em;
        border-radius: 999px;
        outline: 2px dashed var(--text);
        outline-offset: -2px;
    }
}

table.risk-table {
    border-collapse: collapse;
    width: 100%;
    caption {
        text-align: left;
        margin-block-end: var(--space-s);
    }
    th, td {
        border: 4px solid var(--bg);
        padding: 1ex 1ch;
        background-color: #f8f8f8;
    }
    th {
       background-color: #f2f2f2;
    }

    /* Two axes, two channels: colour is the verdict (columns),
       fill is the criticality (rows). */

    /* Column headers keep the verdict colours and act as the colour legend. */
    th[data-level=trapped] { color: var(--danger); }
    th[data-level=partial] { color: var(--mandatory); }
    th[data-level=clear]   { color: var(--exit); }

    /* Row headers are neutral, with a swatch showing the fill for that row. */
    th[scope=row] {
        text-align: left;
        &::before {
            content: "";
            display: inline-block;
            inline-size: 0.9em;
            block-size: 0.9em;
            margin-inline-end: 1ch;
            vertical-align: -0.1em;
            border-radius: 3px;
            border: 1px solid var(--text);
            background-color: var(--swatch);
        }
    }
    tr[data-criticality=stop]      { --swatch: var(--text); }
    tr[data-criticality=important] { --swatch: var(--text-20); }
    tr[data-criticality=nice]      { --swatch: white; }

    td {
        vertical-align: middle;
        block-size: 2.5lh;
    }
    td[data-level=trapped] { --sign: var(--danger);    --sign-15: var(--danger-15);    --sign-50: var(--danger-50); }
    td[data-level=partial] { --sign: var(--mandatory); --sign-15: var(--mandatory-15); --sign-50: var(--mandatory-50); }
    td[data-level=clear]   { --sign: var(--exit);      --sign-15: var(--exit-15);      --sign-50: var(--exit-50); }

    ul {
        list-style: none;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.6ex 0.8ch;
        padding: 0;
    }

    /* Chips: outlined by default (nice to have). */
    li {
        padding: 0.25ex 1.2ch;
        border-radius: 999px;
        border: 2px solid var(--sign);
        background-color: white;
        color: var(--text);
        font-size: var(--step--1);
        line-height: 1.4;
    }
    tr[data-criticality=important] li {
        background-color: var(--sign-15);
        font-weight: 550;
    }
    tr[data-criticality=stop] li {
        background-color: var(--sign);
        color: white;
        font-weight: 650;
    }

    /* Resting on unchecked "yes" answers. An outline works on every chip fill. */
    li[data-untested] {
        --dash-colour: var(--sign-50);

        outline: 2px dashed var(--dash-colour);
        outline-offset: 2px;
    }

    /* Business would stop and the tool is trapped: a hazard-striped frame.
       One position per stop: WeasyPrint rejects `colour 0 8px`. */
    td[data-priority=high]:not([data-empty]) {
        background-image: repeating-linear-gradient(
            135deg,
            var(--brand-two) 0, var(--brand-two) 8px,
            var(--brand-one) 8px, var(--brand-one) 16px
        );
        ul {
            background-color: #f5f5f5;
            padding: 1ex 1ch;
        }
    }
}


/* The risk map adapts to the width of its section, not the viewport. */
.risk-map {
    container-type: inline-size;
}

/* Narrow: each criticality row becomes a card. The row header (with its swatch)
   heads it, and each verdict cell becomes a labelled line in its verdict colour. */
@container (width < 36rem) {
    table.risk-table {
        &, caption, thead, tbody, tr, th, td {
            display: block;
        }
        thead {
            display: none;
        }
        tbody tr {
            display: grid;
            gap: 1ex;
            padding: 1ex 1ch;
            margin-block-end: var(--space-s);
            background-color: #f8f8f8;
        }
        th, td {
            border: 0;
            padding: 0;
            background-color: transparent;
        }
        td {
            display: grid;
            grid-template-columns: 9ch 1fr;
            align-items: center;
            column-gap: 1ch;
            block-size: auto;
            min-block-size: 2lh;
            &::before {
                content: attr(data-label);
                color: var(--sign);
                font-size: var(--step--1);
                font-weight: bold;
                text-transform: uppercase;
            }
        }
        td[data-empty]::after {
            content: "—";
            content: "—" / "";
        }
        ul {
            justify-content: flex-start;
            margin: 0;
        }

        /* Keep the hazard stripe, but give the label a solid backing to stay legible. */
        td[data-priority=high]:not([data-empty]) {
            padding: 1ex 1ch;
            &::before {
                align-self: stretch;
                display: flex;
                align-items: center;
                padding-inline: 1ch;
                background-color: #f5f5f5;
            }
        }
    }
}

table.list-owners {
    border-collapse: collapse;
    table-layout: fixed;
    caption {
        text-align: left;
        padding-block-end: 2ch;
    }
    tbody {
        tr {
            border-block-end: 2px solid var(--bg);
            background-color: #f4f4f4;
            &[data-jurisdiction="eu"] {
                 background-color: var(--mandatory-8);
            }
            &[data-jurisdiction="us"] {
                 background-color: var(--danger-8);
            }
        }
    }
    th, td {
            text-align: left;
            padding: 1ex 0.5ch;
    }
}

table.tool-list {
    display: table;
    border-collapse: collapse;
    width: 100%;
    thead {
        th {
            padding-block-end: 1ex;
        }
    }
    tbody {
        tr {
            border-block-end: 2px solid var(--bg);
            background-color: #f4f4f4;
        }
    }
    th, td {
            text-align: left;
            padding: 1ex 0.5ch;
    }
    td.tool-actions {
            display: flex;
            flex-direction: row;
            flex-wrap: wrap;
            align-items: center;
            gap: 1ex 1ch;
            form {
                margin: 0;
                padding: 0;
            }
    }
}

/* The table adapts to the width of its section, not the viewport. */
.stack-tools {
    container-type: inline-size;
}

/* Narrow: each row becomes a card. The tool name heads it, the answers stack
   underneath with their column label, and the actions drop to the bottom. */
@container (width < 40rem) {
    table.tool-list {
        &, thead, tbody, tr, th, td {
            display: block;
        }
        thead {
            display: none;
        }
        tbody tr {
            display: grid;
            gap: 1ex;
            padding: 1ex 1ch;
            margin-block-end: 1ex;
        }
        th, td {
            padding: 0;
        }
        th[scope=row] {
            font-size: var(--step-1);
        }
        td[data-label]::before {
            content: attr(data-label);
            display: block;
            font-size: var(--step--1);
            font-weight: bold;
        }
        td.tool-actions {
            display: flex;
            padding-block-start: 1ex;
        }
    }
}

/* Print and "Save as PDF". Hides interactive and secret parts (forms, owner controls,
   the private link), keeps verdict colours, and avoids awkward page breaks. */

@media print {
    @page {
        margin: 15mm;

        /* PDFs only (assessments/pdf.html, rendered by WeasyPrint). Browsers don't support running elements. */
        @bottom-center {
            content: element(pdf-footer);
        }
    }

    .pdf-footer {
        position: running(pdf-footer);
        font-size: var(--step--2);
        color: var(--muted);
        text-align: center;
    }

    :root {
        --step--2: 8pt;
        --step--1: 9pt;
        --step-0: 10.5pt;
        --step-1: 12.5pt;
        --step-2: 15pt;
        --step-3: 18pt;
        --step-4: 21pt;
        --step-5: 24pt;
    }

    html {
        background: none;
    }

    body {
        padding: 0;
    }

    .wrapper {
        display: block;
        min-height: auto;
    }

    .container {
        inline-size: auto;
    }

    /* Letterhead */
    header {
        padding: 0;
        margin-block-end: var(--space-m);
    }

    .brand {
        font-size: var(--step-2);
        justify-content: flex-start;
        flex-direction: row;

        .title {
            text-align: left;
        }

        small {
            display: none;
        }

        /* An explicit height: WeasyPrint (server-side PDFs) doesn't support `lh`. */
        svg {
            block-size: 1.5em;
            inline-size: 3.64em; /* the viewBox's 427:176 */
            max-height: none;
        }
    }

    /* Flex containers don't split across pages in WeasyPrint, and do so unreliably in
       some browsers. The stack's spacing comes from margins, so block layout looks the same. */
    .stack {
        display: block;
    }

    footer {
        display: none;
    }

    /* Interactive or secret: the private link works like a password, and the owner
       controls hold the share link. */
    form,
    button,
    .convert,
    .owner-controls,
    .sharing,
    .export,
    .retention,
    .delete,
    .private-link,
    .edit-link,
    ul.links-out,
    .alternatives[data-empty],
    .shared-notice a {
        display: none;
    }

    /* Browsers drop backgrounds when printing unless told otherwise. */
    .verdict,
    .shared-exit,
    table.exits td.state,
    table.list-owners tr,
    [data-level],
    [data-priority] {
        print-color-adjust: exact;
    }

    /* Pagination */
    h1, h2, h3, h4 {
        break-after: avoid;
    }

    .verdict-wrapper,
    table.exits,
    dl,
    .risk-map table,
    tr {
        break-inside: avoid;
    }

    thead {
        display: table-header-group;
    }

    /* Tools may split across pages; their verdict, exits table and facts don't.
       Keeping a whole tool together left section headings stranded alone on a page. */
    .tool-result {
        break-inside: auto;
    }

    .tool-result + .tool-result {
        border-block-start: 1px solid #ccc;
        padding-block-start: var(--space-m);
    }

    /* Links on paper */
    a:link,
    a:visited {
        color: inherit;
    }

    .alternative a[href^="http"]::after,
    dd[data-field="website"] a::after {
        content: " (" attr(href) ")";
        font-size: var(--step--2);
        color: var(--muted);
        word-break: break-all;
    }
}

