/* Sealnest base styles. Themes override the variables below (SPEC §3.8). */
:root {
  --color-bg: #f6f5f4;
  --color-surface: #f3f3f3;
  --color-text: #1d2433;
  --color-muted: #5b6475;
  --color-border: #d9dde5;
  --color-primary: #46899b;
  --color-primary-text: #ffffff;
  --color-danger: #b42318;
  --color-notice-bg: #e7f6ec;
  --color-notice-text: #11592c;
  --color-error-bg: #fdecea;
  --color-error-text: #8c1d13;
  --radius: 8px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

/* Dark palette: the browser's preference, unless the user chose one
   (data-scheme on <html>). :where() keeps the weight of :root, so a theme
   loaded after this file overrides it. */
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-scheme="light"])) {
    --color-bg: #12151c;
    --color-surface: #1b2029;
    --color-text: #e6e9ef;
    --color-muted: #9aa3b2;
    --color-border: #313846;
    --color-primary: #46899b;
    --color-primary-text: #0b1020;
    --color-danger: #ff7a6e;
    --color-notice-bg: #143222;
    --color-notice-text: #9ee2b5;
    --color-error-bg: #3a1714;
    --color-error-text: #ffb4ab;
    color-scheme: dark;
  }
}
:root:where([data-scheme="dark"]) {
  --color-bg: #12151c;
  --color-surface: #1b2029;
  --color-text: #e6e9ef;
  --color-muted: #9aa3b2;
  --color-border: #313846;
  --color-primary: #46899b;
  --color-primary-text: #0b1020;
  --color-danger: #ff7a6e;
  --color-notice-bg: #143222;
  --color-notice-text: #9ee2b5;
  --color-error-bg: #3a1714;
  --color-error-text: #ffb4ab;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  color: var(--color-text);
  font: 16px/1.5 var(--font);
}
a {
  color: var(--color-primary);
}
h1 {
  font-size: 1.5rem;
  margin: 0 0 1rem;
}
h2 {
  font-size: 1.15rem;
  margin: 1.5rem 0 0.75rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}
.brand {
  font-weight: 700;
  text-decoration: none;
  color: var(--color-text);
}
.nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.main {
  flex: 1;
  width: 100%;
  max-width: 64rem;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}
.footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  font-size: 0.875rem;
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
  overflow-x: auto;
}
.card.narrow {
  max-width: 32rem;
  margin-left: auto;
  margin-right: auto;
}
/* Send pages (files, text, drop links): a little wider than short forms. */
.card.send {
  max-width: 40rem;
  margin-left: auto;
  margin-right: auto;
}
/* Settings and other long forms: wider, still centred. */
.card.settings {
  max-width: 48rem;
  margin-left: auto;
  margin-right: auto;
}
@media (max-width: 40rem) {
  .card {
    padding: 1rem;
  }
}
.heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.heading h1,
.heading h2 {
  margin: 0;
}
/* A card's first title sits at the top of the card. */
.card > h2:first-child {
  margin-top: 0;
}
.card > .heading + * {
  margin-top: 1.25rem;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
/* In a card laid out as a column, the gap alone spaces the blocks. */
.card.stack > h2 {
  margin-bottom: 0;
}
.card.stack > p,
.card.stack > ul {
  margin: 0;
}
label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-weight: 500;
}
label.check {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  font-weight: 400;
}
/* A box that cannot be ticked now (download limit, no email): its text
   greyed with it. */
