@font-face {
    font-family: 'Schibsted Grotesk';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('fonts/schibsted-grotesk-latin-400-normal.woff2') format('woff2');
}

@font-face {
    font-family: 'Schibsted Grotesk';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('fonts/schibsted-grotesk-latin-500-normal.woff2') format('woff2');
}

@font-face {
    font-family: 'Schibsted Grotesk';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('fonts/schibsted-grotesk-latin-600-normal.woff2') format('woff2');
}

/* ==========================================================================
   Tokens
   ========================================================================== */

:root {
    color-scheme: light;

    /* _colors.scss */
    --ds-color-surface-card: #ffffff;
    --ds-color-surface-background: #f0f0f2;
    --ds-color-surface-subtle: #e9e9ed;
    --ds-color-surface-form: #c7c7d1;
    --ds-color-text-primary: #252646;
    --ds-color-text-secondary: #626f86;
    --ds-color-text-on-dark: #f2f2f0;
    --ds-color-action-main-default: #963d97;
    --ds-color-action-main-hover: #7a2d7a;
    --ds-color-action-main-active: #602160;
    --ds-color-action-main-secondary-hover: rgb(150 61 151 / 12%);
    --ds-color-action-sub-default: #535f9f;
    --ds-color-action-sub-hover: #414d84;
    --ds-color-action-sub-active: #313b6b;
    --ds-color-action-sub-secondary-hover: rgb(83 95 159 / 12%);
    --ds-color-status-success-solid: #246637;
    --ds-color-status-success-surface: #cfedda;
    --ds-color-status-warning-solid: #b45e00;
    --ds-color-status-warning-surface: #fde6d2;
    --ds-color-status-critical-solid: #7e1d2d;
    --ds-color-status-critical-surface: #f5d7db;
    --ds-color-status-info-solid: #1a488f;
    --ds-color-status-info-surface: #d0e2fe;
    --ds-color-focus: #717dbc;

    /* Theme roles: link text and logo tint differ from the button colours in dark mode. */
    --theme-link: var(--ds-color-action-main-default);
    --theme-link-hover: var(--ds-color-action-main-hover);
    --theme-logo-filter: none;

    /* _typography.scss */
    --ds-font-family: 'Schibsted Grotesk', 'Segoe UI', roboto, arial, sans-serif;
    --ds-font-family-mono: ui-monospace, 'SF Mono', menlo, consolas, monospace;
    --ds-font-size-headline-xlarge: 1.75rem;
    --ds-line-height-headline-xlarge: 1.14;
    --ds-font-size-headline-large: 1.5rem;
    --ds-line-height-headline-large: 1.16;
    --ds-font-size-headline-medium: 1.25rem;
    --ds-line-height-headline-medium: 1.2;
    --ds-font-size-headline-small: 1rem;
    --ds-line-height-headline-small: 1.25;
    --ds-font-size-body-medium: 0.875rem;
    --ds-line-height-body-medium: 1.428;
    --ds-font-size-body-small: 0.75rem;
    --ds-line-height-body-small: 1.333;
    --ds-font-size-label-default: 0.875rem;
    --ds-line-height-label-default: 1.428;
    --ds-font-weight-normal: 400;
    --ds-font-weight-medium: 500;
    --ds-font-weight-semibold: 600;

    /* _spacing.scss */
    --ds-space-1: 0.25rem;
    --ds-space-1-5: 0.375rem;
    --ds-space-2: 0.5rem;
    --ds-space-3: 0.75rem;
    --ds-space-4: 1rem;
    --ds-space-6: 1.5rem;
    --ds-space-8: 2rem;
    --ds-space-10: 2.5rem;
    --ds-space-12: 3rem;

    /* _radius.scss */
    --ds-radius-md: 0.25rem;
    --ds-radius-lg: 0.5rem;

    /* _shadow.scss */
    --ds-shadow-default: 0 2px 8px 0 rgba(0, 0, 0, 0.16);

    /* _motion.scss */
    --ds-duration-base: 200ms;
    --ds-easing-default: ease-in-out;

    /* _layout.scss */
    --ds-layout-topbar-height: 3.5rem;

    --theme-page-width: 40rem;
}

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;

        --ds-color-surface-card: #161b33;
        --ds-color-surface-background: #0b0e1a;
        --ds-color-surface-subtle: #22294e;
        --ds-color-surface-form: #7e89c5;
        --ds-color-text-primary: #f2f2f0;
        --ds-color-text-secondary: #b2b9dc;
        --ds-color-action-main-secondary-hover: rgb(183 112 190 / 20%);
        --ds-color-action-sub-default: #b2b9dc;
        --ds-color-action-sub-hover: #d4daf0;
        --ds-color-action-sub-active: #eaebf3;
        --ds-color-action-sub-secondary-hover: rgb(178 185 220 / 16%);
        --ds-color-status-success-solid: #cfedda;
        --ds-color-status-success-surface: #173d24;
        --ds-color-status-warning-solid: #fde6d2;
        --ds-color-status-warning-surface: #4a2a06;
        --ds-color-status-critical-solid: #f5d7db;
        --ds-color-status-critical-surface: #4a1520;
        --ds-color-status-info-solid: #d0e2fe;
        --ds-color-status-info-surface: #13305e;
        --ds-shadow-default: 0 2px 8px 0 rgba(0, 0, 0, 0.48);

        --theme-link: #d5b1d5;
        --theme-link-hover: #eed5f0;
        --theme-logo-filter: brightness(0) invert(0.95);
    }
}

