/* The workbench: the shell, the app bar, the token pane, the folding sections, the claims
   table and the JSON view, the signature pane and the status bar. Loaded by the shell
   layout only; css/app.css has the theme tokens and the controls shared with the rest. */

/* ==== ShellLayout ==== */

/* Fixed to the viewport, so the panes divide a known height between them and the
   page itself never scrolls: every pane that can overflow scrolls inside its own
   box, which is what keeps the token, its claims and the signature all on screen
   at once. */
:root {
    --jf-statusbar-h: 1.5rem;
}

.jf-shell {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--jf-bg);
    color: var(--jf-text);
    font-family: 'Inter', 'Segoe UI Variable Text', 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 0.875rem;
}

/* On a phone the fixed shell is given up. Three stacked panes inside one viewport
   height would leave the claims table a couple of centimetres tall, and the notes
   column is most of what the table is for - so the page scrolls instead, and each
   pane is as tall as it needs to be. */
@media (max-width: 57.59rem) {
    .jf-shell {
        position: static;
        min-height: 100dvh;
        overflow: visible;
    }
}

/* ==== AppHeader ==== */

.appbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: none;
    height: 2.75rem;
    padding: 0 0.625rem;
    background: var(--jf-chrome);
    border-bottom: 1px solid var(--jf-border);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.4375rem;
    flex: none;
}

.brand-mark {
    width: 1.25rem;
    height: 1.25rem;
    fill: var(--jf-seg-header);
}

.brand-mark-claims {
    fill: var(--jf-seg-claims);
}

.brand-mark-signature {
    fill: var(--jf-seg-signature);
}

.brand-name {
    color: var(--jf-text);
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.brand-name-accent {
    color: var(--jf-accent);
}

/* Set off from the wordmark by a rule rather than by distance, since the two are
   read together and the bar is too shallow for vertical separation to do it. */
.appbar-note {
    margin: 0;
    padding-left: 0.75rem;
    border-left: 1px solid var(--jf-border);
    color: var(--jf-muted);
    font-size: 0.75rem;
    white-space: nowrap;
}

.appbar-spacer {
    flex: 1;
    min-width: 0.25rem;
}

/* The tagline is the first thing to go: it is reassurance, and the controls beside
   it are the app. */
@media (max-width: 57.59rem) {
    .appbar {
        gap: 0.5rem;
    }

    .appbar-note {
        display: none;
    }
}

/* ==== ThemeToggle ==== */

.theme-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    flex: none;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--jf-border);
    border-radius: 999px;
    background: transparent;
    color: var(--jf-muted);
    font: inherit;
    font-size: 0.75rem;
    cursor: pointer;
}

.theme-btn:hover:not(:disabled) {
    background: var(--jf-chrome-hover);
    color: var(--jf-text);
}

.theme-btn:disabled {
    cursor: default;
    opacity: 0.6;
}

/* The label is the first thing to go when the chrome tightens - the glyph on its
   own still says which way the switch will move. */
@media (max-width: 1228.78px) {
    .theme-btn-label {
        display: none;
    }
}

/* ==== TokenInput ==== */

.pane[data-pane="token"] {
    --pane-hue: var(--jf-seg-claims);
}

/* The two boxes stacked in one place. The wrapper is the size; both children fill
   it exactly. */
.tok {
    position: relative;
    flex: 1;
    min-height: 0;
}

/* Everything that decides where a character lands is declared once here and
   inherited by both boxes, so the coloured copy and the textarea cannot disagree
   about it. A change to any one of these values without the other box getting it
   too is what makes an overlay like this drift out of line, so they are kept in a
   single rule that both children take from.

   `scrollbar-gutter: stable` matters as much as the font does: without it the
   textarea's scrollbar appearing narrows its content box, the two boxes wrap at
   different characters, and the colours slide a line out of place partway down a
   long token. */
