* {
    box-sizing: border-box;
}

/* The compact interface register, declared once for every surface: a
   compliance tool is read in volume, so 12px is the size the whole product
   reads at, admin and settings included. A component that wants another step
   names one from the scale. */
html, body {
    margin: 0;
    padding: 0;

    background: var(--color-surface) no-repeat;
    color: var(--color-text-primary);

    font-family: var(--body-font);
    font-size: var(--text-sm);
    line-height: var(--leading-sm);
    font-weight: var(--weight-normal);
}

/* global hyperlink styling */
a {
    color: var(--color-link);
    text-decoration: none;
}

/* Every focusable control takes the same ring, drawn from the tokens, declared
   once rather than per component. A component whose shape needs a different one
   overrides it on its own selector. */
:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
}

/* The chrome label: a tile's caption, a section heading, the rail's group name.
   It is a treatment applied to whatever element already carries the text, not a
   component wrapped around it. */
.bl-label {
    font-size: var(--text-xs);
    line-height: var(--leading-xs);
    font-weight: var(--weight-bold);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

/* Centred reading, for the authentication card and anything else whose text is
   read down the middle. Centring a flex container aligns its children but not
   the lines inside a sentence that wraps, and this is the half that has to
   cross a component boundary, so it is a class rather than a parameter. */
.bl-centred {
    text-align: center;
}

/* The illustrations are monochrome line work — black strokes with white fills
   inside them — drawn on a white ground. The ground has been cut out of the
   files so the page's own surface shows through, which leaves the line work
   itself invisible on the dark theme. Inverting the whole image is what fixes
   it: the strokes come out white and the fills inside them come out dark, so
   the drawing keeps the internal contrast that recolouring the strokes alone
   would flatten. */
:root[data-theme="dark"] .bl-illustration {
    filter: invert(1);
}

/* Form controls are the platform's own elements, so the design system skins
   them here once rather than in eleven scoped stylesheets. */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="url"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;

    padding: var(--space-xs);

    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-text-primary);

    font-family: inherit;
    font-size: var(--text-sm);
    line-height: var(--leading-sm);
    font-weight: var(--weight-normal);
}

/* A content list's search sits in the row of filter pills beside it, so it is drawn as one: the
   same height, the same pill, the same hairline. */
input[type="search"] {
    width: 260px;
    max-width: 100%;
    height: var(--pill-height);

    padding: 0 var(--space-md);

    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    background: var(--color-surface);
    color: var(--color-text-primary);

    font-family: inherit;
    font-size: var(--text-sm);
    line-height: var(--leading-sm);
    font-weight: var(--weight-prose);
}

input:not(:disabled):hover,
select:not(:disabled):hover,
textarea:not(:disabled):hover {
    background: var(--color-surface-sunken);
}

input:disabled,
select:disabled,
textarea:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

input[type="checkbox"],
input[type="radio"] {
    width: auto;
    accent-color: var(--color-accent);
    cursor: pointer;
}

/* The framework puts these on an input once its field has been touched and
   found wanting, and renders the message beneath it. */
input.invalid,
select.invalid,
textarea.invalid,
fieldset.invalid {
    border-color: var(--color-critical-fg);
}

.validation-message {
    font-size: var(--text-xs);
    line-height: var(--leading-xs);
    color: var(--color-critical-fg);
}