html, body {
    margin: 0;
}

.rt-page-title {
    margin-bottom: 1rem;
}

/* A list row that opens something when clicked. */
.rt-row {
    cursor: pointer;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.rt-row:last-child {
    border-bottom: none;
}

.rt-row:hover {
    background: var(--mud-palette-action-default-hover);
}

/* A list row that is not clickable as a whole. */
.rt-row-static {
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.rt-row-static:last-child {
    border-bottom: none;
}

.rt-markdown {
    white-space: pre-wrap;
    font-family: inherit;
    font-size: 0.875rem;
    margin: 0;
}

.rt-note {
    border-left: 2px solid var(--mud-palette-lines-default);
    padding: 0.25rem 0 0.75rem 0.75rem;
    margin-bottom: 0.5rem;
}

/* Label and value pairs in a detail panel. */
.rt-details {
    display: grid;
    grid-template-columns: 8rem 1fr;
    row-gap: 0.4rem;
    margin: 0;
    font-size: 0.875rem;
}

.rt-details dt {
    color: var(--mud-palette-text-secondary);
}

.rt-details dd {
    margin: 0;
}

/* Sign-in, setup and confirmation pages: one centred card, no navigation. */
.rt-account-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: #f7f8f9;
    font-family: Roboto, "Segoe UI", system-ui, sans-serif;
    color: #1b1f24;
    box-sizing: border-box;
}

.rt-account-card {
    width: 100%;
    max-width: 26rem;
    background: #fff;
    border: 1px solid #e3e6ea;
    border-radius: 8px;
    padding: 2rem;
    box-sizing: border-box;
}

.rt-account-brand {
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.rt-account-card h1 {
    font-size: 1.05rem;
    font-weight: 500;
    margin: 0 0 0.25rem;
}

.rt-account-card p {
    font-size: 0.875rem;
    line-height: 1.5;
    color: #5b6470;
    margin: 0 0 1.25rem;
}

.rt-field {
    margin-bottom: 1rem;
}

.rt-field label {
    display: block;
    font-size: 0.8125rem;
    color: #5b6470;
    margin-bottom: 0.25rem;
}

/* Every input in a field, not just the ones carrying an explicit type: Blazor's InputText
   renders <input> with no type attribute at all, so a [type="text"] selector matches none of
   them and the box loses its border, padding and width. */
.rt-field input,
.rt-field textarea {
    width: 100%;
    padding: 0.5rem 0.625rem;
    font-size: 0.9375rem;
    font-family: inherit;
    border: 1px solid #d5d9df;
    border-radius: 6px;
    box-sizing: border-box;
    background: #fff;
    color: inherit;
}

.rt-field input:focus {
    outline: 2px solid #2f5d8c;
    outline-offset: -1px;
    border-color: #2f5d8c;
}

.rt-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
}

.rt-button {
    width: 100%;
    padding: 0.5625rem 1rem;
    font-size: 0.9375rem;
    font-family: inherit;
    font-weight: 500;
    color: #fff;
    background: #2f5d8c;
    border: 1px solid #2f5d8c;
    border-radius: 6px;
    cursor: pointer;
}

.rt-button:hover {
    background: #264b70;
}

.rt-button.rt-danger {
    background: #b3261e;
    border-color: #b3261e;
}

.rt-button.rt-danger:hover {
    background: #8f1e18;
}

.rt-message {
    font-size: 0.875rem;
    padding: 0.625rem 0.75rem;
    border-radius: 6px;
    margin-bottom: 1.25rem;
}

.rt-message.rt-error {
    background: #fdeceb;
    border: 1px solid #f3c9c6;
    color: #8f1e18;
}

.rt-message.rt-notice {
    background: #f1f4f8;
    border: 1px solid #dbe2ea;
    color: #33414f;
}

.rt-code {
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-size: 1.0625rem;
    letter-spacing: 0.06em;
    background: #f1f4f8;
    border: 1px solid #dbe2ea;
    border-radius: 6px;
    padding: 0.75rem;
    word-break: break-all;
    margin-bottom: 1.25rem;
}

.rt-qr {
    display: block;
    margin: 0 auto 1.25rem;
    width: 200px;
    height: 200px;
    image-rendering: pixelated;
}

/* ---------------------------------------------------------------------------
   Status and priority, as segmented word selectors rather than dropdowns.

   One click sets a priority. Status works the same way to choose, but the move
   only happens once a note is written, because every status change needs one.

   The colours are muted on purpose: they sit next to body text all day, and a
   saturated red beside a paragraph is shouting. Each swatch is used as the text
   colour over a tint of itself rather than as a solid fill, which keeps the
   contrast honest in both themes without needing a second set of values for the
   text on top.
   --------------------------------------------------------------------------- */

.mud-theme-light, :root {
    --rt-low: #7A9A7E;
    --rt-medium: #D4A373;
    --rt-high: #D07C59;
    --rt-critical: #A64B4B;

    --rt-open: #6B7F99;
    --rt-testing: #D4A373;
    --rt-closed: #7A9A7E;

    --rt-segment-idle: #5B6470;
    --rt-segment-line: #E3E6EA;
    --rt-segment-hover: rgba(0, 0, 0, 0.04);
}

/* Lifted towards white so the same hues stay legible on a dark surface. */
.mud-theme-dark {
    --rt-low: #9BBC9F;
    --rt-medium: #E5BC93;
    --rt-high: #E39A7A;
    --rt-critical: #C97A7A;

    --rt-open: #93A7C0;
    --rt-testing: #E5BC93;
    --rt-closed: #9BBC9F;

    --rt-segment-idle: #9AA3AE;
    --rt-segment-line: #2A2F36;
    --rt-segment-hover: rgba(255, 255, 255, 0.06);
}

.rt-segments {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 2px;
    border: 1px solid var(--rt-segment-line);
    border-radius: 6px;
}

.rt-segment {
    appearance: none;
    background: transparent;
    border: 0;
    border-radius: 4px;
    padding: 0.3rem 0.7rem;
    font: inherit;
    font-size: 0.8125rem;
    line-height: 1.2;
    color: var(--rt-segment-idle);
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 120ms ease, color 120ms ease;
}

.rt-segment:hover:not(:disabled):not(.rt-segment-on) {
    background: var(--rt-segment-hover);
}

.rt-segment:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.rt-segment:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 1px;
}