label.check:has(input:disabled) {
  color: var(--color-muted);
}
fieldset {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
input,
select,
textarea {
  font: inherit;
  color: inherit;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: calc(var(--radius) / 2);
  padding: 0.5rem 0.6rem;
}
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
input:disabled {
  opacity: 0.7;
}

button,
.button {
  font: inherit;
  display: inline-block;
  cursor: pointer;
  text-decoration: none;
  border-radius: calc(var(--radius) / 2);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  padding: 0.5rem 1rem;
}
button.primary,
.button.primary {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-primary-text);
}
button.danger {
  color: var(--color-danger);
  border-color: var(--color-danger);
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
/* Account deletion: the box that unlocks the button, under it. */
.user-delete {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}
button.link {
  border: 0;
  background: none;
  padding: 0;
  color: var(--color-primary);
  text-decoration: underline;
}
form.inline {
  display: inline;
}

.notice,
.error,
.message {
  padding: 0.75rem 1rem;
  border-radius: calc(var(--radius) / 2);
}
.notice {
  background: var(--color-notice-bg);
  color: var(--color-notice-text);
}
.error {
  background: var(--color-error-bg);
  color: var(--color-error-text);
}
/* Warning: something to do now, not a failure. Derived from the theme
   colours so it suits both light and dark palettes. */
.warning {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  border-radius: calc(var(--radius) / 2);
  border-left: 4px solid #e8890c;
  background: color-mix(in srgb, #f59e0b 16%, var(--color-surface));
  color: var(--color-text);
}
.warning .icon {
  flex: none;
  margin-top: 0.1rem;
  color: #e8890c;
}
.message {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  white-space: pre-line;
}
.hint,
.muted {
  color: var(--color-muted);
  font-size: 0.9rem;
  margin: 0;
}
ul.hint.list {
  padding-left: 1.25rem;
}
ul.hint.list li + li {
  margin-top: 0.25rem;
}
.badge {
  font-size: 0.8rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
}
.badge.warn {
  color: var(--color-danger);
  border-color: var(--color-danger);
}

table {
  width: 100%;
  border-collapse: collapse;
}
th,
td {
  text-align: left;
  padding: 0.5rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}
th {
  font-weight: 600;
  color: var(--color-muted);
  font-size: 0.9rem;
}

.tabs {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
/* Filters of the list, at the right of the tabs. */
.tabs form.list-filters {
  margin-left: auto;
}
.tabs a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}
.tabs a[aria-current="page"] {
  border-bottom-color: var(--color-primary);
  font-weight: 600;
}
/* Tabs switching panels in the page (drop link commands). */
.tabs [role="tab"] {
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 0.25rem 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.tabs [role="tab"][aria-selected="true"] {
  border-bottom-color: var(--color-primary);
  font-weight: 600;
}
/* Two-way switch between the interfaces of a page (upload page). */
.switch {
  display: flex;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.2rem;
  gap: 0.2rem;
  margin-bottom: 1.25rem;
}
.switch [role="tab"] {
  flex: 1;
  background: none;
  border: 0;
  border-radius: calc(var(--radius) - 2px);
  padding: 0.45rem 0.75rem;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.switch [role="tab"][aria-selected="true"] {
  background: var(--color-primary);
  color: var(--color-primary-text);
  font-weight: 600;
}
/* Message of the owner on a drop page. */
.drop-message {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 1rem;
}
pre.command {
  margin: 0;
  padding: 0.75rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.9rem;
}
label.check .hint {
  font-weight: 400;
}
/* A box with an explanation under its text: level with the first line. */
label.check:has(.hint) {
  align-items: flex-start;
}
label.check:has(.hint) > input {
  margin-top: 0.3rem;
}
.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.25rem 1rem;
}
.facts dt {
  color: var(--color-muted);
}
.facts dd {
  margin: 0;
}
.actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}
/* Buttons after a link is created: one row whatever the language, the
   buttons narrow (their text wraps) rather than the row; stacked on phones. */
.actions.result {
  flex-wrap: nowrap;
}
.actions.result > * {
  flex: 0 1 auto;
  min-width: 0;
  text-align: center;
}
@media (max-width: 40rem) {
  .actions.result {
    flex-direction: column;
  }
  .actions.result > * {
    width: 100%;
  }
  .actions.result > .end {
    margin-left: 0;
  }
}
/* The last action of a row, on the right. */
.actions > .end {
  margin-left: auto;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.badge.ok {
  color: var(--color-notice-text);
  border-color: var(--color-notice-text);
}
.dropzone {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
}
.dropzone.over {
  border-color: var(--color-primary);
  background: var(--color-bg);
}
.dropzone .actions {
  justify-content: center;
  margin: 0.5rem 0;
}
.files {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  overflow-wrap: anywhere;
}
/* Files picked for an upload: a long list scrolls in place, so what
   surrounds it stays within reach. */
#file-list {
  max-height: 16rem;
  overflow-y: auto;
  overscroll-behavior: contain;
}
#file-list:not(:empty) {
  padding: 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}
.tree .files {
  margin: 0.35rem 0 0 0.45rem;
  padding-left: 0.9rem;
  border-left: 1px solid var(--color-border);
}
.tree summary {
  cursor: pointer;
  list-style: none;
}
.tree summary::-webkit-details-marker {
  display: none;
}
.tree summary::before {
  content: "";
  display: inline-block;
  width: 0.4rem;
  height: 0.4rem;
  margin: 0 0.5rem 0.15rem 0.1rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.15s;
}
.tree details[open] > summary::before {
  transform: rotate(45deg);
}
.folder-name {
  font-weight: 600;
}
/* Files line up with the folder names, past the chevron. */
.tree:has(.folder) .file {
  padding-left: calc(1rem + 4px);
}
@media (prefers-reduced-motion: reduce) {
  .tree summary::before {
    transition: none;
  }
}
/* Under the upload bar: progress on the left and speed on the right, then
   elapsed and remaining time on the next line. */
.progress-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  column-gap: 1rem;
  margin: 0.4rem 0 0;
}
.progress-line > p {
  margin: 0;
}
.progress-stats {
  font-size: 0.9em;
}
.progress-stats,
.progress-speed {
  font-variant-numeric: tabular-nums;
}
.progress-speed:empty,
.progress-stats span:empty {
  display: none;
}
progress {
  width: 100%;
  height: 0.75rem;
}
form.row {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

/* Field names: the optional mark always follows the name, same style. */
.field-name {
  display: block;
}
.optional {
  font-weight: 400;
  font-size: 0.875rem;
  color: var(--color-muted);
}

/* Collapsible option sections, closed by default. */
.options {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}
.options > details + details {
  border-top: 1px solid var(--color-border);
}
.options summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  cursor: pointer;
  list-style: none;
  border-radius: var(--radius);
}
.options summary::-webkit-details-marker {
  display: none;
}
.options summary::before {
  content: "";
  flex: none;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid var(--color-muted);
  border-bottom: 2px solid var(--color-muted);
  transform: rotate(-45deg);
  transition: transform 0.15s;
}
.options details[open] > summary::before {
  transform: rotate(45deg);
}
.options summary:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: -2px;
}
.options-title {
  font-weight: 500;
  flex: none;
}
.options-value {
  margin-left: auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--color-muted);
  font-size: 0.875rem;
}
.options details[open] > summary .options-value {
  visibility: hidden;
}
.options-body {
  padding: 0 0.9rem 0.9rem;
}
/* Narrow screens: the summary goes under the title, in full. */
@media (max-width: 30rem) {
  .options summary {
    flex-wrap: wrap;
    row-gap: 0.1rem;
  }
  .options-value {
    flex-basis: 100%;
    margin-left: 1.2rem;
    white-space: normal;
  }
  .options details[open] > summary .options-value {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .options summary::before {
    transition: none;
  }
}

/* Introduction above a list. */
/* Email template editor: form and variables side by side. */
.template-editor {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 48rem) {
  .template-editor {
    grid-template-columns: 1fr;
  }
}
textarea.code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.875rem;
}
.variables {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 0.75rem;
  margin: 0;
}
.variables dd {
  margin: 0;
  color: var(--color-muted);
}
.email-preview {
  width: 100%;
  height: 34rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: #f6f5f4;
  margin-bottom: 1rem;
}
.error-text {
  color: var(--color-error-text);
}
td.nowrap {
  white-space: nowrap;
}

