@layer courgette {

/* ==========================================================================
   Summary

   1 = Basic Style
   2 = Copyright
   3 = Options
   4 = Upload
   5 = Terms of service
   6 = Install
   7 = Admin
   8 = Download page

   ========================================================================== */

/* ==========================================================================
   1 = Basic Style
   ========================================================================== */

body {
  background: #efebe9;
  font-family: Arial, sans-serif;
  margin: 0;
  line-height: 1.5;
}

#content {
  padding: 2em;
}

h1 a {
  display: block;
  background: url(logo-jirafeau.svg) no-repeat;
  background-size: 100% 100%;
  text-indent: -9999px;
  width: 194px;
  height: 185px;
  margin: 1em auto;
  position: relative;
  left: 0.4em;
}

h2 {
  text-align: center;
  color: #795548;
}

fieldset {
  border: 0;
  padding: 1.5em;
  margin: 0 auto;
  border-radius: 8px;
  width: 20em;
  border: 7px dashed #bcaaa4;
  min-height: 15em;
  min-width: 30em;
  position: relative;
}

legend {
  padding: 0.5em 1em;
  background: #efebe9;
  color: #663D1C;
  font-size: 1.2em;
  display: block;
  min-width: 8em;
  text-align: center;
}

table a {
  color: #000;
}

table a:hover,
table a:focus {
  text-decoration: none;
}

input[type="submit"] {
  background: #0D9CB2;
  border: 0;
  padding: 0.4em 2.2em;
  font-size: 1.1em;
  color: #FFF;
  border-bottom: 5px solid #085B69;
  cursor: pointer;
  margin: 10px;
}

select,
input[type="text"],
input[type="password"] {
  border: 1;
  padding: 5px 5px;
  font-size: 1em;
}

select { width: 100%; }

input[type="submit"]:hover,
input[type="submit"]:focus {
  border: 0;
  position: relative;
  background: #085B69;
  border-bottom: 5px solid #0D9CB2;
  margin-bottom: 10px;
}

.inner {
  margin-top: 3em;
}

#upload fieldset {
  background: url(upload.svg) no-repeat center;
  -webkit-transition: all 0.5s ease;
     -moz-transition: all 0.5s ease;
      -ms-transition: all 0.5s ease;
       -o-transition: all 0.5s ease;
          transition: all 0.5s ease;
}

#upload fieldset:hover {
  border-color: #663D1C;
}

#upload > form {
  text-align: center;
}

#upload p {
  margin: 0;
}

#file_select {
  position: relative;
  width: 100%;
  height: 16em;
  cursor: pointer;
  opacity: 0;
}
  #upload.file-selected #file_select {
    opacity: 1;
    height: 2em;
  }
  #upload.file-selected fieldset {
    background-image: none;
  }


/* ==========================================================================
   2 = Copyright
   ========================================================================== */

#copyright {
  text-align: center;
  font-size: 0.8em;
  color: #795548;
  margin: 3em auto;
}

#copyright a {
  color: #795548;
  text-decoration: none;
}

#copyright a:hover,
#copyright a:focus {
  text-decoration: underline;
}

/* ==========================================================================
   3 = Options
   ========================================================================== */

#options {
  position: relative;
  z-index: 10;
  width: 100%;
  height: 90%;
}

#options tr { height: 2.7em; }

#option_table tr:first-child {
  width: 100%;
  height: 100%;
}

#option_table td:first-child {
}

#options input[type="submit"] {
  position: relative;
  margin: 1em auto;
}

/* ==========================================================================
   4 = Upload
   ========================================================================== */

#upload_finished,
#uploading,
.message,
.info,
.error {
  text-align: center;
  color: #795548;
  padding-left: 3em;
}

#upload_finished > p:nth-child(1) {
  color: #0D9CB2;
  font-weight: bold;
}

#upload_finished div p:nth-child(1) {
  font-weight: bold;
}

#upload_finished a {
  text-decoration: none;
  color: #795548;
}

#uploading a {
  font-weight: bold;
  text-decoration: none;
  color: #795548;
}

#uploaded_percentage {
  font-size: 2em;
  font-weight: bold;
}

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

.message,
.error {
  color: #d55548;
  font-style: italic;
  font-weight: bold;
}

#upload_link_email {
  margin-left: 10px;
}

#upload_image_email {
  padding-left: 20px;
  padding-bottom: 15px;
  background: url(email.png) no-repeat;
}

#show_password {
  flex: 1 1 auto;
  position: absolute;
  right: 0%;
  background: none;
  border: none;
  cursor: pointer;
  opacity: 30%;
}
#show_password:hover {
  opacity: 100%;
}

.passwordcolumn {
  display: flex;
  position: relative;
  align-items: center;
  width: 100%;
}

/* ==========================================================================
   5 = Terms of service
   ========================================================================== */

textarea[readonly="readonly"] {
  border: 0;
  color: #795548;
  font-family: Arial, sans-serif;
  background: none;
  margin: auto;
  display: block;
}

textarea[readonly="readonly"] + p,
textarea[readonly="readonly"] + p + p {
  text-align: center;
  color: #795548;
}