/* ==========================================================================
   Base
   ========================================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--ds-color-surface-background);
    color: var(--ds-color-text-primary);
    font-family: var(--ds-font-family);
    font-size: var(--ds-font-size-body-medium);
    line-height: var(--ds-line-height-body-medium);
}

a {
    color: var(--theme-link);
    text-decoration: underline;
    text-underline-offset: 2px;
}

a:hover {
    color: var(--theme-link-hover);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--ds-color-focus);
    outline-offset: 2px;
}

h2 {
    margin: 0 0 var(--ds-space-6);
    font-size: var(--ds-font-size-headline-large);
    line-height: var(--ds-line-height-headline-large);
    font-weight: var(--ds-font-weight-semibold);
}

code {
    font-family: var(--ds-font-family-mono);
}

#jyraphe {
    display: none;
}

/* ==========================================================================
   Page layout
   The selectors hold with and without templates.patch: with it, the page is
   header.site-header > h1, main.site-main, footer.site-footer > #copyright;
   without it, h1, the page blocks and #copyright are direct children of #content.
   ========================================================================== */

#content {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

#content > :not(header, h1, footer, #copyright) {
    width: min(100% - 2 * var(--ds-space-6), var(--theme-page-width));
    margin: 0 auto var(--ds-space-10);
}

#content:has(#admin) {
    --theme-page-width: 60rem;
}

#content > :last-child {
    margin-top: auto;
}

.site-main {
    display: flex;
    flex-direction: column;
    gap: var(--ds-space-6);
}

.site-main > h2 {
    margin-bottom: 0;
}

/* ==========================================================================
   Header
   ========================================================================== */

h1 {
    margin: 0 0 var(--ds-space-10);
    padding: 0 var(--ds-space-6);
    min-height: var(--ds-layout-topbar-height);
    display: flex;
    align-items: center;
    background: var(--ds-color-surface-card);
    border-bottom: 1px solid var(--ds-color-surface-subtle);
    font-size: var(--ds-font-size-headline-small);
    line-height: var(--ds-line-height-headline-small);
    font-weight: var(--ds-font-weight-semibold);
}

h1 a {
    display: flex;
    align-items: center;
    gap: var(--ds-space-4);
    color: var(--ds-color-text-primary);
    text-decoration: none;
}

h1 a:hover {
    color: var(--ds-color-text-primary);
}

/* Inkivari logo, 404 x 64 px source shown at 24 px high. */
h1 a::before {
    content: '';
    flex: none;
    box-sizing: content-box;
    width: 9.5rem;
    height: 1.5rem;
    padding-right: var(--ds-space-4);
    border-right: 1px solid var(--ds-color-surface-form);
    background: url('logo-inkivari.png') no-repeat left center / contain;
    background-origin: content-box;
    background-clip: content-box;
    filter: var(--theme-logo-filter);
}

/* ==========================================================================
   Footer
   ========================================================================== */

#copyright {
    padding: var(--ds-space-4) var(--ds-space-6);
    border-top: 1px solid var(--ds-color-surface-subtle);
    background: var(--ds-color-surface-card);
    color: var(--ds-color-text-secondary);
    font-size: var(--ds-font-size-body-small);
    line-height: var(--ds-line-height-body-small);
    text-align: center;
}

#copyright p {
    margin: 0;
}