/* Lists of shares and drop links: one block per item, its details wrap. */
.items {
  list-style: none;
  margin: 0;
  padding: 0;
}
.items > li {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--color-border);
}
.items > li:first-child {
  border-top: 1px solid var(--color-border);
}
.item-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.item-title {
  font-weight: 600;
  overflow-wrap: anywhere;
}
.item-action {
  margin-left: auto;
}
/* Fixed-width columns, so the details line up from one item to the next. */
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
  gap: 0.35rem 1.25rem;
  margin: 0.4rem 0 0;
  font-size: 0.9rem;
}
.facts dt {
  color: var(--color-muted);
  font-size: 0.8rem;
}
.facts dd {
  margin: 0;
}
.facts .wide {
  grid-column: 1 / -1;
}
/* Facts above a form. */
.facts.spaced {
  margin-bottom: 1.25rem;
}
.heading h2 {
  margin: 0;
}
.template-editor + .heading {
  margin-top: 1.5rem;
}
.muted + .items {
  margin-top: 1rem;
}
@media (max-width: 30rem) {
  .facts {
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem 1rem;
  }
}

/* Login: SSO buttons under the password form. */
.sso {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1.25rem;
}
.separator {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--color-muted);
  font-size: 0.9rem;
  margin: 0 0 0.25rem;
}
.separator::before,
.separator::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--color-border);
}
.sso-button {
  text-align: center;
}
.register-link {
  margin-top: 1.25rem;
}
.resend {
  margin-top: 1rem;
}
input.code-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.4rem;
  letter-spacing: 0.3em;
  max-width: 12rem;
}
.order {
  display: flex;
  gap: 0.5rem;
}
.add-provider {
  margin-top: 1rem;
  align-items: flex-end;
}
dd.break {
  overflow-wrap: anywhere;
}
button.link:disabled {
  color: var(--color-muted);
  text-decoration: none;
  cursor: default;
}