/* The selected word carries the colour; a tint of the same hue backs it. */
.rt-segment-on {
    color: var(--rt-segment-colour);
    background: color-mix(in srgb, var(--rt-segment-colour) 16%, transparent);
    font-weight: 600;
}

/* The same palette for read-only display in lists. */
.rt-badge {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8125rem;
    line-height: 1.35;
    color: var(--rt-segment-colour);
    background: color-mix(in srgb, var(--rt-segment-colour) 14%, transparent);
    white-space: nowrap;
}

.rt-badge-plain {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    font-size: 0.8125rem;
    line-height: 1.35;
    color: var(--rt-segment-idle);
    white-space: nowrap;
}

/* ---------------------------------------------------------------------------
   The vault key page. Plain elements rather than MudBlazor components, because
   nothing on it may be bound to a Blazor component: this is Blazor Server, and
   a bound value has already been sent to the server.

   Fields holding key material are marked green and carry a padlock, so a box
   whose contents never leave the browser never looks like an ordinary one.
   --------------------------------------------------------------------------- */

.mud-theme-light, :root {
    --rt-secret: #2F6F4E;
    --rt-secret-tint: #EAF3EE;
    --rt-secret-line: #A9C9B6;
}

.mud-theme-dark {
    --rt-secret: #79C79B;
    --rt-secret-tint: rgba(121, 199, 155, 0.10);
    --rt-secret-line: #3C6B52;
}

/* Forms stay narrow; the entry list below them uses the full width. */
.rt-vault section {
    max-width: 34rem;
}

.rt-vault section {
    border: 1px solid var(--rt-segment-line);
    border-radius: 6px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.rt-vault h3 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    font-weight: 600;
}

.rt-vault p {
    margin: 0 0 0.9rem;
    font-size: 0.875rem;
    color: var(--rt-segment-idle);
}

.rt-vault label {
    display: block;
    font-size: 0.8125rem;
    color: var(--rt-segment-idle);
    margin: 0.75rem 0 0.25rem;
}