#copyright a {
    color: inherit;
}

#copyright a:hover {
    color: var(--ds-color-text-primary);
}

#copyright abbr {
    text-decoration: none;
}

#copyright span {
    margin: 0 var(--ds-space-2);
    color: var(--ds-color-surface-form);
}

/* ==========================================================================
   Cards and forms
   ========================================================================== */

/* :where() keeps the list forgiving (a browser without :has() still styles the
   other cards) and leaves the page layout margins in charge. */
:where(fieldset, #uploading, #upload_finished, :is(#content, .site-main) > div:not([id], [class]):not(:has(form))) {
    min-width: 0;
    margin: 0;
    padding: var(--ds-space-6);
    border: 1px solid var(--ds-color-surface-subtle);
    border-radius: var(--ds-radius-lg);
    background: var(--ds-color-surface-card);
    box-shadow: var(--ds-shadow-default);
}

/* Floated, the legend becomes a regular title inside the card. */
legend {
    float: left;
    width: 100%;
    margin: 0 0 var(--ds-space-4);
    padding: 0;
    font-size: var(--ds-font-size-headline-medium);
    line-height: var(--ds-line-height-headline-medium);
    font-weight: var(--ds-font-weight-semibold);
    overflow-wrap: anywhere;
}

legend + * {
    clear: both;
}

label,
.label {
    font-weight: var(--ds-font-weight-medium);
}

input[type='text'],
input[type='password'],
input:not([type]),
select {
    width: 100%;
    min-height: 2rem;
    padding: calc(var(--ds-space-1-5) - 1px) calc(var(--ds-space-2) - 1px);
    border: 1px solid var(--ds-color-surface-form);
    border-radius: var(--ds-radius-md);
    background: var(--ds-color-surface-card);
    color: var(--ds-color-text-primary);
    font: inherit;
    transition: border-color var(--ds-duration-base) var(--ds-easing-default);
}

input[type='text']:hover,
input[type='password']:hover,
select:hover {
    border-color: var(--ds-color-action-sub-default);
}

input[type='checkbox'] {
    width: 1rem;
    height: 1rem;
    margin: 0;
    accent-color: var(--ds-color-action-main-default);
}

/* Primary button (DS button, primary, main tone). */
input[type='submit'],
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2rem;
    margin: 0;
    padding: calc(var(--ds-space-1-5) - 1px) calc(var(--ds-space-3) - 1px);
    border: 1px solid var(--ds-color-action-main-default);
    border-radius: var(--ds-radius-md);
    background: var(--ds-color-action-main-default);
    color: var(--ds-color-text-on-dark);
    font-family: var(--ds-font-family);
    font-size: var(--ds-font-size-label-default);
    line-height: var(--ds-line-height-label-default);
    font-weight: var(--ds-font-weight-medium);
    cursor: pointer;
    transition:
        background-color var(--ds-duration-base) var(--ds-easing-default),
        border-color var(--ds-duration-base) var(--ds-easing-default),
        color var(--ds-duration-base) var(--ds-easing-default);
}

input[type='submit']:hover,
button:hover {
    border-color: var(--ds-color-action-main-hover);
    background: var(--ds-color-action-main-hover);
}

input[type='submit']:active,
button:active {
    border-color: var(--ds-color-action-main-active);
    background: var(--ds-color-action-main-active);
}

/* Secondary button (DS button, secondary, sub tone). */
#submit_preview,
form.logout input[type='submit'],
#admin input[type='submit'],
#admin + fieldset input[type='submit'],
#upload_finished button,
#password_copy_button {
    border-color: var(--ds-color-action-sub-default);
    background: transparent;
    color: var(--ds-color-action-sub-default);
}

#submit_preview:hover,
form.logout input[type='submit']:hover,
#admin input[type='submit']:hover,
#admin + fieldset input[type='submit']:hover,
#upload_finished button:hover,
#password_copy_button:hover {
    border-color: var(--ds-color-action-sub-hover);
    background: var(--ds-color-action-sub-secondary-hover);
    color: var(--ds-color-action-sub-hover);
}

#submit_preview:active,
form.logout input[type='submit']:active,
#admin input[type='submit']:active,
#admin + fieldset input[type='submit']:active,
#upload_finished button:active,
#password_copy_button:active {
    border-color: var(--ds-color-action-sub-active);
    color: var(--ds-color-action-sub-active);
}