/* --- Appearance (SPEC §3.8) ------------------------------------------- */

/* Logo in the header. */
.brand img {
  display: block;
  max-width: min(60vw, 100%);
  height: auto;
}

/* Backgrounds of the pages seen without an account. */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: var(--color-bg);
}
.backdrop img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.2s ease-in-out;
}
.backdrop img.shown {
  opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
  .backdrop img {
    transition: none;
  }
}
body.has-backdrop {
  background: transparent;
}
/* Tabs sit on the image: give them a surface to stay readable. */
body.has-backdrop .tabs {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.4rem 0.75rem;
}
body.has-backdrop .footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
}

/* A field and its button on one line (wraps on narrow screens). */
.field-row {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.field-row label {
  flex: 1;
  min-width: 14rem;
}

.asset-preview img {
  display: block;
  max-width: 100%;
  height: auto;
  padding: 0.5rem;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius);
}
.thumbnails {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  gap: 1rem;
}
.thumbnails img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
}
.thumbnails {
  margin-bottom: 1.5rem;
}
/* Several forms in one card (appearance): keep them apart. */
.card > form + form,
.card > .actions + form {
  margin-top: 1.5rem;
}
.thumbnails li {
  position: relative;
}
/* Delete: an icon in the top right corner of the image. */
.thumbnail-delete {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
}
.thumbnail-delete .icon-button {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border-radius: 999px;
  color: var(--color-danger);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.25);
}
.thumbnail-delete .icon-button:hover {
  color: var(--color-surface);
  background: var(--color-danger);
}
.thumbnail-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 0.35rem;
}
button.link.danger-text {
  color: var(--color-danger);
}
/* Icons (Lucide), drawn in the colour of the text around them. */
.icon {
  display: block;
  flex: none;
}
button.icon-button {
  display: inline-flex;
  padding: 0.35rem;
  border: none;
  background: none;
  color: inherit;
  cursor: pointer;
  border-radius: var(--radius);
}

/* Themes: one card per theme; a click on the card activates it. */
.theme-grid {
  list-style: none;
  margin: 1rem 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  gap: 1rem;
}
.theme-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.theme-card:hover,
.theme-card:focus-within {
  border-color: var(--color-primary);
}
.theme-card.active {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px var(--color-primary);
}
.theme-previews {
  display: flex;
  border-bottom: 1px solid var(--color-border);
}
.theme-previews svg {
  display: block;
  flex: 1;
  width: 50%;
  height: 5.5rem;
}
.theme-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.6rem 0.75rem 0.25rem;
}
.theme-name {
  font-weight: 600;
}
.theme-info .muted {
  font-size: 0.85rem;
}
/* Mark of the active theme, top right. */
.theme-check {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: flex;
  padding: 0.25rem;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-primary-text);
  box-shadow: 0 0 0 2px var(--color-surface);
}
/* The activation button covers the whole card, under the tools. */
.theme-pick-form {
  display: contents;
}
button.theme-pick {
  position: absolute;
  inset: 0;
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: var(--radius);
}
button.theme-pick:focus-visible {
  outline-offset: -3px;
}
.theme-tools {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 0.25rem;
  margin-top: auto;
  padding: 0.25rem 0.5rem 0.4rem;
}
.theme-tools a,
.theme-tools button {
  display: inline-flex;
  padding: 0.35rem;
  border-radius: var(--radius);
  color: var(--color-muted);
}
.theme-tools a:hover,
.theme-tools button:hover {
  color: var(--color-primary);
  background: var(--color-bg);
}
.theme-tools button.danger-text:hover {
  color: var(--color-danger);
}

/* Theme editor: form and live sample side by side. */
.theme-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 56rem) {
  .theme-editor {
    grid-template-columns: 1fr;
  }
}
.theme-live {
  position: sticky;
  top: 1rem;
}
.theme-live-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.theme-live-head h2 {
  margin: 0;
}
.theme-preview {
  margin-top: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font);
}
.theme-preview .card {
  margin-bottom: 0;
}
.theme-sample h3 {
  margin-top: 0;
}
.theme-sample .card > * + * {
  margin-top: 0.75rem;
}
table.colors {
  border-collapse: collapse;
  width: 100%;
}
table.colors th,
table.colors td {
  text-align: left;
  padding: 0.25rem 0.5rem 0.25rem 0;
  font-weight: 400;
}
table.colors thead th {
  font-weight: 600;
}
table.colors input[type="color"] {
  width: 3.5rem;
  height: 2rem;
  padding: 0.1rem;
}

