.parcel-page .shell {
  justify-content: space-between;
}

.parcel {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  padding: 28px 0 44px;
}

.loading,
.challenge,
.creator,
.receiver,
.file-view,
.error-view {
  text-align: center;
}

.challenge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

/* Turnstile is 65px tall; the slot keeps the page from jumping when it mounts. */
.turnstile-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 65px;
}

.challenge-hint {
  margin: 0;
  color: var(--ink-soft);
}

.skeleton {
  width: 100%;
  max-width: 340px;
  height: 132px;
  margin: 18px auto 0;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(100deg, var(--paper-2) 28%, var(--card) 50%, var(--paper-2) 72%);
  background-size: 240% 100%;
  animation: shimmer 1.4s linear infinite;
}

.code-display {
  display: block;
  margin: 6px auto 4px;
  padding: 0;
  border: 0;
  background: transparent;
  font-family: var(--font-mono);
  font-size: clamp(42px, 13vw, 66px);
  font-weight: 600;
  letter-spacing: 0.14em;
  line-height: 1.1;
  cursor: pointer;
}

.countdown {
  margin: 0 0 22px;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 14px;
}

.countdown.warn {
  color: var(--accent);
  font-weight: 600;
}

.qr-frame {
  display: block;
  width: min(260px, 84vw);
  margin: 0 auto;
  padding: 12px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: #fff;
  cursor: zoom-in;
}

.qr-frame canvas,
.qr-dialog canvas {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}

.pickup-meta {
  margin: 0 0 16px;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
}

.text-sheet {
  padding: 20px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  text-align: left;
}

.parcel-text {
  max-height: 58vh;
  margin: 0;
  overflow: auto;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  overflow-wrap: anywhere;
  user-select: text;
  white-space: pre-wrap;
}

.error-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(32px, 8vw, 46px);
  line-height: 1.08;
}

.error-hint {
  margin: 12px 0 0;
  color: var(--ink-soft);
}

.qr-dialog {
  padding: 18px;
  border: 2px solid var(--line);
  border-radius: 20px;
  background: #fff;
}

.qr-dialog::backdrop {
  background: rgba(8, 14, 13, 0.72);
}

.qr-dialog canvas {
  width: min(74vw, 320px);
}

.qr-close {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 38px;
  min-height: 38px;
  padding: 0;
  border-radius: 999px;
  background: #fff;
  color: #16211f;
  font-size: 20px;
}

.guide-card {
  margin: auto 0;
  padding: clamp(24px, 6vw, 40px);
  border: 2px solid var(--line);
  border-radius: 24px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.guide-card h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(32px, 8vw, 46px);
  line-height: 1.06;
}

.guide-mark {
  display: grid;
  width: 56px;
  height: 56px;
  margin-bottom: 18px;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 28px;
}

.steps {
  display: grid;
  gap: 12px;
  margin: 24px 0;
  padding: 0;
  list-style: none;
}

.steps li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
}

.step-num {
  display: grid;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 13px;
}

.copy-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding: 12px;
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  background: var(--paper);
}

.copy-row code {
  min-width: 0;
  overflow-wrap: anywhere;
  font-family: var(--font-mono);
  font-size: 12px;
}

@keyframes shimmer {
  from {
    background-position: 120% 0;
  }

  to {
    background-position: -120% 0;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .hero > *,
  .guide-card > *,
  .compose > * {
    animation: rise 520ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }

  .hero > *:nth-child(2) {
    animation-delay: 60ms;
  }

  .hero > *:nth-child(3) {
    animation-delay: 110ms;
  }

  .cards {
    animation: rise 560ms 150ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }

  .pickup {
    animation: rise 560ms 220ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 380px) {
  .card {
    min-height: 138px;
    padding: 14px;
  }

  .card-title {
    font-size: 22px;
  }

  .badge {
    top: 8px;
    right: 8px;
  }
}

.file-download-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 8px 0 18px;
  padding: 0;
  list-style: none;
  text-align: left;
}

.file-download-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 10px 14px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
}

.file-download-link:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.file-download-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-download-size {
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 12px;
  white-space: nowrap;
}

.file-download-arrow {
  font-size: 18px;
}