.tok-ink,
.tok-edit {
    position: absolute;
    inset: 0;
    box-sizing: border-box;
    margin: 0;
    padding: 0.5rem 0.75rem;
    border: 0;
    font-family: 'JetBrains Mono', 'Cascadia Mono', 'Consolas', ui-monospace, monospace;
    font-size: 0.8125rem;
    line-height: 1.65;
    letter-spacing: 0;
    tab-size: 8;

    /* A token has no spaces and no natural break, so it has to be allowed to break
       anywhere - and both boxes have to break in the same place. */
    white-space: pre-wrap;
    word-break: break-all;
    overflow-wrap: anywhere;

    scrollbar-gutter: stable;
}

/* Behind the editor, and not in the way of it: every pointer event belongs to the
   textarea, including selecting the text through what looks like coloured glass. */
.tok-ink {
    overflow: hidden;
    pointer-events: none;
    user-select: none;
}

.tok-edit {
    z-index: 1;
    overflow: auto;
    resize: none;
    background: transparent;

    /* The characters are drawn by the box behind; what the textarea contributes is
       the caret, the selection and every keyboard behaviour a text field has. */
    color: transparent;
    caret-color: var(--jf-accent-bright);
}

.tok-edit::placeholder {
    color: var(--jf-faint);
}

.tok-edit:focus {
    outline: 0;
}

.tok-edit:focus-visible {
    box-shadow: inset 2px 0 0 var(--jf-seg-claims);
}

/* The selection has to stay visible through transparent text: without a background
   of its own the browser would paint the highlight and then the ink behind it would
   be the only thing showing, which reads as nothing being selected. */
.tok-edit::selection {
    background: var(--jf-accent-dim);
}

/* The three parts. These are the same three hues as the mark, the pane hairlines
   and the sections they decode into, which is the whole trick: the colour under the
   caret says which pane on the right is about to change. */
.tok-part {
    border-radius: 2px;
}

.tok-header {
    color: var(--jf-seg-header);
}

.tok-claims {
    color: var(--jf-seg-claims);
}

.tok-signature {
    color: var(--jf-seg-signature);
}

/* The dots are structure rather than content, so they are the one part of the token
   drawn in the text colour - it makes the boundaries read as boundaries. */
.tok-dot {
    color: var(--jf-text);
    font-weight: 700;
}

/* Text that is not a token at all. Uncoloured, because there are no parts to point
   at and three hues would be a claim about its shape that is not true. */
.tok-none {
    color: var(--jf-muted);
}

/* On a phone the pane no longer has a column stretching it, so the editor is given a
   height of its own: tall enough to read a real token in without scrolling the box,
   short enough that the claims are still on the first screen.

   Six lines exactly, computed from the same font size, line height and padding the two
   boxes above are laid out with - a round number of rem here would land part-way into a
   line and clip it through the middle of the glyphs. */
@media (max-width: 57.59rem) {
    .tok {
        flex: none;
        height: calc(1rem + 6 * 1.65 * 0.8125rem);
    }
}

/* ==== Section ==== */

/* Collapsed, the section is exactly its bar. Open, it takes as much of the column as
   its content needs and scrolls inside itself past that - so opening the header never
   pushes the claims table off the screen. */
.sec {
    display: flex;
    flex-direction: column;
    flex: none;
    min-height: 0;
    background: var(--jf-pane);
    border-top: 1px solid var(--jf-border);
}

.sec.is-open {
    /* Half the column at most: the claims are what the page is for, and an open
       header or signature pane is a detour from them. */
    max-height: 50%;
}

.sec-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: none;
    min-height: 1.875rem;
    padding: 0.1875rem 0.5rem 0.1875rem 0.25rem;
    background: var(--jf-pane-alt);
}

.sec.is-open .sec-head {
    border-bottom: 1px solid var(--jf-border-soft);
    box-shadow: inset 0 -1px 0 color-mix(in srgb, var(--sec-hue, var(--jf-accent)) 35%, transparent);
}