/* --- Statistics (SPEC §3.9) ------------------------------------------ */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}
.stat {
  display: flex;
  flex-direction: column;
  padding: 0.9rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}
.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
}
.stat-label {
  color: var(--color-muted);
  font-size: 0.9rem;
}
.chart {
  margin: 0 0 1rem;
}
.chart svg {
  display: block;
  width: 100%;
  height: 8rem;
}
.chart-bar {
  fill: var(--color-primary);
}
.chart-bar:hover {
  opacity: 0.75;
}
.chart-axis {
  stroke: var(--color-border);
  stroke-width: 2;
}
.chart figcaption {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--color-muted);
  font-size: 0.85rem;
}
/* Same columns in every ranking of the page, whatever their content. */
table.ranking {
  border-collapse: collapse;
  width: 100%;
  table-layout: fixed;
}
table.ranking th:first-child {
  width: 60%;
}
table.ranking td:first-child {
  overflow-wrap: anywhere;
}
@media (max-width: 40rem) {
  table.ranking th:first-child {
    width: 44%;
  }
}
table.ranking th,
table.ranking td {
  text-align: left;
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--color-border);
}
table.ranking .num {
  text-align: right;
  white-space: nowrap;
}

/* Top navigation: icon links and the user menu. */
.nav > a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius);
  color: var(--color-text);
  text-decoration: none;
}
.nav > a:hover,
.nav > a[aria-current="page"] {
  background: color-mix(in srgb, var(--color-primary) 12%, transparent);
  color: var(--color-primary);
}
.user-menu {
  position: relative;
}
.user-menu summary {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.3rem 0.4rem;
  border-radius: 999px;
  cursor: pointer;
  list-style: none;
  color: var(--color-text);
}
.user-menu summary::-webkit-details-marker {
  display: none;
}
.user-menu summary .icon:first-child {
  width: 28px;
  height: 28px;
}
.user-menu summary .icon:last-child {
  width: 14px;
  height: 14px;
  transition: transform 0.15s;
}
.user-menu[open] summary .icon:last-child {
  transform: rotate(180deg);
}
.user-menu summary:hover,
.user-menu[open] summary {
  background: color-mix(in srgb, var(--color-primary) 12%, transparent);
}
.user-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  z-index: 20;
  min-width: 15rem;
  padding: 0.4rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.18);
}
.user-menu-name {
  display: flex;
  flex-direction: column;
  margin: 0 0 0.4rem;
  padding: 0.5rem 0.6rem 0.6rem;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}
.user-menu-panel form {
  margin: 0;
}
.user-menu-panel a,
.user-menu-panel button {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.5rem 0.6rem;
  border: 0;
  border-radius: var(--radius);
  background: none;
  color: var(--color-text);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.user-menu-panel a:hover,
.user-menu-panel button:hover {
  background: color-mix(in srgb, var(--color-primary) 12%, transparent);
}
.user-menu-panel button {
  color: var(--color-danger);
}
/* On the left like the links above: the rule for buttons with an icon
   centres their content, and is more specific. */
.user-menu-panel form button:not(.icon-button) {
  display: flex;
  justify-content: flex-start;
}
@media (max-width: 40rem) {
  .nav {
    gap: 0.25rem;
  }
  .nav > a span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

/* Page title, set apart above the page content. */
.page-head {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-primary);
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  margin-bottom: 1rem;
}
.page-head.narrow {
  max-width: 32rem;
  margin-left: auto;
  margin-right: auto;
}
.page-head.send {
  max-width: 40rem;
  margin-left: auto;
  margin-right: auto;
}
.page-head.settings {
  max-width: 48rem;
  margin-left: auto;
  margin-right: auto;
}
/* Administration: wider, for its tables; its forms keep a narrower column. */
.main-admin {
  max-width: 84rem;
}
.main-admin .card.settings,
.main-admin .page-head.settings {
  max-width: 64rem;
}
.page-back {
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
}
.page-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.page-title h1 {
  flex: 1 1 12rem;
  min-width: 0;
  margin: 0;
  font-size: 1.6rem;
  line-height: 1.2;
}
.page-title .actions {
  margin: 0 0 0 auto;
}
/* Name of a share, renamed in place: pencil, then field and green tick. */
.page-title .rename {
  flex: 1 1 12rem;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.page-title .rename h1 {
  flex: 0 1 auto;
  overflow-wrap: anywhere;
}
.page-title .rename h1:has(input:not([hidden])) {
  flex: 1 1 auto;
}
.page-title .rename input[type="text"] {
  width: 100%;
  font: inherit;
  margin: 0;
}
.page-title .rename .icon-button {
  color: var(--color-muted);
}
.page-title .rename .icon-button:hover {
  color: var(--color-text);
}
.page-title .rename .rename-save,
.page-title .rename .rename-save:hover {
  color: var(--color-notice-bg);
  background: var(--color-notice-text);
}
/* Pages of a long list. */
.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 0.75rem;
  margin-top: 1rem;
}
.pager-pages {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
}
.pager-pages a,
.pager-current {
  min-width: 2.25rem;
  padding: 0.35rem 0.5rem;
  text-align: center;
  border-radius: calc(var(--radius) / 2);
}
.pager-current {
  background: var(--color-primary);
  color: var(--color-primary-text);
  font-weight: 600;
}
/* Filters of a list, next to its title. */
form.list-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
form.list-filters select {
  width: auto;
}
.page-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--color-primary) 14%, transparent);
  color: var(--color-primary);
}
@media (max-width: 40rem) {
  .page-head {
    padding: 0.75rem 1rem;
  }
  .page-title h1 {
    font-size: 1.35rem;
  }
}
.card > h2:first-child {
  margin-top: 0;
}