.rt-vault-row {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.rt-vault-row .rt-secret {
    flex: 1;
}

/* A field whose contents stay in this browser. Green, bordered, padlocked. */
.rt-secret {
    width: 100%;
    box-sizing: border-box;
    padding: 0.5rem 0.6rem 0.5rem 1.9rem;
    font: inherit;
    font-size: 0.875rem;
    color: var(--rt-secret);
    background-color: var(--rt-secret-tint);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%232F6F4E'%3E%3Cpath d='M12 1a5 5 0 0 0-5 5v3H6a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-9a2 2 0 0 0-2-2h-1V6a5 5 0 0 0-5-5zm0 2a3 3 0 0 1 3 3v3H9V6a3 3 0 0 1 3-3z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 0.5rem center;
    background-size: 0.9rem;
    border: 1px solid var(--rt-secret-line);
    border-radius: 4px;
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
}

.rt-secret:focus {
    outline: 2px solid var(--rt-secret);
    outline-offset: -1px;
}

.rt-vault-button {
    appearance: none;
    margin-top: 1rem;
    padding: 0.45rem 0.9rem;
    font: inherit;
    font-size: 0.8125rem;
    border: 1px solid var(--rt-segment-line);
    border-radius: 4px;
    background: transparent;
    color: var(--rt-segment-idle);
    cursor: pointer;
}

.rt-vault-button:hover {
    background: var(--rt-segment-hover);
}

.rt-vault-primary {
    border-color: var(--rt-secret);
    color: var(--rt-secret);
    font-weight: 600;
}

.rt-vault-hint {
    font-size: 0.8125rem;
    margin-top: 0.6rem;
}

.rt-vault-message {
    margin-top: 0.9rem;
    padding: 0.5rem 0.7rem;
    border-radius: 4px;
    font-size: 0.8125rem;
}

.rt-vault-info  { color: var(--rt-segment-idle); background: var(--rt-segment-hover); }
.rt-vault-ok    { color: var(--rt-secret);   background: var(--rt-secret-tint); }
.rt-vault-warn  { color: var(--rt-high);     background: color-mix(in srgb, var(--rt-high) 14%, transparent); }
.rt-vault-error { color: var(--rt-critical); background: color-mix(in srgb, var(--rt-critical) 14%, transparent); }

.rt-vault-badge {
    padding: 0.15rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8125rem;
    font-weight: 600;
}

.rt-vault-open { color: var(--rt-secret);   background: var(--rt-secret-tint); }
.rt-vault-shut { color: var(--rt-segment-idle); background: var(--rt-segment-hover); }

/* Entry list. Names and kinds are not secret and look ordinary; only the value box is green. */
.rt-plain {
    width: 100%;
    box-sizing: border-box;
    padding: 0.5rem 0.6rem;
    font: inherit;
    font-size: 0.875rem;
    color: var(--mud-palette-text-primary, #1B1F24);
    background: transparent;
    border: 1px solid var(--rt-segment-line);
    border-radius: 4px;
}

/* A row per entry: dense enough to scan a long list, with the columns that tell one
   credential from another without opening it. */
.rt-vault-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.rt-vault-table th {
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--rt-segment-idle);
    padding: 0.4rem 0.6rem;
    border-bottom: 1px solid var(--rt-segment-line);
    white-space: nowrap;
}

.rt-vault-table td {
    padding: 0.45rem 0.6rem;
    border-bottom: 1px solid var(--rt-segment-line);
    vertical-align: top;
}

.rt-vault-table tr:hover td {
    background: var(--rt-segment-hover);
}

/* The URL can be long; it gets the slack and everything else stays put. */
.rt-vault-url {
    max-width: 22rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rt-vault-url a {
    color: inherit;
}

.rt-vault-when {
    color: var(--rt-segment-idle);
    white-space: nowrap;
}

.rt-vault-entry-actions {
    display: flex;
    gap: 0.4rem;
    flex-shrink: 0;
}

.rt-vault-entry-actions .rt-vault-button {
    margin-top: 0;
}

/* A revealed value. Green and monospace, so it is obvious what is on screen. */
.rt-vault-value {
    margin-top: 0.6rem;
    padding: 0.5rem 0.7rem;
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-size: 0.875rem;
    color: var(--rt-secret);
    background: var(--rt-secret-tint);
    border: 1px solid var(--rt-secret-line);
    border-radius: 4px;
    word-break: break-all;
    user-select: all;
}

/* ---------------------------------------------------------------------------
   Fonts are the operating system's. MudBlazor asks for Roboto from Google's CDN
   by default, which means every page load of a private operations console tells
   a third party that someone opened it. Nothing here is served from anywhere
   but this machine.

   The stack below is what each platform already renders its own UI in, so it
   costs no request and needs no hosting.
   --------------------------------------------------------------------------- */

:root {
    --rt-font: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI",
               system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
}

body,
.mud-typography,
.mud-input,
.mud-button-root,
.mud-table,
.mud-nav-link {
    font-family: var(--rt-font);
}

/* A multi-line secret: SSH keys and certificates do not fit on one line, and the Kind list
   offers both. The padlock sits at the top rather than centred, since the box is tall. */
.rt-secret-area {
    resize: vertical;
    min-height: 4.5rem;
    line-height: 1.4;
    background-position: 0.5rem 0.6rem;
    padding-top: 0.5rem;
    white-space: pre;
    overflow-wrap: normal;
    overflow-x: auto;
}

/* The revealed value keeps its line breaks, for the same reason. */
.rt-vault-value {
    white-space: pre-wrap;
}

/* Credentials on a project page. Compact, because it sits beside the task list rather than
   being the point of the page. */
.rt-project-credential {
    padding: 0.35rem 0;
    border-bottom: 1px solid var(--rt-segment-line);
}

.rt-project-credential:last-child {
    border-bottom: 0;
}

.rt-credential-name {
    font-size: 0.875rem;
    font-weight: 500;
}

.rt-credential-kind,
.rt-credential-user {
    font-size: 0.8125rem;
    color: var(--rt-segment-idle);
    margin-left: 0.75rem;
}

.rt-attached-vault-form {
    border: 1px solid var(--rt-segment-line);
    border-radius: 6px;
    padding: 0.75rem 1rem 1rem;
    margin-bottom: 0.75rem;
}

/* "Add credential" or "Edit <name>". The heading is the only thing on screen naming what the
   Delete button in this form would destroy, so it is not decoration. */
.rt-attached-vault-form h4 {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
}

.rt-attached-vault-form label {
    display: block;
    font-size: 0.8125rem;
    color: var(--rt-segment-idle);
    margin: 0.6rem 0 0.2rem;
}

/* "Take a photo": a label wrapping a hidden file input, because a styled button cannot open a
   camera but a label pointing at an input can. On a desktop there is no camera to open, so the
   browser falls back to a file picker -- which is why it is hidden below tablet width rather
   than shown as a second way to do the same thing. */
.rt-camera-button {
    padding: 0.35rem 0.8rem;
    font-size: 0.8125rem;
    border: 1px solid var(--rt-segment-line);
    border-radius: 4px;
    color: var(--rt-segment-idle);
    cursor: pointer;
    user-select: none;
}

.rt-camera-button:hover {
    background: var(--rt-segment-hover);
}

.rt-camera-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

@media (min-width: 900px) {
    .rt-camera-button { display: none !important; }
}

/* ---------------------------------------------------------------------------
   The barcode camera. Full screen on purpose: this gets used one-handed, in a
   workshop, pointing at a label on the back of something.
   --------------------------------------------------------------------------- */

.rt-scan-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.rt-scan-frame {
    position: relative;
    width: min(92vw, 30rem);
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 8px;
    background: #000;
}

.rt-scan-frame video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Somewhere to aim. The detector reads the whole frame, so this is guidance
   rather than a boundary -- which is why it is a thin outline and not a mask. */
.rt-scan-reticle {
    position: absolute;
    top: 50%;
    left: 8%;
    width: 84%;
    height: 28%;
    transform: translateY(-50%);
    border: 2px solid rgba(255, 255, 255, 0.85);
    border-radius: 6px;
    box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.25);
}

.rt-scan-hint {
    color: #fff;
    font-size: 0.9375rem;
    margin: 0;
    max-width: 22rem;
    text-align: center;
}

/* Zoom, light and camera switch. Each one is hidden unless the camera reports it, so what is
   on screen is what this particular phone can actually do. */
.rt-scan-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
}