textarea[readonly="readonly"] + p a,
textarea[readonly="readonly"] + p + p a {
  font-weight: bold;
  text-decoration: none;
  color: #795548;
}

textarea[readonly="readonly"] + p a:hover,
textarea[readonly="readonly"] + p + p a:hover,
textarea[readonly="readonly"] + p a:focus,
textarea[readonly="readonly"] + p + p a:focus {
  text-decoration: underline;
}

/* ==========================================================================
   6 = Install
   ========================================================================== */

#install fieldset,
#install + fieldset {
  width: auto;
  max-width: 50em;
  border: 7px dashed #bcaaa4;
}

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

#install td,
#install + fieldset td {
  padding: 0.5em 1em;
  border-bottom: 0;
}

#install td:empty {
  width: 13.1em;
}

#install table form:nth-child(odd),
#install + fieldset tr:nth-child(odd) {
  background: #bcaaa4;
}

#install fieldset > form {
  margin-top: 2em;
  text-align: center;
}

#install form {
  display: table;
  width: 100%;
}

#install td:last-child { text-align: left; }

#install .info { width: 19em; }

#install input[type="submit"] {
  min-width: 10.5em;
}

#install + fieldset table {
  font-size: 0.9em;
}

#install + fieldset td:first-child input[type="submit"] {
  background: none;
  padding: 0;
  color: #000;
  font-weight: bold;
  border-bottom: 0;
}

#install + fieldset td:first-child input[type="submit"]:hover,
#install + fieldset td:first-child input[type="submit"]:focus {
  text-decoration: underline;
}

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

#admin fieldset,
#admin + fieldset {
  width: auto;
  max-width: 60em;
  border: 7px dashed #bcaaa4;
}

#admin table,
#admin + fieldset table {
  width: 100%;
  border-collapse: collapse;
  border-bottom: 2px solid #FFF;
}

#admin td,
#admin + fieldset td {
  padding: 0.5em 1em;
  border: 2px solid #FFF;
  border-bottom: 0;
}

#admin td:empty {
  width: 13.1em;
}

#admin table form:nth-child(odd),
#admin + fieldset tr:nth-child(odd) {
  background: #bcaaa4;
}

#admin fieldset > form {
  margin-top: 2em;
  text-align: center;
}

#admin form {
  display: table;
  width: 100%;
}

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

#admin .info { width: 19em; }

#admin input[type="submit"] {
  min-width: 10.5em;
}

#admin + fieldset table {
  font-size: 0.9em;
}

#admin + fieldset td:first-child input[type="submit"] {
  background: none;
  padding: 0;
  color: #000;
  font-weight: bold;
  border-bottom: 0;
}

#admin + fieldset td:first-child input[type="submit"]:hover,
#admin + fieldset td:first-child input[type="submit"]:focus {
  text-decoration: underline;
}

/* ==========================================================================
   8 = Download page
   ========================================================================== */

#self_destruct {
  font-weight: bold;
  color: red;
  background-image: url('pixel_bomb.png');
  background-size: 40px 40px;
  background-repeat: no-repeat;
  padding-left: 40px;
  padding-top: 10px;
  padding-bottom: 10px;
}
}