/* Buttons with an icon. */
.button:has(.icon),
button:not(.icon-button):has(.icon) {
  display: inline-flex;
  align-items: center;
  /* Icon and text together in the middle, also on a full-width button. */
  justify-content: center;
  gap: 0.5rem;
}
/* Active filter above a list. */
/* Usage card above the owner's lists (SPEC §3.11): limited values side by
   side, label then value then bar; the group's space on its own line. */
.card.usage {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem clamp(1rem, 4vw, 2rem);
  padding: 0.75rem clamp(1rem, 4vw, 1.5rem);
}
.usage .meter {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
  font-size: 0.875rem;
}
.usage .meter.wide {
  grid-column: 1 / -1;
}
.usage .meter > .muted {
  overflow-wrap: anywhere;
}
.usage .meter > strong {
  font-variant-numeric: tabular-nums;
}
/* Bars at the bottom: aligned when a label takes two lines. */
.usage progress {
  display: block;
  height: 0.5rem;
  margin-top: auto;
  accent-color: var(--color-primary);
}
.usage progress.full {
  accent-color: var(--color-danger);
}
/* Lists: search, then the bar of bulk actions (SPEC §3.15). */
.list-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.list-toolbar > .muted {
  margin-left: auto;
}
.list-search {
  flex: 1 1 16rem;
  max-width: 26rem;
}
.list-search label {
  position: relative;
  display: block;
}
.list-search .icon {
  position: absolute;
  left: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-muted);
  pointer-events: none;
}
.list-search input {
  width: 100%;
  padding-left: 2.1rem;
}
.bulk-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: calc(var(--radius) / 2);
  background: var(--color-bg);
}
.bulk-bar.has-selection {
  border-color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 10%, var(--color-surface));
}
.bulk-bar label {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  font-weight: 400;
  margin: 0;
}
.bulk-bar.has-selection [data-bulk-label] {
  font-weight: 600;
}
.bulk-actions {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
  flex-wrap: wrap;
}
.bulk-actions button {
  padding: 0.35rem 0.8rem;
}
.bulk-actions button:disabled {
  opacity: 0.45;
  cursor: default;
}
.bulk-all {
  margin: 0 0 0.5rem;
  padding: 0.4rem 0.75rem;
  font-size: 0.9rem;
  text-align: center;
  background: color-mix(in srgb, var(--color-primary) 8%, transparent);
  border-radius: calc(var(--radius) / 2);
}
.items > li:has([data-bulk-item]:checked),
tr:has([data-bulk-item]:checked) td {
  background: color-mix(in srgb, var(--color-primary) 7%, transparent);
}
[data-bulk-item],
[data-bulk-all],
td.select input {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  accent-color: var(--color-primary);
}
/* Actions of a row (members of a group): small icon buttons side by side. */
td.row-actions {
  white-space: nowrap;
  text-align: right;
}
td.row-actions form {
  display: inline-block;
}
th.select,
td.select {
  width: 2rem;
}
dialog.confirm {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
  padding: 1.25rem;
  max-width: 26rem;
}
dialog.confirm::backdrop {
  background: rgb(0 0 0 / 0.45);
}
dialog.confirm .actions {
  justify-content: flex-end;
}
dialog.confirm button.danger {
  background: var(--color-danger);
  border-color: var(--color-danger);
  color: #fff;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.4rem 0.2rem 0.75rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-primary) 14%, transparent);
  color: var(--color-primary);
  font-size: 0.9rem;
}
.chip a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 999px;
  color: inherit;
  text-decoration: none;
}
.chip a:hover {
  background: color-mix(in srgb, var(--color-primary) 20%, transparent);
}