.rt-scan-controls button,
.rt-scan-zoom button {
    appearance: none;
    font: inherit;
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 6px;
    padding: 0.5rem 1rem;
    cursor: pointer;
}

/* Big enough to hit with a thumb while the other hand holds the machine. */
.rt-scan-zoom button {
    min-width: 2.75rem;
    font-size: 1.25rem;
    line-height: 1;
    padding: 0.4rem 0.6rem;
}

.rt-scan-zoom {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #fff;
}

.rt-scan-zoom [data-role="zoom-level"] {
    min-width: 3rem;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.rt-scan-controls button.rt-scan-on {
    background: #ffd54f;
    color: #000;
    border-color: #ffd54f;
}

/* What the camera actually gave, which is how you tell a request that was honoured from one
   that was quietly ignored. */
.rt-scan-size {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.75rem;
    margin: 0;
    font-variant-numeric: tabular-nums;
}

.rt-scan-cancel {
    appearance: none;
    padding: 0.6rem 1.6rem;
    font: inherit;
    font-size: 0.9375rem;
    color: #fff;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 6px;
    cursor: pointer;
}

.rt-scan-cancel:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* A scanned result: what it is and, more to the point, where it lives. */
.rt-scan-result {
    border: 1px solid var(--rt-segment-line);
    border-left: 3px solid var(--rt-low);
    border-radius: 6px;
    padding: 0.9rem 1.1rem;
    margin-bottom: 1rem;
}

.rt-scan-result-location {
    font-size: 1.25rem;
    font-weight: 600;
}

/* ---------------------------------------------------------------------------
   Phone layout.

   The data grids are the problem: a table with six columns is unusable at
   400px, and shrinking it just makes everything unreadable. Below this width
   the grid is replaced by a list of cards showing the few fields that matter
   when you are standing in front of the thing, and the grid's sorting and
   column filters go away with it -- on a phone you search, you do not sort by
   warranty expiry.
   --------------------------------------------------------------------------- */

.rt-cards { display: none; }

@media (max-width: 899px) {
    .rt-grid-only { display: none !important; }
    .rt-cards { display: block; }

    /* Page headings stack rather than squeezing the buttons off the edge. */
    .rt-page-title {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    /* Dialogs are the full screen: a centred box with margins wastes the width
       that forms need most. */
    .mud-dialog {
        margin: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    .rt-vault section,
    .rt-vault {
        max-width: none;
    }
}

.rt-card {
    border: 1px solid var(--rt-segment-line);
    border-radius: 6px;
    padding: 0.75rem 0.9rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
}

.rt-card:active {
    background: var(--rt-segment-hover);
}

.rt-card-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
}

/* A row of small facts under the title. Each is laid out so a missing one
   leaves no gap, which matters when half of them are usually empty. */
.rt-card-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.9rem;
    margin-top: 0.3rem;
    font-size: 0.8125rem;
    color: var(--rt-segment-idle);
}

.rt-card-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.45rem;
}