/* The whole title is the hit target, not just the chevron. */
.sec-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    flex: none;
    padding: 0.1875rem 0.375rem;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    color: var(--jf-text);
    font: inherit;
    cursor: pointer;
}

.sec-toggle:hover {
    background: var(--jf-chrome-hover);
}

.sec-toggle:focus-visible {
    outline: 2px solid var(--jf-accent-dim);
    outline-offset: -1px;
}

.sec-chevron {
    width: 0.75rem;
    height: 0.75rem;
    flex: none;
    fill: none;
    stroke: var(--jf-faint);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 140ms ease;
}

.sec.is-open .sec-chevron {
    transform: rotate(90deg);
}

.sec-title {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.sec-meta {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    min-width: 0;
    overflow: hidden;
    color: var(--jf-muted);
    font-size: 0.6875rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sec-spacer {
    flex: 1;
    min-width: 0.25rem;
}

.sec-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex: none;
}

.sec-body {
    flex: 1;
    min-height: 0;
    overflow: auto;
}

/* Stacked and scrolling, so nothing needs a height of its own to fit into. */
@media (max-width: 57.59rem) {
    .sec.is-open {
        max-height: none;
    }

    .sec-body {
        overflow: visible;
    }
}

/* ==== JsonView ==== */

.json {
    margin: 0;
    padding: 0.5rem 0.75rem 0.625rem;
    color: var(--jf-text);
    line-height: 1.6;

    /* Wrapped rather than scrolled sideways: a single long claim value - a
       certificate thumbprint, a nested token - would otherwise put every other line
       of the document behind a horizontal scrollbar. */
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.json-key {
    color: var(--jf-json-key);
}

.json-string {
    color: var(--jf-json-string);
}

.json-number {
    color: var(--jf-json-number);
}

/* A number that stands for a date. Marked, faintly, because a tooltip nobody knows is
   there is the same as no tooltip: the dotted underline is the only thing on the line
   saying that this run of digits has a reading. */
.json-tipped {
    text-decoration: underline dotted var(--jf-border);
    text-underline-offset: 0.1875rem;
    cursor: help;
}

.json-tipped:hover {
    text-decoration-color: var(--jf-accent);
}

.json-keyword {
    color: var(--jf-json-keyword);
}

/* A top-level name that copies its value. Drawn as the name it is, so the document reads
   the same; the wash on hover is what says it can be pressed. Its text stays selectable,
   so dragging across the JSON still takes the names with it. */
.json-copy {
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 3px;
    background: transparent;
    font: inherit;
    line-height: inherit;
    user-select: text;
    cursor: copy;
}

.json-copy:hover {
    background: var(--jf-accent-wash);
}

.json-copy:focus-visible {
    outline: 2px solid var(--jf-accent-dim);
    outline-offset: 0;
}

.json-copy.is-copied {
    background: var(--jf-good-wash);
}

.json-punct {
    color: var(--jf-faint);
}

.json-empty {
    margin: 0;
    padding: 0.625rem 0.75rem;
    color: var(--jf-faint);
    font-size: 0.75rem;
}

/* ==== ClaimsTable ==== */

.claims {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;

    /* The columns are sized by their content up to the widths set below, which keeps
       a table of three short claims from spreading them across the whole pane. */
    table-layout: auto;

    /* The height of the heading row, which the filter row beneath it has to be told in
       order to stick under rather than over it. Padding plus a line of the heading text;
       change either of those and this comes with them. */
    --claims-head-h: 1.5625rem;
}

.claims thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 0.3125rem 0.625rem;
    background: var(--jf-pane-alt);
    border-bottom: 1px solid var(--jf-border);
    color: var(--jf-muted);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

/* A sortable heading. The cell keeps its own padding so the sorted and unsorted headings
   line up with each other, and the button fills it rather than sitting inside it - a
   heading that only responds to its own text is a heading that is hard to hit. */
.claims-sort {
    display: flex;
    gap: 0.3125rem;
    align-items: baseline;
    width: 100%;
    margin: -0.3125rem -0.625rem;
    padding: 0.3125rem 0.625rem;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    text-align: left;
    text-transform: inherit;
    cursor: pointer;
}

.claims-sort:hover {
    color: var(--jf-text);
}

.claims-sort:focus-visible {
    outline: 2px solid var(--jf-accent-dim);
    outline-offset: -2px;
}

/* Faint until the column is the sorted one: enough to say the heading does something,
   not enough to compete with the three real arrows a table could otherwise show. */
.claims-mark {
    color: var(--jf-faint);
    opacity: 0.45;
}

.claims-sort:hover .claims-mark {
    opacity: 1;
}

.claims th[aria-sort="ascending"] .claims-mark,
.claims th[aria-sort="descending"] .claims-mark {
    color: var(--jf-accent);
    opacity: 1;
}

.claims th[aria-sort="ascending"],
.claims th[aria-sort="descending"] {
    color: var(--jf-text);
}

/* The filter row: sticky like the headings, and under them rather than over them - hence
   the offset, which is the one measurement in here that has to be kept in step with the
   row above. It carries the border the heading row used to, so the two read as one head. */
.claims thead td {
    position: sticky;
    top: var(--claims-head-h);
    z-index: 1;
    padding: 0.25rem 0.625rem;
    background: var(--jf-pane-alt);
    border-bottom: 1px solid var(--jf-border);
}

.claims thead tr:first-child th {
    border-bottom: 0;
}

/* Drawn as a line of the table rather than as a control sitting in it: no box until it is
   being used, the same restraint as the time button. The glass is what says it is a box.
   The flex row is a div inside the cell rather than the cell itself, which would stop being
   a table cell and take the column's width with it. */
.claims-filter-box {
    display: flex;
    gap: 0.375rem;
    align-items: center;
}

.claims-filter-box input {
    flex: 1;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--jf-text);
    font-size: 0.75rem;

    /* The browser's own clear cross would sit beside ours, and only in some engines. */
    appearance: none;
}

.claims-filter-box input::-webkit-search-cancel-button {
    display: none;
}

.claims-filter-box input::placeholder {
    color: var(--jf-faint);
    font-family: 'Inter', 'Segoe UI Variable Text', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.claims-filter-box input:focus {
    outline: 0;
}

/* The underline of the cell is the box's own border while it is being used - which is the
   only time the filter is drawn as a control at all. */
.claims-filter:focus-within {
    border-bottom-color: var(--jf-accent);
}

.claims-glass {
    color: var(--jf-faint);
    font-size: 0.8125rem;
    line-height: 1;
}

.claims-filter:focus-within .claims-glass {
    color: var(--jf-accent);
}

.claims-clear {
    padding: 0 0.125rem;
    border: 0;
    background: transparent;
    color: var(--jf-muted);
    font: inherit;
    font-size: 0.6875rem;
    line-height: 1;
    cursor: pointer;
}

.claims-clear:hover {
    color: var(--jf-text);
}

.claims-clear:focus-visible {
    outline: 2px solid var(--jf-accent-dim);
    outline-offset: 1px;
}

/* "3 of 27 shown", in the notes column - the width the table already has spare, and far
   enough from the box not to read as part of it. */
.claims-count {
    color: var(--jf-faint);
    font-size: 0.6875rem;
    text-align: right;
    white-space: nowrap;
}

.claims tbody th,
.claims tbody td {
    padding: 0.4375rem 0.625rem;
    border-bottom: 1px solid var(--jf-border-soft);
    text-align: left;
    vertical-align: top;
}

.claims tbody tr:hover {
    background: var(--jf-pane-alt);
}

/* The claim name is the row's own heading, and the thing the eye scans down. */
.claim-name {
    width: 1%;
    color: var(--jf-json-key);
    font-weight: 500;
    white-space: nowrap;
}

/* Sized to the value rather than to a fixed share of the table. The notes column used to
   be pinned at 45%, which meant this one was handed everything else whether it needed it
   or not - so a table of short values put a hand's width of nothing between each value and
   the note explaining it, which is the one pair of columns in here that is read across.
   Letting both size to their content puts the slack where the longer text is, and the cap
   below is what stops a certificate thumbprint claiming the whole pane.
   The floor keeps the column readable when a long value is wrapping: the anywhere-wrapping
   means its minimum content width is a single character, and the table would take it. */
.claim-value {
    min-width: 7rem;
    max-width: 26rem;
    color: var(--jf-text);
    word-break: break-word;
    overflow-wrap: anywhere;
}

.claim-value-line {
    display: flex;
    align-items: flex-start;
    gap: 0.375rem;
}

/* Sized to the value rather than stretched across the cell, so the copy button sits at
   the end of the value instead of out at the cell's far edge. */
.claim-value-text {
    flex: 0 1 auto;
    min-width: 0;
}

/* Out of sight until the row is pointed at or tabbed into, so a column of values does not
   become a column of icons. Where nothing hovers it is always there, faintly. */
.claim-copy {
    flex: none;
    display: inline-flex;
    margin-top: -0.0625rem;
    padding: 0.1875rem;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    color: var(--jf-muted);
    cursor: pointer;
    opacity: 0;
}

.claims tbody tr:hover .claim-copy,
.claim-copy:focus-visible,
.claim-copy.is-copied {
    opacity: 1;
}

@media (hover: none) {
    .claim-copy {
        opacity: 0.6;
    }
}

.claim-copy:hover {
    border-color: var(--jf-border);
    background: var(--jf-chrome-hover);
    color: var(--jf-text);
}

.claim-copy:focus-visible {
    outline: 2px solid var(--jf-accent-dim);
    outline-offset: -1px;
}

.claim-copy-tick,
.claim-copy.is-copied .claim-copy-glyph {
    display: none;
}

.claim-copy.is-copied {
    color: var(--jf-good);
}

.claim-copy.is-copied .claim-copy-tick {
    display: inline;
}

/* A value that is an object or an array gets its JSON, unindented from the cell so
   it reads as a block rather than as a very long line. */
.claim-value .json {
    padding: 0;
    font-size: 0.75rem;
}

/* The time button. Drawn as text, because it is the value - the only thing marking
   it as pressable is that it responds when you point at it. */
.claim-time {
    display: flex;
    flex-direction: column;
    gap: 0.0625rem;

    /* A written-out time is a single thing to read, and it is about thirty characters -
       long enough that the value column, left to compete with a column of prose, would
       shrink under it and break it across two lines. Refusing to wrap raises the column's
       own minimum instead, so the table finds the room; and it only does so for tables that
       actually hold a time, which a width on the column could not manage. */
    white-space: nowrap;
    margin: -0.1875rem -0.3125rem;
    padding: 0.1875rem 0.3125rem;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.claim-time:hover {
    border-color: var(--jf-border);
    background: var(--jf-chrome-hover);
}

.claim-time:focus-visible {
    outline: 2px solid var(--jf-accent-dim);
    outline-offset: -1px;
}

/* "in 59 minutes", under the time itself - the reading people actually want from
   exp, and the one neither the number nor the date gives them. */
.claim-time-rel {
    color: var(--jf-muted);
    font-family: 'Inter', 'Segoe UI Variable Text', 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 0.6875rem;
}

.claim-note {
    color: var(--jf-muted);
    font-size: 0.75rem;
    line-height: 1.5;
}

/* The reference, run on after the description rather than given a column of its
   own: it is the least-used thing in the row and would cost the notes their width. */
.claim-spec {
    margin-left: 0.375rem;
    color: var(--jf-accent);
    text-decoration: none;
    white-space: nowrap;
}

.claim-spec:hover {
    text-decoration: underline;
}

/* What this particular value means, as opposed to what the claim means. Set apart
   because it is the more specific of the two and easily the more useful. */
.claim-gloss {
    display: block;
    margin-top: 0.25rem;
    padding-left: 0.4375rem;
    border-left: 2px solid var(--jf-accent-dim);
    color: var(--jf-text);
}

/* The notes column, folded away by default. Scoped to the desktop layout on purpose: below
   it the table is stacked one claim per block and there is no heading row left to reopen
   the column from, so a note that has something to say keeps saying it there regardless of
   this setting. */
@media (min-width: 57.6rem) {
    .claim-note.is-collapsed,
    .claims-count.is-collapsed {
        display: none;
    }
}

.claims-empty {
    margin: 0;
    padding: 0.75rem;
    color: var(--jf-faint);
    font-size: 0.75rem;
}

/* Stacked on a phone: three columns of which one is a paragraph of prose cannot be
   done in 380 pixels, so each claim becomes a small block instead - name, value,
   note - which is the same information read downwards. */
@media (max-width: 57.59rem) {
    /* The headings go, as they always did - three columns of heading over stacked rows
       would say nothing. The filter row stays: a list read downwards on a phone is the
       one that most wants narrowing, and the box is the only part of the head that is
       still doing something once the columns are gone. */
    .claims thead tr:first-child {
        display: none;
    }

    .claims thead tr,
    .claims thead td {
        display: block;
    }

    /* Nothing above it any more, so it sticks to the top of the pane itself. */
    .claims thead td {
        top: 0;
    }

    /* Stacked, these would each be a blank line under the box. */
    .claims-blank,
    .claims-count:not(.is-on) {
        display: none;
    }

    /* One line under the head rather than one under each stacked cell - kept as a
       transparent border rather than none, so focus still underlines the box. */
    .claims thead td {
        border-bottom-color: transparent;
    }

    .claims thead tr:last-child {
        border-bottom: 1px solid var(--jf-border);
    }

    .claims-count {
        padding-top: 0;
        text-align: left;
    }

    .claims tbody tr {
        display: block;
        padding: 0.5rem 0.625rem;
        border-bottom: 1px solid var(--jf-border-soft);
    }

    .claims tbody th,
    .claims tbody td {
        display: block;
        min-width: 0;
        max-width: none;
        padding: 0;
        border: 0;
    }

    .claim-name {
        width: auto;
        margin-bottom: 0.125rem;
    }

    .claim-note:not(:empty) {
        margin-top: 0.375rem;
    }

    .claim-time {
        margin-left: 0;
        padding-left: 0;
    }
}

/* ==== Decode ==== */

/* The token on the left, what it decodes to on the right.

   Pane sizes are bare `fr` values so a drag just moves budget between neighbours;
   js/panes.js rewrites these custom properties during a drag. They must stay free
   of any `minmax()` floor - with a floor in the track, grid subtracts the floors
   before distributing the remainder, so sizes stop being proportional to the custom
   properties and the arithmetic in panes.js no longer holds. The minimum pane size
   is clamped in JS instead.

   The starting proportions are `var()` fallbacks rather than declarations on this
   element, because a remembered layout is applied to <html> before first paint (see
   _Layout.cshtml) and a declaration here would shadow what it inherits. */
.jf {
    position: relative;
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: var(--jf-size-token, 4fr) auto var(--jf-size-detail, 6fr);
    background: var(--jf-bg);
}

/* The header, the claims and the signature, in the order the token has them. The
   claims take whatever the other two leave, which is most of it - the sections cap
   themselves at half the column and collapse to their bars. */
.jf-detail {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.jf-claims {
    flex: 1;
    min-height: 0;
    --pane-hue: var(--jf-seg-claims);
}

.jf-claims-body {
    flex: 1;
    min-height: 0;
    overflow: auto;
}

/* A gutter in the shell colour, hairlined both sides, with a short grip in the
   middle. Which axis it serves is decided by its own box - see panes.js - so the
   media query below only restyles it, it never has to tell the script anything. */
.jf-split {
    position: relative;
    display: grid;
    place-items: center;
    width: 9px;
    border-inline: 1px solid var(--jf-border);
    background: var(--jf-bg);
    cursor: col-resize;
    touch-action: none;
}

.jf-split::after {
    content: "";
    display: block;
    width: 3px;
    height: 2rem;
    border-radius: 999px;
    background: var(--jf-faint);
    opacity: 0.5;
}

.jf-split:hover,
.jf-split:focus-visible {
    background: var(--jf-accent-wash);
    border-color: var(--jf-accent-dim);
    outline: none;
}

.jf-split:hover::after,
.jf-split:focus-visible::after,
.jf-split.is-dragging::after {
    background: var(--jf-accent);
    opacity: 1;
}

.jf-split.is-dragging {
    background: var(--jf-accent-wash);
    border-color: var(--jf-accent);
}

/* Bigger grab target on touch devices; the gutter keeps its weight because the
   extra width is padding in the shell colour. */
@media (pointer: coarse) {
    .jf-split {
        width: 17px;
    }
}

/* ── Under the token ────────────────────────────────────────────────────────── */

/* The two verdicts, side by side: whether the token is put together properly, and
   whether it is still in date. They are separate questions and a single badge for
   both would answer neither - an expired token is perfectly well formed. */
.jf-verdicts {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex-wrap: wrap;
}

.finds {
    margin: 0.5rem 0 0;
    padding: 0;
    list-style: none;
}

.finds:empty {
    margin: 0;
}

.find {
    display: flex;
    align-items: baseline;
    gap: 0.4375rem;
    padding: 0.125rem 0;
    color: var(--jf-muted);
    line-height: 1.45;
}

/* The mark is a fixed width so the sentences line up down the left however many
   findings there are and whatever mix of marks they carry. */
.find-mark {
    flex: none;
    width: 0.75rem;
    color: var(--tone, var(--jf-faint));
    font-weight: 700;
    text-align: center;
}

.find-bad {
    --tone: var(--jf-danger);
    color: var(--jf-text);
}

.find-warn {
    --tone: var(--jf-warn);
    color: var(--jf-text);
}

.find-note {
    --tone: var(--jf-faint);
}

/* The empty state: the invitation, and the examples. */
.jf-start {
    margin: 0;
    color: var(--jf-muted);
}

.jf-start-note {
    margin-top: 0.5rem;
    color: var(--jf-faint);
    font-size: 0.6875rem;
    line-height: 1.45;
}

.jf-examples {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
    margin-top: 0.4375rem;
}

.jf-dim {
    color: var(--jf-faint);
}

/* ── The signature pane ───────────────────────────────────────────────────────── */

.sig {
    display: flex;
    flex-direction: column;
    gap: 0.4375rem;
    padding: 0.5rem 0.75rem 0.625rem;
}

/* What the check came out as, in a sentence - the message the pane is really for.
   The badge in the bar above is the summary; this is the reason. */
.sig-said {
    margin: 0;
    padding: 0.375rem 0.5rem;
    border-left: 2px solid var(--tone, var(--jf-muted));
    background: var(--tone-wash, transparent);
    color: var(--jf-text);
    font-size: 0.75rem;
    line-height: 1.45;
}

.sig-good {
    --tone: var(--jf-good);
    --tone-wash: var(--jf-good-wash);
}

.sig-warn {
    --tone: var(--jf-warn);
    --tone-wash: var(--jf-warn-wash);
}

.sig-bad {
    --tone: var(--jf-danger);
    --tone-wash: var(--jf-danger-wash);
}

.sig-label {
    color: var(--jf-muted);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.sig-key {
    box-sizing: border-box;
    width: 100%;
    padding: 0.4375rem 0.5rem;
    border: 1px solid var(--jf-border);
    border-radius: 5px;
    background: var(--jf-chrome-2);
    color: var(--jf-text);
    line-height: 1.5;
    resize: vertical;

    /* A key set arrives as several hundred characters with no spaces in it. */
    word-break: break-all;
    overflow-wrap: anywhere;
}

.sig-key:focus-visible {
    border-color: var(--jf-accent-dim);
    outline: none;
}

.sig-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.sig-note {
    margin: 0;
    color: var(--jf-faint);
    font-size: 0.6875rem;
    line-height: 1.5;
}

.sig-note b {
    color: var(--jf-muted);
    font-weight: 600;
}

/* ── Status bar ───────────────────────────────────────────────────────────────── */

.statusbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: none;
    box-sizing: border-box;
    /* Fixed, so the privacy sheet can sit exactly on top of it. */
    height: var(--jf-statusbar-h);
    padding: 0 0.75rem;
    background: var(--jf-chrome);
    border-top: 1px solid var(--jf-border);
    color: var(--jf-muted);
    font-size: 0.6875rem;
}

.statusbar-item {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.statusbar-spacer {
    flex: 1;
}

.statusbar-note {
    min-width: 0;
    overflow: hidden;
    color: var(--jf-faint);
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Something the user asked for did not happen. Muted rather than red: nothing on
   screen is wrong, there is just another way to get at it. */
.statusbar-warn {
    min-width: 0;
    overflow: hidden;
    color: var(--jf-text);
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Feedback, Privacy and the privacy sheet are css/privacy-sheet.css and css/feedback.css,
   copies of shared/feedback-and-privacy/. */

/* ── Narrow screens ───────────────────────────────────────────────────────────── */

/* Not enough width for a status bar of three things and a hint. */
@media (max-width: 76.79rem) {
    .statusbar-note,
    .statusbar-item:nth-of-type(2) {
        display: none;
    }
}

/* Below tablet width the two columns become one, and the page scrolls rather than
   the panes: three panes sharing one viewport height would leave the claims table a
   couple of centimetres tall, and the notes column is most of what it is for.

   The splitter goes with the columns - there is nothing left to drag between. */
@media (max-width: 57.59rem) {
    .jf {
        display: flex;
        flex-direction: column;
    }

    .jf-split {
        display: none;
    }

    .jf-detail,
    .jf-claims,
    .jf-claims-body {
        overflow: visible;
    }

    .jf-claims {
        flex: none;
    }
}

/* ==== Restoring ==== */

/* While the inline script in Index.cshtml has a session waiting for js/workbench.js, the
   workbench and status bar are kept out of sight - still laid out, so nothing moves when
   they appear - and the app bar stays, so the page is plainly JwtFlex from the first paint. */
.jf-restoring .jf,
.jf-restoring .statusbar {
    visibility: hidden;
}

.jf-restoring-note {
    display: none;
}

/* Fixed rather than in the shell's flow, so showing it cannot shift the workbench under
   it. The delay keeps a warm load, which is done in well under it, from flashing the text. */
.jf-restoring .jf-restoring-note {
    display: grid;
    position: fixed;
    inset: 0;
    place-items: center;
    margin: 0;
    padding: 2rem;
    text-align: center;
    color: var(--jf-muted);
    font-size: 0.875rem;
    pointer-events: none;
    animation: jf-restoring-in 200ms ease 300ms both;
}

@keyframes jf-restoring-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ==== NotFound ==== */

/* Centred in what is left of the shell below the app bar. */
.missing {
    flex: 1;
    display: grid;
    place-items: center;
    padding: 2rem;
    text-align: center;
}

.missing h1 {
    margin: 0 0 0.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.missing p {
    margin: 0 0 1rem;
    color: var(--jf-muted);
}

.missing a {
    color: var(--jf-accent);
    font-size: 0.875rem;
}