/* Text shares (SPEC §3.13): typed and shown as is, in a fixed-width font. */
.secret-input,
.secret-text {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.95rem;
}
.secret-text {
  margin: 0;
  padding: 0.75rem 1rem;
  max-height: 60vh;
  overflow: auto;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: calc(var(--radius) / 2);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.item-title .icon {
  display: inline-block;
  margin-right: 0.35rem;
  vertical-align: -0.15em;
}

/* Share page while the link is checked. */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  min-height: 6rem;
  color: var(--color-muted);
}
.loading p {
  margin: 0;
}
.spinner {
  flex: none;
  width: 1.5rem;
  height: 1.5rem;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation-duration: 2.4s;
  }
}

/* The view that replaces the wait fades in. */
#share-page > :not(#share-loading) {
  animation: share-fade-in 0.25s ease-out both;
}
@keyframes share-fade-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  #share-page > :not(#share-loading) {
    animation: none;
  }
}

/* About page (SPEC §3.16). */
.about .lead {
  font-size: 1.05rem;
}
.about h2 {
  margin-top: 1.75rem;
}
.about ul {
  padding-left: 1.2rem;
}
.about li + li {
  margin-top: 0.4rem;
}
.about .options {
  margin-top: 0.75rem;
}
.about .options-body {
  padding-left: 2.2rem;
}

/* Two-factor authentication: QR code (always dark on white, for cameras),
   key to type, recovery codes. */
.qr {
  display: flex;
  justify-content: center;
}
.qr svg {
  width: 200px;
  height: 200px;
  border-radius: calc(var(--radius) / 2);
}
.totp-key code {
  font-size: 1.05rem;
  letter-spacing: 0.05em;
  overflow-wrap: anywhere;
}
ol.steps {
  margin: 0;
  padding-left: 1.25rem;
}
ul.recovery-codes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.5rem 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
ul.recovery-codes code {
  font-size: 1rem;
}

/* Files of an opened share (public page): list, grid or mosaic, and the
   full-screen viewer of the images. The page is wider than the others, so
   that a grid shows several images side by side. */
.main:has(.browser) {
  max-width: 80rem;
}
.main:has(.browser) .page-head.narrow,
.main:has(.browser) .card.narrow {
  max-width: none;
}
.browser {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.browser-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}
.browser-tools {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}
.sort-by {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
}
.sort-by select {
  width: auto;
  margin: 0;
}
.sort-direction span {
  display: inline-block;
  width: 18px;
  line-height: 18px;
  text-align: center;
}
.views {
  display: inline-flex;
  gap: 0.15rem;
  padding: 0.15rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}
.views button[aria-pressed="true"] {
  background: var(--color-primary);
  color: var(--color-primary-text);
}
.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
}
.crumb {
  border: none;
  background: none;
  padding: 0.2rem 0.35rem;
  color: var(--color-primary);
  cursor: pointer;
  border-radius: var(--radius);
  overflow-wrap: anywhere;
}
.crumb[aria-current] {
  color: inherit;
  font-weight: 600;
  cursor: default;
}
.crumb-separator {
  color: var(--color-muted);
}
.file-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-muted);
}