/* Login forms (upload password, admin password, download password) and the
   download and delete confirmation forms: one-column table rendered as a stack. */
form.login table,
form.login tbody,
form.login tr,
form.login td,
form.download table,
form.download tbody,
form.download tr,
form.download td {
    display: block;
    padding: 0;
}

form.login tr + tr,
form.download tr + tr {
    margin-top: var(--ds-space-4);
}

form.login td.field input,
form.login td > input[type='password'] {
    margin-top: var(--ds-space-2);
}

form.login tr:last-child td,
form.download tr:last-child td {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ds-space-2);
    padding-top: var(--ds-space-2);
}

tr.tos td {
    color: var(--ds-color-text-secondary);
    font-size: var(--ds-font-size-body-small);
    line-height: var(--ds-line-height-body-small);
}

/* ==========================================================================
   Alerts (DS alert: danger, info, warning)
   ========================================================================== */

.error,
.message,
#self_destruct {
    padding: var(--ds-space-4) var(--ds-space-6);
    border-radius: var(--ds-radius-md);
    font-size: var(--ds-font-size-label-default);
    line-height: var(--ds-line-height-label-default);
    font-weight: var(--ds-font-weight-medium);
}

.error {
    background: var(--ds-color-status-critical-surface);
    color: var(--ds-color-status-critical-solid);
}

.message {
    background: var(--ds-color-status-info-surface);
    color: var(--ds-color-status-info-solid);
}

.error p,
.message p {
    margin: 0;
}

.error p + p,
.message p + p {
    margin-top: var(--ds-space-2);
}

.error h2 {
    margin-bottom: var(--ds-space-2);
    font-size: var(--ds-font-size-headline-small);
    line-height: var(--ds-line-height-headline-small);
}

.error a,
.message a {
    color: inherit;
}

#self_destruct {
    display: flex;
    gap: var(--ds-space-2);
    align-items: flex-start;
    background: var(--ds-color-status-warning-surface);
    color: var(--ds-color-status-warning-solid);
}

#self_destruct::before,
#upload fieldset > p::before,
#upload_finished button::before,
#password_copy_button::before,
#upload_image_email {
    content: '';
    flex: none;
    display: inline-block;
    width: 1rem;
    height: 1rem;
    background-color: currentColor;
    mask: var(--theme-icon) no-repeat center / contain;
}

#self_destruct::before {
    --theme-icon: url('icons/warning.svg');
    margin-top: 0.125rem;
}

/* ==========================================================================
   Upload form
   ========================================================================== */

/* The file input is the drop zone: the whole dashed area accepts a click or a drop. */
#upload fieldset > p {
    position: relative;
    margin: 0;
}

#upload fieldset > p::before {
    --theme-icon: url('icons/upload.svg');
    position: absolute;
    top: 50%;
    left: var(--ds-space-6);
    width: 2rem;
    height: 2rem;
    margin-top: -1rem;
    color: var(--theme-link);
    pointer-events: none;
}

#file_select {
    display: block;
    width: 100%;
    padding: var(--ds-space-10) var(--ds-space-6) var(--ds-space-10) calc(var(--ds-space-6) + 2rem + var(--ds-space-4));
    border: 1px dashed var(--ds-color-surface-form);
    border-radius: var(--ds-radius-lg);
    background: var(--ds-color-surface-background);
    color: var(--ds-color-text-secondary);
    font: inherit;
    cursor: pointer;
    transition:
        border-color var(--ds-duration-base) var(--ds-easing-default),
        background-color var(--ds-duration-base) var(--ds-easing-default);
}

#file_select:hover {
    border-color: var(--ds-color-action-main-default);
    background: var(--ds-color-action-main-secondary-hover);
}

#upload.file-selected #file_select {
    padding-top: var(--ds-space-4);
    padding-bottom: var(--ds-space-4);
    color: var(--ds-color-text-primary);
}

#file_select::file-selector-button {
    margin-right: var(--ds-space-3);
    min-height: 2rem;
    padding: calc(var(--ds-space-1-5) - 1px) calc(var(--ds-space-3) - 1px);
    border: 1px solid var(--ds-color-action-sub-default);
    border-radius: var(--ds-radius-md);
    background: var(--ds-color-surface-card);
    color: var(--ds-color-action-sub-default);
    font: inherit;
    font-weight: var(--ds-font-weight-medium);
    cursor: pointer;
}

/* Jirafeau prints the send button and the size notes inside the options table;
   the HTML parser moves them before it. The send button is placed back under it. */
