:root {
  --bg: #f4f3f6;
  --card: #ffffff;
  --text: #17141c;
  --muted: #625d6b;
  --line: #e4e1e8;
  --accent: #d6007a;
  --accent-text: #ffffff;
  --accent-soft: #fde6f2;
  --ok: #0a7d45;
  --error: #b3261e;
  --shadow: 0 1px 2px rgb(20 10 30 / 6%), 0 8px 32px rgb(20 10 30 / 8%);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111014;
    --card: #1c1a21;
    --text: #f2f0f5;
    --muted: #a39dad;
    --line: #2e2b35;
    --accent: #ff4fae;
    --accent-text: #1a0010;
    --accent-soft: #3a1429;
    --ok: #4cd08a;
    --error: #ff8a80;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 32px rgb(0 0 0 / 35%);
  }
}

:root[data-theme="dark"] {
  --bg: #111014;
  --card: #1c1a21;
  --text: #f2f0f5;
  --muted: #a39dad;
  --line: #2e2b35;
  --accent: #ff4fae;
  --accent-text: #1a0010;
  --accent-soft: #3a1429;
  --ok: #4cd08a;
  --error: #ff8a80;
}

* {
  box-sizing: border-box;
}

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

html,
body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  margin: 0;
  height: 100vh;
  height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  display: flex;
  touch-action: pan-x pan-y;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

input {
  user-select: text;
  -webkit-user-select: text;
  -webkit-touch-callout: default;
}

main {
  width: 100%;
  max-width: 520px;
  max-height: 100%;
  margin: auto;
  padding: max(32px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    max(32px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
  margin: 0 0 14px 4px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 28px 24px 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.title {
  font-size: 22px;
  margin: 0 0 8px;
}

.file {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.file-icon {
  flex: none;
  width: 40px;
  height: 40px;
  fill: var(--accent);
  margin-top: 2px;
}

.file.done .file-icon {
  fill: var(--ok);
}

.name {
  font-size: 19px;
  line-height: 1.3;
  margin: 0;
  overflow-wrap: anywhere;
}

.size {
  margin: 2px 0 0;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.muted,
.note {
  color: var(--muted);
  margin: 0 0 18px;
}

.note.live {
  color: var(--accent);
}

.warn {
  margin: 0 0 18px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--accent-soft);
}

.error {
  color: var(--error);
  margin: 0;
}

.message {
  margin: 0;
}

.ok {
  color: var(--ok);
  font-weight: 600;
  margin: 0 0 6px;
}

button {
  font: inherit;
  font-weight: 600;
  width: 100%;
  min-height: 48px;
  border-radius: 12px;
  cursor: pointer;
  border: 1px solid transparent;
}

button.primary {
  background: var(--accent);
  color: var(--accent-text);
}

button.primary:hover {
  filter: brightness(1.06);
}

button.secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}

button.secondary:hover {
  background: var(--bg);
}

button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin-top: 16px;
}

button.link-button {
  width: auto;
  min-height: 0;
  padding: 4px 0;
  border: none;
  background: none;
  color: var(--muted);
  font-weight: 500;
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.actions .hint {
  flex-basis: 100%;
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--muted);
}

button.link-button:hover {
  color: var(--error);
}

.bar {
  height: 10px;
  border-radius: 5px;
  background: var(--line);
  overflow: hidden;
  margin: 4px 0 10px;
}

.fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 5px;
  transition: width 0.25s linear;
}

.stats {
  margin: 0 0 6px;
  font-variant-numeric: tabular-nums;
}

body.bare .brand,
.card:empty {
  display: none;
}

html.anywhere body {
  cursor: pointer;
}

.get.busy {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--accent-soft);
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.meter {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--accent-text);
  clip-path: inset(0 calc(100% - var(--done, 0%)) 0 0);
  transition: clip-path 0.25s linear;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  margin-top: 12px;
}

.until {
  margin: 0;
  color: var(--muted);
}

button.icon-button {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  min-height: 44px;
  margin-right: -12px;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
}

button.icon-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

button.icon-button:hover {
  color: var(--error);
  background: var(--bg);
}

.noscript {
  text-align: center;
  padding: 16px;
}

@media (prefers-reduced-motion: reduce) {
  .fill,
  .meter {
    transition: none;
  }
}

/* --- the send page ---------------------------------------------------------- */

.error.spaced,
.muted.spaced {
  margin: 0 0 14px;
}

.drop {
  margin: 18px 0 14px;
}

.drop-hint {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  margin: 6px 0 0;
}

body.dragging .card {
  outline: 3px dashed var(--accent);
  outline-offset: 4px;
}

body.whole main {
  max-width: none;
  margin: 0;
  padding: 0;
}

body.whole .card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: none;
  text-align: center;
  cursor: pointer;
}

body.whole.dragging .card {
  outline-offset: -12px;
  background: var(--accent-soft);
}

.sent {
  margin: -80px 0 24px;
  animation: float-in 0.6s ease-out;
}

.sent svg {
  display: block;
  width: 56px;
  height: 56px;
  fill: none;
  stroke: var(--ok);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sent span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@keyframes float-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .sent {
    animation: none;
  }
}

button.pick {
  width: auto;
  min-height: 0;
  padding: 2px 6px;
  border: none;
  background: none;
  color: var(--text);
}

.from {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: min(320px, 100%);
  margin: 0 0 20px;
  text-align: left;
  cursor: auto;
}

.from label {
  font-size: 15px;
}

.from input {
  font: inherit;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  min-height: 44px;
}

.from input:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 1px;
}

.options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 0 0 4px;
}

.options label {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  color: var(--muted);
  font-size: 15px;
  white-space: nowrap;
}

.options label[hidden] {
  display: none;
}

.options select {
  min-width: 0;
}

select {
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 10px;
  min-height: 36px;
}

select:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 1px;
}

.card:has(> .scroll) {
  display: flex;
  flex-direction: column;
}

.scroll {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.hint {
  margin: 16px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--accent-soft);
  font-size: 14px;
}

.linkbox {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
}

.url {
  margin: 0;
  font: 15px/1.4 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  overflow-wrap: anywhere;
  user-select: all;
  -webkit-user-select: all;
}

.url.small {
  font-size: 13px;
  color: var(--muted);
}

.big-code {
  margin: 0 0 4px;
  font: 600 26px/1.2 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  letter-spacing: 0.06em;
  user-select: all;
  -webkit-user-select: all;
}

.buttons {
  display: flex;
  gap: 10px;
  margin: 0 0 18px;
}

button.another {
  margin-top: 4px;
}

.list-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  margin: 22px 0 6px;
}

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

.list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.item {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.item-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-info {
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

button.small-button {
  flex: none;
  width: auto;
  min-width: 44px;
  min-height: 36px;
  padding: 0 12px;
  border-color: var(--line);
  background: transparent;
  color: var(--text);
  font-size: 15px;
}

button.small-button:hover {
  background: var(--bg);
}

/* Notifications and what happened, on the send page (notify.js). */
.notify,
.recent {
  margin-top: 1.5rem;
}

.request {
  margin-top: 0.5rem;
}

.muted code,
.error code {
  font: 0.95em ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  white-space: nowrap;
}

.notify p {
  margin: 0.25rem 0 0.75rem;
}