/* Touch targets. The desktop sizes are fine with a mouse and fiddly with a
   thumb, so anything tappable gets a floor here. */
@media (max-width: 899px) {
    .rt-vault-button,
    .rt-camera-button {
        min-height: 2.5rem;
        padding-inline: 1rem;
    }

    .mud-button-root {
        min-height: 2.5rem;
    }

    .rt-secret,
    .rt-plain {
        font-size: 16px;   /* iOS zooms the page for anything smaller */
    }
}

/* A task number is an identifier people read aloud and type into the search box, so it is
   tabular and legible rather than greyed out like incidental metadata. */
.rt-task-number {
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-variant-numeric: tabular-nums;
    color: var(--rt-segment-idle);
}

/* Attached pictures. A grid that wraps rather than a fixed row: a task may carry one screenshot
   or nine, and on a phone the same markup should end up one or two across without a media query.
   The thumbnail is cropped to a square so a portrait photo from a phone and a wide screenshot
   line up, and the whole image is still one click away. */
.rt-file-previews {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
    gap: 0.75rem;
}

.rt-file-preview {
    margin: 0;
    border: 1px solid var(--mud-palette-lines-default, rgba(0, 0, 0, 0.12));
    border-radius: 6px;
    overflow: hidden;
    background: var(--mud-palette-surface, #fff);
}

.rt-file-preview a {
    display: block;
    line-height: 0;
}

.rt-file-preview img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    background: var(--mud-palette-background-grey, #f5f5f5);
}

.rt-file-preview figcaption {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.15rem 0.15rem 0.5rem;
    font-size: 0.75rem;
}

/* The name is allowed to be cut off. It is a label on a picture that is already visible, so
   wrapping it to three lines would push the next thumbnail down for nothing. */
.rt-file-preview-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--rt-segment-idle);
}

/* A pairing code is read off one screen and typed into another, so it is spaced and monospaced
   with tabular figures. The alphabet already excludes look-alikes; this is about the eye not
   losing its place halfway through. */