#options {
    position: relative;
    margin-top: var(--ds-space-6);
    padding-bottom: calc(2.5rem + var(--ds-space-6));
}

#options > p {
    margin: 0 0 var(--ds-space-2);
    color: var(--ds-color-text-secondary);
}

#options > p:empty {
    display: none;
}

#options > p:has(> #send) {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    margin: 0;
}

#send {
    width: 100%;
    min-height: 2.5rem;
    font-size: var(--ds-font-size-headline-small);
}

#option_table {
    width: 100%;
    border-collapse: collapse;
}

#option_table td {
    padding: var(--ds-space-2) 0;
    vertical-align: middle;
}

#option_table td:first-child {
    width: 40%;
    padding-right: var(--ds-space-4);
    font-weight: var(--ds-font-weight-medium);
}

.passwordcolumn {
    position: relative;
}

.passwordcolumn input {
    padding-right: 2.5rem;
}

/* Scoped to the field: with a generated download password, Jirafeau also gives the
   id show_password to a div of the upload result. */
.passwordcolumn > #show_password {
    position: absolute;
    top: 50%;
    right: var(--ds-space-1);
    width: 2rem;
    min-height: 2rem;
    margin-top: -1rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ds-color-text-secondary);
}

.passwordcolumn > #show_password:hover {
    background: transparent;
    color: var(--ds-color-action-sub-default);
}

/* The strike-through of the eye icon is drawn in #000 by index.php. */
.passwordcolumn > #show_password svg path {
    stroke: currentColor;
}

form.logout {
    margin-top: var(--ds-space-4);
    text-align: right;
}

/* ==========================================================================
   Upload in progress
   Jirafeau only prints a percentage, a speed and a time: the bar below is an
   activity indicator, not a measure.
   ========================================================================== */

#uploading p {
    margin: 0;
    font-weight: var(--ds-font-weight-medium);
}

#uploading p:empty {
    display: none;
}

#uploaded_percentage {
    margin-top: var(--ds-space-2);
    color: var(--theme-link);
    font-size: var(--ds-font-size-headline-xlarge);
    line-height: var(--ds-line-height-headline-xlarge);
    font-weight: var(--ds-font-weight-semibold);
}

#uploaded_speed,
#uploaded_time {
    color: var(--ds-color-text-secondary);
}

#uploading::after {
    content: '';
    display: block;
    height: 0.375rem;
    margin-top: var(--ds-space-4);
    border-radius: var(--ds-radius-md);
    background:
        linear-gradient(90deg, var(--ds-color-action-main-default), var(--ds-color-action-sub-default)) no-repeat,
        var(--ds-color-surface-subtle);
    background-size: 40% 100%, auto;
    animation: theme-indeterminate 1.4s var(--ds-easing-default) infinite alternate;
}

@keyframes theme-indeterminate {
    from {
        background-position: 0 0, 0 0;
    }

    to {
        background-position: 100% 0, 0 0;
    }
}

/* ==========================================================================
   Upload result
   ========================================================================== */

#upload_finished > p:first-child {
    margin: 0 0 var(--ds-space-4);
    padding: var(--ds-space-4) var(--ds-space-6);
    border-radius: var(--ds-radius-md);
    background: var(--ds-color-status-success-surface);
    color: var(--ds-color-status-success-solid);
    font-weight: var(--ds-font-weight-medium);
}

#upload_finished > div {
    padding: var(--ds-space-4) 0;
    border-top: 1px solid var(--ds-color-surface-subtle);
}

#upload_finished > div:last-child {
    padding-bottom: 0;
}

#upload_finished p {
    margin: 0;
}

#upload_finished > div > p:first-child {
    display: flex;
    align-items: center;
    gap: var(--ds-space-2);
    font-weight: var(--ds-font-weight-medium);
}

#upload_finished > div > p + p,
#download_password {
    display: flex;
    align-items: center;
    gap: var(--ds-space-2);
    margin-top: var(--ds-space-2);
}

#download_password p {
    display: flex;
    flex: 1;
    gap: var(--ds-space-2);
}

#upload_finished a {
    text-decoration: none;
}

#upload_finished a:hover {
    text-decoration: underline;
}

#upload_delete a {
    color: var(--ds-color-status-critical-solid);
}