:root {
  color-scheme: light dark;
  --fd-bg: #f5f7fb;
  --fd-surface: #ffffff;
  /* Read-only fields: the links shown after an upload, the chosen file. */
  --fd-field: #f8fafc;
  --fd-ink: #172033;
  --fd-muted: #64748b;
  --fd-line: #dce3ef;
  --fd-primary: #2563eb;
  --fd-primary-strong: #1d4ed8;
  --fd-primary-soft: rgb(37 99 235 / 10%);
  /* Text on --fd-primary and on --fd-danger, in both schemes. */
  --fd-on-primary: #ffffff;
  --fd-row: #f1f5f9;
  --fd-accent: #0f766e;
  --fd-danger: #b42318;
  --fd-danger-strong: #912018;
  --fd-danger-soft: #fff6f5;
  --fd-danger-line: rgb(180 35 24 / 28%);
  --fd-zone: rgb(37 99 235 / 5%);
  --fd-zone-line: #9db7ec;
  --fd-shadow: 0 18px 48px rgb(15 23 42 / 12%);
  --fd-radius: 20px;
  /* The logo mark: a drop carrying an upload arrow, on the blue to teal that
     tints the page. The same in both schemes. */
  --fd-brand: linear-gradient(135deg, #3b82f6, #2563eb 45%, #0d9488);
  --fd-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23ffffff' d='M12 2.5s-7 7.2-7 12.1a7 7 0 0 0 14 0C19 9.7 12 2.5 12 2.5z'/%3E%3Cpath fill='none' stroke='%232563eb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M12 18.25v-6.5m0 0-2.75 2.75M12 11.75l2.75 2.75'/%3E%3C/svg%3E");
  /* Icons drawn in --fd-primary, --fd-accent, --fd-danger and
     --fd-on-primary; dark mode redraws them. */
  --fd-icon-upload: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 15V4m0 0L7.5 8.5M12 4l4.5 4.5'/%3E%3Cpath d='M4 14v4a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-4'/%3E%3C/svg%3E");
  --fd-icon-done: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230f766e' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9.25'/%3E%3Cpath d='m8 12.5 2.75 2.75L16.25 9.5'/%3E%3C/svg%3E");
  --fd-icon-mail: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5.5' width='18' height='13' rx='2'/%3E%3Cpath d='m3.5 7 8.5 6 8.5-6'/%3E%3C/svg%3E");
  --fd-icon-copy: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='8.5' y='8.5' width='12' height='12' rx='2'/%3E%3Cpath d='M15.5 8.5v-3a2 2 0 0 0-2-2h-8a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h3'/%3E%3C/svg%3E");
  --fd-icon-warning: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b42318' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3.75 2.75 19.75h18.5z'/%3E%3Cpath d='M12 10v4.25m0 2.75v.01'/%3E%3C/svg%3E");
  --fd-icon-tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E");
  --fd-icon-file: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13.5 3.5H7a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V9z'/%3E%3Cpath d='M13.5 3.5V9H19'/%3E%3Cpath d='M12 11.25v6m0 0-2.5-2.5M12 17.25l2.5-2.5'/%3E%3C/svg%3E");
  --fd-icon-lock: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='10.5' width='14' height='10' rx='2.25'/%3E%3Cpath d='M8.5 10.5V7.75a3.5 3.5 0 0 1 7 0v2.75'/%3E%3Cpath d='M12 14.25v2.75'/%3E%3C/svg%3E");
  --fd-icon-trash: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b42318' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 6.75h15'/%3E%3Cpath d='M9.5 6.75V4.5h5v2.25'/%3E%3Cpath d='m6.5 6.75.85 12.2a1.75 1.75 0 0 0 1.75 1.55h5.8a1.75 1.75 0 0 0 1.75-1.55l.85-12.2'/%3E%3Cpath d='M10 10.75v6M14 10.75v6'/%3E%3C/svg%3E");
  --fd-icon-terms: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13.5 3.5H7a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V9z'/%3E%3Cpath d='M13.5 3.5V9H19'/%3E%3Cpath d='M8.75 13h6.5M8.75 16.5h4.5'/%3E%3C/svg%3E");
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--fd-bg);
}

body {
  min-width: 0;
  /* The background reaches the bottom of the window on a short page. */
  min-height: 100vh;
  margin: 0;
  color: var(--fd-ink);
  background:
    radial-gradient(circle at top left, rgb(37 99 235 / 10%), transparent 34rem),
    radial-gradient(circle at top right, rgb(15 118 110 / 8%), transparent 30rem),
    var(--fd-bg);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  /* The reader's default size, which every rem below follows as well. */
  font-size: 1rem;
  line-height: 1.5;
}

a {
  color: var(--fd-primary);
}

a:hover,
a:focus-visible {
  color: var(--fd-primary-strong);
}

#content {
  /* A column the height of the window, so the footer, upstream's last child
     of #content, can sit at its foot on a short page. */
  display: flex;
  flex-direction: column;
  width: min(100% - 32px, 900px);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 36px 0 28px;
}

h1 {
  margin: 0 0 28px;
  text-align: center;
}

/* The site's name beside its mark. */
h1 a {
  /* courgette: a logo image in a fixed box with the text pushed off-screen. */
  display: inline-flex;
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  background: none;
  text-indent: 0;
  align-items: center;
  gap: 0.42em;
  color: var(--fd-ink);
  font-size: clamp(1.3rem, 6.4vw, 2.1rem);
  font-weight: 750;
  letter-spacing: -0.04em;
  line-height: 1.15;
  text-align: left;
  text-decoration: none;
  text-wrap: balance;
}

h1 a::before {
  flex: none;
  width: 1.6em;
  height: 1.6em;
  border-radius: 0.45em;
  background: var(--fd-mark) no-repeat center / 64%, var(--fd-brand);
  box-shadow:
    0 0.3em 0.8em rgb(37 99 235 / 28%),
    inset 0 1px 0 rgb(255 255 255 / 30%);
  content: "";
  transition:
    box-shadow 150ms ease,
    transform 150ms ease;
}

/* The name runs from ink into the mark's blue and teal, on hover too. A
   browser that cannot clip a background to text keeps it in ink. */
@supports (background-clip: text) or (-webkit-background-clip: text) {
  h1 a,
  h1 a:hover,
  h1 a:focus-visible {
    color: transparent;
    background: linear-gradient(
      100deg,
      var(--fd-ink) 35%,
      var(--fd-primary) 72%,
      var(--fd-accent)
    );
    -webkit-background-clip: text;
    background-clip: text;
  }
}

h1 a:hover::before,
h1 a:focus-visible::before {
  box-shadow:
    0 0.4em 1em rgb(37 99 235 / 36%),
    inset 0 1px 0 rgb(255 255 255 / 30%);
  transform: translateY(-1px) rotate(-4deg);
}

h2 {
  margin: 0 0 12px;
  color: var(--fd-ink);
  font-size: clamp(1.25rem, 3vw, 1.55rem);
  letter-spacing: -0.025em;
  text-align: center;
}