.rt-pairing-code {
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.25em;
}

/* A checkbox in the vault form, laid out as a row rather than stacked like the labelled inputs
   above it, because the label reads as a sentence next to the box. */
.rt-vault-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    cursor: pointer;
}

/* A modal, for the vault form and for unlocking. Both used to be panels pinned to the top of the
   vault page, which meant clicking Edit on an entry near the bottom appeared to do nothing: the
   form opened off screen. A modal puts the form where the attention already is. */
.rt-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 4vh 1rem;
    z-index: 1400;           /* above MudBlazor's app bar, below its own dialogs */
    overflow-y: auto;
}

.rt-modal[hidden] {
    display: none;           /* the attribute alone loses to display:flex */
}

.rt-modal-card {
    background: var(--mud-palette-surface, #fff);
    border-radius: 8px;
    padding: 1.5rem;
    width: min(44rem, 100%);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

/* The bar that appears once entries are ticked. Sticky at the bottom so it stays reachable while
   scrolling a long list, which is the only time anyone selects several things. */
.rt-vault-bulk {
    position: sticky;
    bottom: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    margin-top: 1rem;
    background: var(--mud-palette-surface, #fff);
    border: 1px solid var(--mud-palette-lines-default, rgba(0, 0, 0, 0.12));
    border-radius: 6px;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
}

.rt-vault-bulk[hidden] {
    display: none;
}

/* Said when a typed name matches nothing, because silently attaching to nothing looks exactly
   like attaching to something until the credential is missing from a page weeks later. */
.rt-vault-warn {
    color: var(--mud-palette-warning, #b26a00);
}

/* ---------------------------------------------------------------- the domain report */

.rt-domain-report th {
    white-space: nowrap;
}

.rt-domain-name {
    font-weight: 500;
}

.rt-domain-cell a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dotted currentColor;
}

.rt-domain-detail {
    font-size: 0.75rem;
    opacity: 0.7;
}

/* A failure is the one thing on this page that has to be readable at a glance. */
.rt-domain-down {
    color: var(--mud-palette-error);
    opacity: 1;
    font-weight: 500;
}

.rt-domain-ip {
    font-size: 0.7rem;
    opacity: 0.55;
    font-variant-numeric: tabular-nums;
}

.rt-domain-extra td {
    padding-top: 0;
    border-top: none;
}

/* ------------------------------------------------- projects waiting to be accepted */

.rt-pending-projects {
    border-left: 3px solid var(--mud-palette-warning);
}

.rt-pending-row + .rt-pending-row {
    border-top: 1px solid var(--mud-palette-divider);
}

/* What a delete would take with it, read before the button is pressed. */
.rt-delete-list {
    margin: 0;
    padding-left: 1.2rem;
}

.rt-delete-list li {
    margin-bottom: 0.2rem;
}

/* A URL in a definition list must wrap rather than widen the panel. */
.rt-break {
    overflow-wrap: anywhere;
}

/* ------------------------------------------------- what a list is currently hiding */

.rt-active-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
    border: 1px solid var(--mud-palette-lines-default);
    border-left: 3px solid var(--mud-palette-primary);
    border-radius: var(--mud-default-borderradius);
    background: var(--mud-palette-background-gray);
}

.rt-active-filters-label {
    font-size: 0.8rem;
    font-weight: 500;
    opacity: 0.75;
}

.rt-active-filters-count {
    font-size: 0.75rem;
    opacity: 0.6;
    margin-left: auto;
    font-variant-numeric: tabular-nums;
}

/* A worked example in a help panel: small, monospaced, and not styled like an input. */
.rt-standard {
    margin: 0.4rem 0;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    line-height: 1.5;
    white-space: pre-wrap;
    overflow-x: auto;
    border-radius: var(--mud-default-borderradius);
    background: var(--mud-palette-background-gray);
    border: 1px solid var(--mud-palette-lines-default);
}

/* A file chosen but not yet stored. Marked, because a line of text and a button reads as a
   result rather than as a step still to take. */
.rt-pending-upload {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border: 1px dashed var(--mud-palette-warning);
    border-radius: var(--mud-default-borderradius);
    background: var(--mud-palette-background-gray);
}

/* ------------------------------------------------- the bar above every grid */

.rt-grid-chrome {
    margin-bottom: 0.5rem;
}

.rt-grid-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0 0.25rem;
}

.rt-grid-count {
    font-size: 0.75rem;
    opacity: 0.7;
    font-variant-numeric: tabular-nums;
}

/* Only on paper. */
.rt-print-header {
    display: none;
}

/* ---------------------------------------------------------------------------
   Printing a list.
   
   A hard copy of what is on screen: the rows, their columns, and a heading
   saying which list this is and what was filtered out to produce it. Everything
   that cannot be acted on from paper goes — navigation, buttons, search boxes,
   the filter chips themselves, pagination.
   --------------------------------------------------------------------------- */

@media print {
    /* Ink, and legibility on white. MudBlazor's dark theme prints as a black page. */
    :root,
    :root[data-theme="dark"] {
        color-scheme: light;
    }

    body {
        background: #fff !important;
        color: #000 !important;
    }

    .mud-drawer,
    .mud-appbar,
    .mud-overlay,
    .mud-snackbar-provider,
    .mud-popover-provider,
    .rt-grid-actions,
    .rt-active-filters,
    .mud-table-pagination,
    .mud-data-grid .mud-table-toolbar,
    .rt-page-title .mud-button-root,
    button,
    .mud-icon-button {
        display: none !important;
    }

    /* The drawer leaves a margin behind when it is hidden. */
    .mud-main-content,
    .mud-container {
        padding: 0 !important;
        margin: 0 !important;
        max-width: none !important;
    }

    .rt-print-header {
        display: block;
        margin-bottom: 0.75rem;
    }

    .rt-print-header h1 {
        font-size: 15pt;
        margin: 0 0 0.2rem;
    }

    .rt-print-header p {
        font-size: 8.5pt;
        margin: 0;
        color: #444;
    }

    /* The table itself, in print sizes, with headers repeated on every page. */
    .mud-table-container {
        overflow: visible !important;
        max-height: none !important;
    }

    .mud-data-grid table {
        width: 100% !important;
        font-size: 8.5pt;
        border-collapse: collapse;
    }

    .mud-data-grid thead {
        display: table-header-group;
    }

    .mud-data-grid th,
    .mud-data-grid td {
        border: 1px solid #ccc !important;
        padding: 3pt 5pt !important;
        color: #000 !important;
        background: #fff !important;
    }

    /* A row split across a page break is unreadable on both halves. */
    .mud-data-grid tr {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    /* Chips carry colour and a border that read as noise on paper; the text is the content. */
    .mud-chip {
        background: none !important;
        border: none !important;
        color: #000 !important;
        padding: 0 !important;
        height: auto !important;
    }

    a {
        color: #000 !important;
        text-decoration: none !important;
    }

    @page {
        margin: 12mm;
    }
}

/* The master prompt, folded away under the briefing. */
.rt-master-prompt {
    border-top: 1px solid var(--mud-palette-divider);
    padding-top: 0.75rem;
}

/* The collapsed opening: clickable, and looking it. */
.rt-prompt-opening {
    cursor: pointer;
    opacity: 0.85;
}

.rt-prompt-opening:hover {
    opacity: 1;
    text-decoration: underline dotted;
}

/* A revealed credential: everything needed to sign in, in one place. */
.rt-vault-details {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.25rem 0.75rem;
    margin: 0;
    align-items: baseline;
}

.rt-vault-details dt {
    font-size: 0.75rem;
    opacity: 0.6;
    white-space: nowrap;
}

.rt-vault-details dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.rt-vault-details a {
    color: var(--mud-palette-primary);
}

/* The secret itself: monospaced, so l and 1 and O and 0 can be told apart when it has to be
   typed somewhere this cannot reach. */
.rt-secret-shown {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    white-space: pre-wrap;
}

.rt-vault-copyable {
    display: inline-flex;
    align-items: baseline;
    gap: 0.5rem;
}

.rt-vault-copy {
    appearance: none;
    font: inherit;
    font-size: 0.7rem;
    font-family: inherit;
    padding: 0.1rem 0.45rem;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 4px;
    background: transparent;
    color: inherit;
    cursor: pointer;
    opacity: 0.7;
    flex: none;
}

.rt-vault-copy:hover {
    opacity: 1;
    background: var(--mud-palette-action-default-hover);
}

/* ------------------------------------------------------- a vault entry that holds a file */

/* A binary secret -- a signing key, a keystore, a client certificate -- is hex encoded into the
   value. Revealing it shows what it is and offers it back as bytes, rather than printing a
   thousand hex digits nobody can use by eye. */
.rt-vault-file {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem;
}

/* The stored file's own name. Its tooltip carries the SHA-256, for the rare moment someone wants
   to compare it against a file by hand. The code that checks it does not need it on screen, and
   nobody wants to read sixty-four hex digits that are not for them. */
.rt-vault-file-name {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-weight: 600;
    cursor: help;
}

/* The picker, shown only when Kind is File. A file input is wider than its box at any size, so
   it gets the border and the padding but not the fixed width .rt-plain would give it. */
#vault-file-row input[type="file"],
#attached-vault-file-row input[type="file"],
#vault-totp-row input[type="file"],
#attached-vault-totp-row input[type="file"] {
    width: auto;
    max-width: 100%;
    font-size: 0.8125rem;
    padding: 0.4rem 0.5rem;
}

/* Delete, inside a record's own form. Marked as the one button there that cannot be undone. */
.rt-vault-danger {
    border-color: var(--mud-palette-error) !important;
    color: var(--mud-palette-error) !important;
}

.rt-vault-danger:hover {
    background: var(--mud-palette-error) !important;
    color: #fff !important;
}

/* ------------------------------------------------- the vault list: filters and attachments */

.rt-vault-sortable {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.rt-vault-sortable:hover {
    text-decoration: underline dotted;
}

.rt-vault-arrow {
    opacity: 0.7;
    font-size: 0.75rem;
}

.rt-vault-filter-row th {
    padding: 0.2rem 0.3rem;
    font-weight: normal;
}

.rt-vault-filter {
    width: 100%;
    min-width: 5rem;
    box-sizing: border-box;
    font: inherit;
    font-size: 0.75rem;
    padding: 0.15rem 0.3rem;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 3px;
    background: var(--mud-palette-surface);
    color: inherit;
}

.rt-vault-filter::placeholder {
    opacity: 0.5;
}

/* What an entry is filed against: the sort of thing in small caps, then its name. */
.rt-vault-attached-kind {
    display: inline-block;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.55;
    margin-right: 0.35rem;
}

.rt-vault-unattached {
    opacity: 0.4;
}

.rt-vault-shared {
    font-size: 0.7rem;
    padding: 0.05rem 0.4rem;
    border-radius: 3px;
    border: 1px solid var(--mud-palette-lines-default);
    opacity: 0.8;
}

.rt-vault-count {
    font-size: 0.75rem;
    opacity: 0.6;
    margin: 0.4rem 0 0;
    font-variant-numeric: tabular-nums;
}

/* An authenticator code, the seconds it has left, and a button to copy it.

   Deliberately large and spaced in threes. This is read off the screen and typed into another
   site within thirty seconds, often while the site is counting down at you, so it is the one
   value in the vault worth making easy to read across a room. */
.rt-vault-totp {
    display: inline-flex;
    align-items: baseline;
    gap: 0.6rem;
}

.rt-vault-totp-code {
    font-family: var(--rt-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    line-height: 1.2;
}

.rt-vault-totp-clock {
    font-size: 0.75rem;
    opacity: 0.6;
    font-variant-numeric: tabular-nums;
    flex: none;
}

/* The last five seconds. A code copied at this point will often be refused by the far site, and
   the only honest thing to do is say so before it is pasted rather than after. */
.rt-vault-totp-soon {
    color: var(--mud-palette-warning);
    opacity: 1;
    font-weight: 600;
}

/* ----------------------------------------- putting an authenticator account on another device */

/* The QR code and the secret behind it, both kept behind a button. The row above deliberately
   shows a code rather than a secret, because a code is worthless thirty seconds later; these two
   enrol a device permanently, so they are not on screen while someone reads the digits. */
.rt-vault-export-panel {
    margin-top: 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 32rem;
}

/* White, always, and with its own quiet border. The vault is usually read on a dark page, and a
   QR code with the page showing through it is one no phone will read. */
.rt-vault-qr {
    display: block;
    background: #fff;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 4px;
}

.rt-vault-export-line {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem;
}

.rt-vault-export-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.7;
    min-width: 4.5rem;
}

/* Wrapped rather than scrolled: an otpauth address is too long for one line, and a secret that
   has to be read off the screen by hand has to be all there at once. */
.rt-vault-export-text {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.8125rem;
    overflow-wrap: anywhere;
    flex: 1 1 12rem;
}