#upload_finished code,
#output_key {
    flex: 1;
    min-width: 0;
    padding: calc(var(--ds-space-1-5) - 1px) calc(var(--ds-space-2) - 1px);
    border: 1px solid var(--ds-color-surface-subtle);
    border-radius: var(--ds-radius-md);
    background: var(--ds-color-surface-background);
    color: var(--ds-color-text-primary);
    font-family: var(--ds-font-family-mono);
    font-size: var(--ds-font-size-body-small);
    line-height: 1.5;
    overflow-wrap: anywhere;
}

#upload_finished code:empty {
    display: none;
}

/* Copy buttons: the clipboard emoji stays the accessible name, the DS icon is shown. */
#upload_finished button,
#password_copy_button {
    flex: none;
    width: 2rem;
    padding: 0;
    font-size: 0;
}

#upload_finished button::before,
#password_copy_button::before {
    --theme-icon: url('icons/copy.svg');
}

#upload_link_email {
    display: inline-flex;
    color: var(--ds-color-action-sub-default);
}

#upload_image_email {
    --theme-icon: url('icons/envelope.svg');
    border: 0;
}

#upload_validity p + p {
    margin-top: var(--ds-space-1);
    font-weight: var(--ds-font-weight-medium);
}

/* ==========================================================================
   Terms of service (tos.php prints the text in a bare div)
   ========================================================================== */

:is(#content, .site-main) > div:not([id], [class]):not(:has(form)) {
    overflow-wrap: anywhere;
}

/* ==========================================================================
   Admin
   ========================================================================== */

h2 + h2 {
    margin-top: calc(-1 * var(--ds-space-4));
    color: var(--ds-color-text-secondary);
    font-size: var(--ds-font-size-body-medium);
    line-height: var(--ds-line-height-body-medium);
    font-weight: var(--ds-font-weight-normal);
}

#admin table,
#admin + fieldset table {
    width: 100%;
    border-collapse: collapse;
}

#admin td,
#admin + fieldset td,
#admin + fieldset th {
    padding: var(--ds-space-3) var(--ds-space-2);
    border-bottom: 1px solid var(--ds-color-surface-subtle);
    text-align: left;
    vertical-align: middle;
}

#admin + fieldset th {
    color: var(--ds-color-text-secondary);
    font-weight: var(--ds-font-weight-medium);
}

#admin + fieldset td {
    vertical-align: top;
}

#admin td:last-child,
#admin + fieldset td:last-child {
    text-align: right;
}

#admin + fieldset td form {
    margin-bottom: var(--ds-space-2);
}

#admin + fieldset {
    margin-top: var(--ds-space-6);
    overflow-x: auto;
}

#admin fieldset > form {
    margin-top: var(--ds-space-4);
    text-align: right;
}

/* ==========================================================================
   Small screens
   ========================================================================== */

@media (max-width: 37.5rem) {
    h1 {
        margin-bottom: var(--ds-space-6);
        padding: var(--ds-space-3) var(--ds-space-4);
    }

    h1 a {
        flex-wrap: wrap;
        gap: var(--ds-space-2);
        font-size: var(--ds-font-size-body-medium);
        line-height: var(--ds-line-height-body-medium);
    }

    h1 a::before {
        flex-basis: 100%;
        padding-right: 0;
        border-right: 0;
    }

    #content > :not(header, h1, footer, #copyright) {
        width: calc(100% - 2 * var(--ds-space-4));
        margin-bottom: var(--ds-space-6);
    }

    :where(fieldset, #uploading, #upload_finished, :is(#content, .site-main) > div:not([id], [class]):not(:has(form))) {
        padding: var(--ds-space-4);
    }

    /* 16 px keeps iOS Safari from zooming into the field on focus. */
    input[type='text'],
    input[type='password'],
    input:not([type]),
    select {
        font-size: 1rem;
    }

    #option_table,
    #option_table tbody,
    #option_table tr,
    #option_table td {
        display: block;
    }

    #option_table tr {
        padding: var(--ds-space-2) 0;
    }

    #option_table td,
    #option_table td:first-child {
        width: auto;
        padding: 0;
    }

    #option_table td + td {
        margin-top: var(--ds-space-2);
    }

    #admin td,
    #admin + fieldset td {
        display: block;
        text-align: left;
    }

    #admin td:last-child,
    #admin + fieldset td:last-child {
        text-align: left;
    }

    #admin + fieldset th {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition: none !important;
    }

    #uploading::after {
        animation: none;
        background-position: 50% 0, 0 0;
    }
}