fieldset {
  /* courgette: a fixed 20em-wide, 30em-minimum dashed box. */
  width: auto;
  min-height: 0;
  min-width: 0;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 38px);
  border: 1px solid var(--fd-line);
  border-radius: var(--fd-radius);
  background: var(--fd-surface);
  box-shadow: var(--fd-shadow);
}

legend {
  /* courgette: a tab cut into the box's border. Floated, a legend is laid
     out inside the card like any other heading. */
  float: left;
  width: 100%;
  margin: 0 0 22px;
  padding: 0;
  background: none;
  color: var(--fd-ink);
  font-size: clamp(1.15rem, 2.5vw, 1.35rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
  text-align: center;
}

legend + * {
  clear: both;
}

input,
select,
textarea,
button {
  font: inherit;
}

/* Keyboard focus in the theme's colour; fields draw their own ring below. */
:focus-visible {
  outline: 2px solid var(--fd-primary);
  outline-offset: 2px;
}

input[type="text"],
input[type="password"],
select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--fd-line);
  border-radius: 10px;
  color: var(--fd-ink);
  background: var(--fd-surface);
  outline: none;
}

input[type="text"]:focus,
input[type="password"]:focus,
select:focus {
  border-color: var(--fd-primary);
  box-shadow: 0 0 0 4px rgb(37 99 235 / 14%);
}

table a {
  /* courgette: black links in tables, which vanish in dark mode. */
  color: var(--fd-primary);
}

input[type="submit"] {
  min-height: 46px;
  margin: 0;
  padding: 10px 20px;
  border: 0;
  border-radius: 10px;
  color: var(--fd-on-primary);
  background: var(--fd-primary);
  box-shadow: 0 7px 14px rgb(37 99 235 / 24%);
  cursor: pointer;
  font-size: inherit;
  font-weight: 700;
  transition:
    background-color 150ms ease,
    box-shadow 150ms ease,
    transform 150ms ease;
}

input[type="submit"]:hover,
input[type="submit"]:focus-visible {
  background: var(--fd-primary-strong);
  box-shadow: 0 10px 18px rgb(37 99 235 / 30%);
  transform: translateY(-1px);
}

input[type="submit"]:active {
  transform: translateY(0);
}

/* ---- upload ---- */

#upload {
  width: min(100%, 640px);
  margin: 0 auto;
}

#upload fieldset {
  /* courgette: the upload.svg background and the brown hover border. */
  border-color: var(--fd-line);
  background: var(--fd-surface);
}

#upload p {
  margin: 0;
}

/* The file input is the drop zone: a file dropped anywhere on it is chosen. */
#file_select {
  display: block;
  width: 100%;
  /* courgette: an invisible 16em input laid over the upload.svg picture. */
  height: auto;
  opacity: 1;
  min-height: 220px;
  padding: 108px 16px 28px;
  border: 2px dashed var(--fd-zone-line);
  border-radius: 14px;
  color: var(--fd-ink);
  background: var(--fd-icon-upload) no-repeat center 40px / 48px 48px,
    var(--fd-zone);
  cursor: pointer;
  /* Hides "No file chosen"; the heading above says what to do. */
  font-size: 0;
  text-align: center;
  transition:
    border-color 150ms ease,
    background-color 150ms ease;
}

#file_select:hover,
#file_select:focus-visible {
  border-color: var(--fd-primary);
  background-color: var(--fd-primary-soft);
}

#file_select:focus-visible {
  outline: 3px solid var(--fd-primary-soft);
  outline-offset: 2px;
}

#file_select::file-selector-button {
  display: block;
  margin: 0 auto;
  padding: 12px 22px;
  border: 0;
  border-radius: 10px;
  color: var(--fd-on-primary);
  background: var(--fd-primary);
  box-shadow: 0 7px 14px rgb(37 99 235 / 24%);
  cursor: pointer;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
}

#file_select:hover::file-selector-button,
#file_select:focus-visible::file-selector-button {
  background: var(--fd-primary-strong);
  box-shadow: 0 10px 18px rgb(37 99 235 / 30%);
}

/* A file is chosen: the zone becomes a row naming it, and choosing another
   file becomes the secondary action next to Send. */
#upload.file-selected #file_select {
  min-height: 0;
  padding: 7px;
  border: 1px solid var(--fd-line);
  background: var(--fd-field);
  font-size: 0.95rem;
  overflow-wrap: anywhere;
  text-align: left;
}

#upload.file-selected #file_select::file-selector-button {
  display: inline-block;
  margin: 0 12px 0 0;
  padding: 8px 14px;
  color: var(--fd-primary);
  background: var(--fd-primary-soft);
  box-shadow: none;
  font-size: 0.95rem;
}

#upload.file-selected #file_select:hover::file-selector-button,
#upload.file-selected #file_select:focus-visible::file-selector-button {
  color: var(--fd-on-primary);
  background: var(--fd-primary);
}

#options {
  margin-top: 20px;
}

/* Upstream writes the size note and Send inside the options table, which is
   invalid, so the browser moves them in front of it. A column puts them back
   after the options. Upstream shows #options with an inline display: block in
   the same step that adds file-selected, and undoes neither: hence
   !important, and only once a file is chosen. */