/* List: one row per file, folders indented; the columns line up. */
.browser-head,
.browser-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 5rem 6rem 2.25rem;
  align-items: center;
  gap: 0.75rem;
}
.browser-head {
  padding: 0 0.5rem;
  font-size: 0.875rem;
  color: var(--color-muted);
}
.browser-head > :first-child {
  display: none;
}
.browser-head > :nth-child(4) {
  text-align: right;
}
.browser:not([data-view="list"]) .browser-head {
  display: none;
}
.browser-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.browser-row {
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius);
}
.browser-row:hover {
  background: color-mix(in srgb, var(--color-text) 5%, transparent);
}
.row-open,
.folder-toggle,
.browser button.row-open,
.browser button.folder-toggle {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem;
  min-width: 0;
  padding: 0 0 0 calc(var(--depth, 0) * 1.25rem);
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
span.row-open {
  cursor: default;
}
.folder-toggle {
  grid-column: 1 / -1;
}
.row-open .thumb,
.row-open .file-icon,
.folder-toggle .file-icon {
  flex: none;
  width: 3rem;
  height: 3rem;
  border-radius: calc(var(--radius) / 2);
  object-fit: cover;
  background: color-mix(in srgb, var(--color-text) 6%, transparent);
}
.row-name {
  overflow-wrap: anywhere;
}
.row-size {
  text-align: right;
}
.row-download {
  display: inline-flex;
  justify-content: center;
  color: inherit;
}
@media (max-width: 40rem) {
  .browser-head,
  .browser-row {
    grid-template-columns: minmax(0, 1fr) auto 2.25rem;
  }
  .row-format,
  .browser-head > :nth-child(3) {
    display: none;
  }
}

/* Grid: square tiles, at least four side by side on a computer. Mosaic:
   rows of images at their own proportions. */
.browser-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: 0.75rem;
}
.browser-mosaic {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.browser-mosaic::after {
  content: "";
  flex-grow: 1000;
}
.browser-mosaic > .tile {
  flex: var(--ratio, 1) 1 calc(var(--ratio, 1) * 11rem);
}
.tile,
.browser button.tile {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0.25rem;
  min-width: 0;
  padding: 0;
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
span.tile {
  cursor: default;
}
.tile-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--color-text) 6%, transparent);
}
.browser-mosaic .tile-visual {
  aspect-ratio: var(--ratio, 1);
}
.tile-visual .thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s;
}
.tile:hover .thumb,
.tile:focus-visible .thumb {
  transform: scale(1.03);
}
.tile-visual .file-icon .icon {
  width: 2.5rem;
  height: 2.5rem;
}
.folder-tile .tile-visual .file-icon {
  color: var(--color-primary);
}
.tile-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.875rem;
}
.tile-meta {
  font-size: 0.75rem;
}
@media (max-width: 40rem) {
  .browser-grid {
    grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
  }
  .browser-mosaic > .tile {
    flex-basis: calc(var(--ratio, 1) * 7rem);
  }
}
@media (prefers-reduced-motion: reduce) {
  .tile-visual .thumb {
    transition: none;
  }
}

/* Viewer: the image fits the screen, on a dark background. */
.viewer {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: none;
  background: rgb(0 0 0 / 0.92);
  color: #fff;
}
.viewer[open] {
  display: flex;
  flex-direction: column;
}
.viewer::backdrop {
  background: rgb(0 0 0 / 0.6);
}
.viewer-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
}
.viewer-caption {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.viewer-position {
  color: rgb(255 255 255 / 0.7);
  font-variant-numeric: tabular-nums;
}
.viewer-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  border: none;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.12);
  color: #fff;
  cursor: pointer;
}
.viewer-button:hover {
  background: rgb(255 255 255 / 0.25);
}
.viewer-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  touch-action: pan-y pinch-zoom;
}
.viewer-stage img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  user-select: none;
}
.viewer-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}
.viewer-nav.previous {
  left: 0.75rem;
}
.viewer-nav.next {
  right: 0.75rem;
}
.viewer-nav .icon {
  width: 28px;
  height: 28px;
}

/* Recipients of a share and where their emails stand (SPEC §3.7). */
.deliveries {
  list-style: none;
  margin: 0;
  padding: 0;
}
.delivery {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  padding: 8px 0;
  overflow-wrap: anywhere;
}
.delivery + .delivery {
  border-top: 1px solid var(--color-border);
}
.delivery-icon {
  display: inline-flex;
  flex: none;
  color: var(--color-text);
}
.delivery-state {
  font-weight: 600;
}
.delivery-reason,
.delivery-detail {
  color: var(--color-muted);
}
.delivery-detail {
  flex-basis: 100%;
}
.delivery-unknown .delivery-icon {
  color: var(--color-muted);
}
.delivery-delayed .delivery-icon,
.delivery-delayed .delivery-state {
  color: #e07b00;
}
.delivery-undelivered .delivery-icon,
.delivery-undelivered .delivery-state,
.delivery-refused .delivery-icon,
.delivery-refused .delivery-state {
  color: var(--color-danger);
}
.delivery-queued .delivery-icon {
  animation: delivery-blink 1.2s ease-in-out infinite;
}
@keyframes delivery-blink {
  50% {
    opacity: 0.2;
  }
}
@media (prefers-reduced-motion: reduce) {
  .delivery-queued .delivery-icon {
    animation: none;
  }
}