#upload.file-selected #options {
  display: flex !important;
  flex-direction: column;
}

#option_table,
#option_table tr,
#option_table td {
  display: block;
  width: 100%;
}

#option_table {
  order: 1;
  /* courgette: a centred upload form. */
  text-align: left;
}

/* courgette: fixed 2.7em rows, which overlap once the table stacks. */
#options tr {
  height: auto;
}

#option_table td {
  padding: 0;
}

#option_table td:first-child {
  padding-bottom: 6px;
  color: var(--fd-muted);
  font-size: 0.9rem;
  font-weight: 650;
}

/* The options in the order they are decided. How long the file stays comes
   first: the time limit, with the one-time download that can end it sooner
   right below it. The password is optional, so it comes last and quieter,
   below a divider and tagged as optional. Upstream writes the one-time
   download first and the password between the two. */
#option_table tbody {
  display: flex;
  flex-direction: column;
}

#option_table tr:has(#select_time) {
  order: 1;
}

#option_table tr:has(#one_time_download) {
  order: 2;
  margin-top: 4px;
}

#option_table tr:has(#input_key) {
  order: 3;
  margin-top: 16px;
  padding-top: 18px;
  border-top: 1px solid var(--fd-line);
}

#option_table input[type="checkbox"] {
  display: block;
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--fd-primary);
}

/* Upstream's one-time text is not a label, so only the small box would
   toggle. The checkbox is laid unseen over the whole line instead, and its
   box is drawn in front of the text. */
#option_table tr:has(#one_time_download) {
  position: relative;
}

#option_table tr:has(#one_time_download) #one_time_download {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

#option_table tr:has(#one_time_download) td:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0;
  color: var(--fd-ink);
  font-size: 0.95rem;
  font-weight: 500;
}

#option_table tr:has(#one_time_download) td:first-child::before {
  flex: none;
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--fd-muted);
  border-radius: 6px;
  background: var(--fd-surface) no-repeat center / 14px 14px;
  content: "";
  transition:
    border-color 150ms ease,
    background-color 150ms ease;
}

#option_table tr:has(#one_time_download:hover) td:first-child::before {
  border-color: var(--fd-primary);
}

#option_table tr:has(#one_time_download:checked) td:first-child::before {
  border-color: var(--fd-primary);
  background-color: var(--fd-primary);
  background-image: var(--fd-icon-tick);
}

#option_table tr:has(#one_time_download:focus-visible) td:first-child::before {
  outline: 2px solid var(--fd-primary);
  outline-offset: 2px;
}

/* The password: its label beside a slimmer field, or above it where both do
   not fit on one line. */
#option_table tr:has(#input_key) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

#option_table tr:has(#input_key) td:first-child {
  flex: none;
  width: auto;
  padding: 0;
  font-weight: 500;
}

#option_table td.passwordcolumn {
  display: flex;
  flex: 1 1 14rem;
  align-items: center;
  min-width: 0;
}

/* Unless the configuration requires a password. */
#option_table tr:has(#input_key:optional) label[for="input_key"]::after {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  color: var(--fd-muted);
  background: var(--fd-row);
  content: "optional";
  font-size: 0.75rem;
  font-weight: 600;
  vertical-align: 1px;
}

#show_password {
  right: 8px;
  padding: 6px;
}

#input_key {
  min-height: 40px;
  padding: 7px 44px 7px 12px;
}

#options > .config {
  order: 2;
  margin: 18px 0 0;
  color: var(--fd-muted);
  font-size: 0.875rem;
  text-align: center;
}

#max_file_size:empty {
  display: none;
}

#options > p:has(#send) {
  order: 3;
  margin-top: 12px;
}

#options #send {
  display: block;
  width: 100%;
  margin: 0;
}

.form.logout {
  margin: 14px 0 0;
  text-align: center;
}

.form.logout input[type="submit"] {
  min-height: auto;
  padding: 7px 12px;
  color: var(--fd-muted);
  background: transparent;
  box-shadow: none;
  font-size: 0.9rem;
  text-decoration: underline;
}

/* ---- the password forms and the download page ---- */

.form.login,
.form.download {
  width: min(100%, 480px);
  margin: 0 auto;
}

.form.download {
  width: min(100%, 560px);
}

:is(.form.login, .form.download) :is(table, tbody, tr, td) {
  display: block;
  width: 100%;
  padding: 0;
}

/* The download and delete pages quote the file name, which can be one long
   word. */
:is(.form.login, .form.download) td {
  overflow-wrap: anywhere;
}

:is(.form.login, .form.download) tr + tr {
  margin-top: 16px;
}

.form.login tr:has(> td.label) + tr {
  margin-top: 0;
}

.form.login td.label {
  color: var(--fd-muted);
  font-size: 0.9rem;
  font-weight: 650;
}

.form.login td > input[type="password"] {
  margin-top: 8px;
}

:is(.form.login, .form.download) td:has(> input[type="submit"]) {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

:is(.form.login, .form.download) input[type="submit"] {
  flex: 1 1 0;
}

#submit_preview {
  color: var(--fd-primary);
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--fd-primary);
}

#submit_preview:hover,
#submit_preview:focus-visible {
  background: var(--fd-primary-soft);
  box-shadow: inset 0 0 0 1.5px var(--fd-primary);
}

/* Deleting a file cannot be undone. */
#submit_delete {
  background: var(--fd-danger);
  box-shadow: 0 7px 14px rgb(180 35 24 / 22%);
}

#submit_delete:hover,
#submit_delete:focus-visible {
  background: var(--fd-danger-strong);
  box-shadow: 0 10px 18px rgb(180 35 24 / 28%);
}

tr.tos td {
  color: var(--fd-muted);
  font-size: 0.9rem;
}

/* ---- the download page, its password, and the delete confirmation ---- */

/* A tile above the title says what the page is for: the file to download,
   the password guarding it, or the deletion to confirm. */
:is(#submit_post, #submit_delete_post) legend::before {
  display: block;
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 16px;
  background: var(--fd-primary-soft) var(--fd-icon-file) no-repeat center /
    28px 28px;
  content: "";
}

#submit_post.login legend::before {
  background-image: var(--fd-icon-lock);
}

#submit_delete_post legend::before {
  background-color: var(--fd-danger-soft);
  background-image: var(--fd-icon-trash);
  box-shadow: inset 0 0 0 1px var(--fd-danger-line);
}

/* Centred under the title, the self-destruct warning before the buttons and
   the terms after them as fine print. Upstream writes the terms first. */
:is(#submit_post, #submit_delete_post) tbody {
  display: flex;
  flex-direction: column;
}

:is(#submit_post, #submit_delete_post) td {
  color: var(--fd-muted);
  text-align: center;
}

:is(#submit_post, #submit_delete_post) tr:has(#self_destruct) {
  order: 1;
}

:is(#submit_post, #submit_delete_post) tr:has(> td > input[type="submit"]) {
  order: 2;
  margin-top: 22px;
}

:is(#submit_post, #submit_delete_post) tr.tos {
  order: 3;
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid var(--fd-line);
}

:is(#submit_post, #submit_delete_post) tr.tos td {
  font-size: 0.8125rem;
}

:is(#submit_post, #submit_delete_post) #self_destruct {
  color: var(--fd-danger);
  text-align: left;
}

#self_destruct {
  padding: 12px 14px 12px 48px;
  border: 1px solid var(--fd-danger-line);
  border-radius: 12px;
  color: var(--fd-danger);
  background-color: var(--fd-danger-soft);
  /* courgette: a 40px pixel-art bomb. */
  background-image: var(--fd-icon-warning);
  background-repeat: no-repeat;
  background-position: 14px center;
  background-size: 22px 22px;
}

/* ---- cards: progress, the links after an upload, messages ---- */

#upload_finished,
#uploading,
.message,
.info,
.error {
  width: min(100%, 700px);
  color: var(--fd-ink);
  margin: 0 auto;
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid var(--fd-line);
  border-radius: var(--fd-radius);
  background: var(--fd-surface);
  box-shadow: var(--fd-shadow);
}

#upload_finished {
  width: min(100%, 640px);
  /* courgette: centred text. */
  text-align: left;
}

#upload_finished > p:first-child {
  margin: 0 0 6px;
  color: var(--fd-accent);
  font-size: 1.25rem;
  font-weight: 750;
  text-align: center;
}

#upload_finished > p:first-child::before {
  display: block;
  width: 52px;
  height: 52px;
  margin: 0 auto 10px;
  background: var(--fd-icon-done) no-repeat center / contain;
  content: "";
}

#upload_finished > div {
  margin-top: 18px;
}

#upload_finished > div p {
  margin: 0;
}

#upload_finished > div > p:first-child {
  margin-bottom: 6px;
  color: var(--fd-muted);
  font-size: 0.9rem;
  font-weight: 650;
}

#upload_finished > div > p + p {
  display: flex;
  gap: 8px;
}

#upload_finished a {
  /* courgette: brown, undecorated links. */
  color: var(--fd-primary);
  font-weight: 650;
  text-decoration: none;
}

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

/* Anyone holding the delete link can remove the file. */
#upload_delete a {
  color: var(--fd-danger);
}

#upload_image_email {
  /* courgette: a brown envelope, which vanishes in dark mode. */
  padding: 18px 0 0 18px;
  background: var(--fd-icon-mail) no-repeat center / 18px 18px;
  vertical-align: -3px;
}

#upload_finished code {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--fd-line);
  border-radius: 10px;
  color: var(--fd-ink);
  background: var(--fd-field);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

/* The clipboard emoji stays each button's name; an icon replaces its look. */
#upload_finished button {
  flex: none;
  width: 44px;
  border: 1px solid var(--fd-line);
  border-radius: 10px;
  background: var(--fd-surface) var(--fd-icon-copy) no-repeat center / 18px;
  cursor: pointer;
  font-size: 0;
  transition:
    border-color 150ms ease,
    background-color 150ms ease,
    transform 150ms ease;
}

#upload_finished button:hover,
#upload_finished button:focus-visible {
  border-color: var(--fd-primary);
  background-color: var(--fd-primary-soft);
}

#upload_finished button:active {
  transform: scale(0.94);
}

#uploading {
  text-align: center;
}

#uploading a {
  /* courgette: brown, undecorated links. */
  color: var(--fd-primary);
  text-decoration: underline;
}

#uploaded_percentage {
  margin: 10px 0 2px;
  color: var(--fd-primary);
  font-size: clamp(2rem, 7vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -0.06em;
}

#uploaded_speed,
#uploaded_time {
  color: var(--fd-muted);
}

.message,
.info {
  color: var(--fd-ink);
  text-align: center;
}

.message,
.error {
  /* courgette: bold italics. */
  font-style: normal;
  overflow-wrap: anywhere;
}

.error {
  border-color: var(--fd-danger-line);
  color: var(--fd-danger);
  background: var(--fd-danger-soft);
  font-weight: 600;
  text-align: center;
}

.error h2 {
  margin-bottom: 4px;
  color: inherit;
  font-size: 1.15rem;
}

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

.message p + p,
.error p + p {
  margin-top: 8px;
}

#error_pop {
  margin-bottom: 18px;
}

/* ---- the terms of service ---- */

/* Upstream prints the terms as plain text in a <div> with neither id nor
   class, its lines broken by <br>; the download page's bare <div> holds a
   form instead. A card at a readable width, a tile like the download page's
   at its top, and the first line, "TERMS OF SERVICE", as its title. */
#content > div:not([id], [class]):has(> br) {
  --fd-terms-pad: clamp(20px, 5vw, 48px);
  position: relative;
  width: min(100%, 700px);
  margin: 0 auto;
  padding: calc(var(--fd-terms-pad) + 74px) var(--fd-terms-pad)
    var(--fd-terms-pad);
  border: 1px solid var(--fd-line);
  border-radius: var(--fd-radius);
  background: var(--fd-surface);
  box-shadow: var(--fd-shadow);
  font-size: 0.9375rem;
  line-height: 1.7;
  overflow-wrap: break-word;
  text-wrap: pretty;
}

#content > div:not([id], [class]):has(> br)::before {
  position: absolute;
  top: var(--fd-terms-pad);
  left: var(--fd-terms-pad);
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--fd-primary-soft) var(--fd-icon-terms) no-repeat center /
    28px 28px;
  content: "";
}

/* Small enough on a phone to stay one line, which ::first-line styles. */
#content > div:not([id], [class]):has(> br)::first-line {
  font-size: min(1.35rem, 6.4vw);
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* ---- footer ---- */

/* Below everything else, and at the foot of the window when the page is
   shorter than it. */
#copyright {
  /* Wide enough for the Dutch and English footer on one line. */
  width: min(100%, 760px);
  margin: auto auto 0;
  padding-top: 40px;
  color: var(--fd-muted);
  font-size: 0.8125rem;
  line-height: 1.7;
  text-align: center;
}

#copyright p {
  margin: 0;
  padding-top: 18px;
  border-top: 1px solid var(--fd-line);
  text-wrap: balance;
}

/* Upstream separates the parts with a "|"; a small dot is quieter. */
#copyright p > span {
  display: inline-block;
  width: 3px;
  height: 3px;
  margin: 0 0.7em;
  border-radius: 50%;
  background: currentColor;
  font-size: 0;
  vertical-align: middle;
  opacity: 0.7;
}

#copyright a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  text-underline-offset: 3px;
  white-space: nowrap;
}

#copyright a:hover,
#copyright a:focus-visible {
  color: var(--fd-primary);
  text-decoration-color: currentColor;
}

/* courgette leaves the licence's dotted abbreviation underline under the
   link's. */
#copyright abbr {
  text-decoration: none;
}

/* ---- admin: courgette's layout, in this palette ---- */

#admin fieldset,
#admin + fieldset {
  border: 1px solid var(--fd-line);
}

/* The file list is an item of #content's column, which would shrink it to
   its content between its auto margins. */
#admin + fieldset {
  width: 100%;
}

#admin table,
#admin + fieldset table {
  border-bottom-color: var(--fd-surface);
}

#admin td,
#admin + fieldset td {
  border-color: var(--fd-surface);
}

#admin table form:nth-child(odd),
#admin + fieldset tr:nth-child(odd) {
  background: var(--fd-row);
}

/* Admin labels are td.info, which the message-card rule above would turn into
   a floating card inside every row. revert-layer keeps courgette's value. */
#admin td.info {
  width: revert-layer;
  border-width: revert-layer;
  border-style: revert-layer;
  margin: 0;
  padding: 0.5em 1em;
  border-radius: 0;
  background: none;
  box-shadow: none;
  text-align: left;
}

#admin + fieldset td:first-child input[type="submit"] {
  min-height: auto;
  color: var(--fd-ink);
  background: none;
  box-shadow: none;
}

@media (min-width: 720px) {
  #content {
    padding-top: 58px;
  }
}

@media (max-width: 560px) {
  #content {
    width: min(100% - 22px, 900px);
    padding-top: 22px;
  }

  h1 {
    margin-bottom: 20px;
  }

  #file_select {
    min-height: 190px;
    padding-top: 92px;
    background-position:
      center 30px,
      0 0;
  }

  /* One part of the footer to a line, rather than lines broken mid-phrase. */
  #copyright p > span {
    display: block;
    width: auto;
    height: 0;
    margin: 0;
    background: none;
  }

  /* courgette: 10.5em-wide admin buttons, wider than a phone's table. */
  #admin td,
  #admin + fieldset td,
  #admin td.info {
    padding: 0.4em 0.3em;
  }

  #admin input[type="submit"] {
    min-width: 0;
    padding: 10px 12px;
  }

  /* courgette: three columns, which squeeze the search fields to a sliver on
     a phone. Each action becomes a line, its label beside its button; a
     search puts its label above the field and the button. */
  #admin table,
  #admin tbody {
    display: block;
  }

  #admin tr {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
  }

  #admin td.info {
    flex: 1 1 0;
  }

  #admin td:empty {
    display: none;
  }

  #admin tr:has(> td > input[type="text"]) td.info {
    flex-basis: 100%;
  }

  #admin td:has(> input[type="text"]) {
    flex: 1 1 0;
  }

  /* Buttons line up in a column wide enough for "Information"; a longer
     translation widens only its own button. */
  #admin td:has(> input[type="submit"]) {
    flex: none;
    min-width: 9em;
  }

  #admin td > input[type="submit"] {
    width: 100%;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --fd-bg: #101827;
    --fd-surface: #172033;
    --fd-field: #111a2b;
    --fd-ink: #edf3ff;
    --fd-muted: #a8b6cc;
    --fd-line: #2c3a54;
    --fd-primary: #76a5ff;
    --fd-primary-strong: #a8c4ff;
    --fd-primary-soft: rgb(118 165 255 / 14%);
    /* White on these light blues is about 2.4:1; near-black is above 7:1. */
    --fd-on-primary: #0b1426;
    --fd-row: #1d2940;
    --fd-accent: #58d5ba;
    --fd-danger: #ff9c92;
    --fd-danger-strong: #ffc2bb;
    --fd-danger-soft: #2b171a;
    --fd-danger-line: rgb(255 156 146 / 30%);
    --fd-zone: rgb(118 165 255 / 7%);
    --fd-zone-line: #4a6595;
    --fd-shadow: 0 18px 48px rgb(0 0 0 / 24%);
    --fd-icon-upload: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2376a5ff' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 15V4m0 0L7.5 8.5M12 4l4.5 4.5'/%3E%3Cpath d='M4 14v4a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-4'/%3E%3C/svg%3E");
    --fd-icon-done: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2358d5ba' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9.25'/%3E%3Cpath d='m8 12.5 2.75 2.75L16.25 9.5'/%3E%3C/svg%3E");
    --fd-icon-mail: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2376a5ff' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5.5' width='18' height='13' rx='2'/%3E%3Cpath d='m3.5 7 8.5 6 8.5-6'/%3E%3C/svg%3E");
    --fd-icon-copy: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2376a5ff' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='8.5' y='8.5' width='12' height='12' rx='2'/%3E%3Cpath d='M15.5 8.5v-3a2 2 0 0 0-2-2h-8a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h3'/%3E%3C/svg%3E");
    --fd-icon-warning: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff9c92' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3.75 2.75 19.75h18.5z'/%3E%3Cpath d='M12 10v4.25m0 2.75v.01'/%3E%3C/svg%3E");
    --fd-icon-tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230b1426' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E");
    --fd-icon-file: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2376a5ff' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13.5 3.5H7a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V9z'/%3E%3Cpath d='M13.5 3.5V9H19'/%3E%3Cpath d='M12 11.25v6m0 0-2.5-2.5M12 17.25l2.5-2.5'/%3E%3C/svg%3E");
    --fd-icon-lock: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2376a5ff' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='10.5' width='14' height='10' rx='2.25'/%3E%3Cpath d='M8.5 10.5V7.75a3.5 3.5 0 0 1 7 0v2.75'/%3E%3Cpath d='M12 14.25v2.75'/%3E%3C/svg%3E");
    --fd-icon-trash: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff9c92' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 6.75h15'/%3E%3Cpath d='M9.5 6.75V4.5h5v2.25'/%3E%3Cpath d='m6.5 6.75.85 12.2a1.75 1.75 0 0 0 1.75 1.55h5.8a1.75 1.75 0 0 0 1.75-1.55l.85-12.2'/%3E%3Cpath d='M10 10.75v6M14 10.75v6'/%3E%3C/svg%3E");
    --fd-icon-terms: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2376a5ff' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13.5 3.5H7a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V9z'/%3E%3Cpath d='M13.5 3.5V9H19'/%3E%3Cpath d='M8.75 13h6.5M8.75 16.5h4.5'/%3E%3C/svg%3E");
  }

  body {
    background:
      radial-gradient(circle at top left, rgb(118 165 255 / 16%), transparent 34rem),
      radial-gradient(circle at top right, rgb(88 213 186 / 10%), transparent 30rem),
      var(--fd-bg);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
