/* dela — "the post office" look.
   Warm paper, black ink, one vermilion franking colour. Files are parcels with a label,
   shares are postage stamps with a perforated edge and the days left on them. */

@font-face {
  font-family: "Fraunces";
  src: url("/fonts/fraunces-latin-full-normal.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("/fonts/fraunces-latin-full-italic.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("/fonts/instrument-sans-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Plex Mono";
  src: url("/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --paper: #f2ede3;
  --paper-2: #e9e1d2;
  --card: #fbf8f2;
  --ink: #1a1916;
  --ink-2: #48443c;
  --muted: #847c6d;
  --line: #d5cbb8;
  --line-2: #c3b7a0;
  --accent: #d9431e;
  --accent-dark: #b23312;
  --accent-wash: #f6dccf;
  --ok: #2f6b4f;
  --ok-wash: #dcebe1;
  --warn: #9a5b0b;
  --radius: 14px;
  --shadow: 0 1px 0 rgba(26, 25, 22, .06), 0 10px 30px -12px rgba(26, 25, 22, .25);
  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --body: "Instrument Sans", "Avenir Next", "Segoe UI", sans-serif;
  --mono: "Plex Mono", ui-monospace, Menlo, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  color: var(--ink);
  font: 16px/1.5 var(--body);
  background-color: var(--paper);
  /* Paper grain: tiny fractal noise, multiplied into the paper colour. */
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .1  0 0 0 0 .09  0 0 0 0 .07  0 0 0 .05 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: inherit; text-decoration-color: var(--accent); text-underline-offset: 3px; }
button, input, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent); color: #fff; }

.wordmark {
  font-family: var(--display);
  font-style: italic;
  font-weight: 600;
  font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1;
  letter-spacing: -.02em;
  line-height: 1;
}
.wordmark::after { content: "."; color: var(--accent); font-style: normal; }

.boot { min-height: 70dvh; display: grid; place-items: center; font-size: 3rem; opacity: .35; }
.noscript { padding: 2rem; text-align: center; }

/* ---------- masthead ---------- */
.masthead {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 1.25rem;
  padding: .85rem clamp(1rem, 4vw, 2.5rem);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.masthead .wordmark { font-size: 2rem; text-decoration: none; }
.nav { display: flex; gap: .25rem; margin-left: .5rem; }
.nav a {
  padding: .4rem .75rem; border-radius: 999px; text-decoration: none;
  color: var(--ink-2); font-weight: 550; font-size: .95rem;
}
.nav a:hover { background: var(--paper-2); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--ink); color: var(--paper); }
.masthead .spacer { flex: 1; }
.gauge { display: grid; gap: .2rem; min-width: 11rem; font-size: .8rem; color: var(--ink-2); }
.gauge-bar { height: 6px; border-radius: 99px; background: var(--paper-2); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.gauge-fill { height: 100%; background: var(--ink); border-radius: inherit; transition: width .6s var(--ease); }
.gauge-fill.is-high { background: var(--accent); }
.gauge b { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); }
.who { position: relative; }
.who-btn {
  display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%;
  border: 1px solid var(--line-2); background: var(--card); cursor: pointer;
  font-family: var(--display); font-weight: 600; font-size: 1.05rem;
}
.who-menu {
  position: absolute; right: 0; top: calc(100% + .5rem); min-width: 15rem;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: .5rem; display: grid;
}
.who-menu .who-name { padding: .5rem .75rem .25rem; font-weight: 600; }
.who-menu .who-mail { padding: 0 .75rem .5rem; font-size: .85rem; color: var(--muted); border-bottom: 1px solid var(--line); margin-bottom: .35rem; overflow-wrap: anywhere; }
.who-menu a, .who-menu button {
  text-align: left; padding: .55rem .75rem; border-radius: 8px; border: 0; background: none;
  cursor: pointer; text-decoration: none;
}
.who-menu a:hover, .who-menu button:hover { background: var(--paper-2); }

/* ---------- layout ---------- */
.app { padding: clamp(1.25rem, 4vw, 3rem) clamp(1rem, 4vw, 2.5rem) 5rem; max-width: 1120px; margin: 0 auto; }
.page-title {
  font-family: var(--display); font-weight: 600; font-size: clamp(2rem, 5vw, 3.2rem);
  font-variation-settings: "opsz" 144, "SOFT" 50; letter-spacing: -.025em; line-height: 1.05;
  margin: 0 0 .35rem;
}
.page-lede { color: var(--ink-2); margin: 0 0 2rem; max-width: 38rem; }
.section-title {
  font-family: var(--display); font-weight: 600; font-size: 1.35rem; margin: 2.5rem 0 1rem;
  font-variation-settings: "opsz" 48;
}
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: .9em; }

/* ---------- buttons & fields ---------- */
.btn {
  --b: var(--ink); --f: var(--paper);
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 2.75rem; padding: .6rem 1.15rem; border-radius: 999px;
  border: 1.5px solid var(--b); background: var(--b); color: var(--f);
  font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .15s var(--ease), background .15s, box-shadow .15s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px -8px rgba(0,0,0,.45); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn--accent { --b: var(--accent); --f: #fff; }
.btn--accent:hover { --b: var(--accent-dark); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--card); }
.btn--small { min-height: 2.25rem; padding: .35rem .85rem; font-size: .9rem; }
.btn--block { width: 100%; }
.linkbtn {
  border: 0; background: none; padding: .35rem .5rem; border-radius: 8px; cursor: pointer;
  font-weight: 600; color: var(--ink-2); text-decoration: underline; text-decoration-color: transparent;
  text-underline-offset: 3px; transition: text-decoration-color .15s, color .15s;
}
.linkbtn:hover { color: var(--ink); text-decoration-color: var(--accent); }
.linkbtn--danger:hover { color: var(--accent-dark); }

.field { display: grid; gap: .35rem; margin-bottom: 1rem; }
.field label { font-weight: 600; font-size: .92rem; }
.field .hint { font-size: .82rem; color: var(--muted); }
.input {
  width: 100%; min-height: 3rem; padding: .7rem .9rem; border-radius: 10px;
  border: 1.5px solid var(--line-2); background: var(--card);
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px rgba(26,25,22,.08); }
textarea.input { min-height: 6rem; resize: vertical; }
.input--code { font-family: var(--mono); font-size: 1.6rem; letter-spacing: .35em; text-align: center; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.input:focus-visible { outline: none; }

.alert { padding: .75rem 1rem; border-radius: 10px; margin-bottom: 1rem; font-size: .95rem; }
.alert--error { background: var(--accent-wash); color: var(--accent-dark); }
.alert--ok { background: var(--ok-wash); color: var(--ok); }
.alert--info { background: var(--paper-2); color: var(--ink-2); }

/* ---------- auth (login / register / mfa) ---------- */
.auth {
  min-height: calc(100dvh - 6rem);
  display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(2rem, 6vw, 6rem); align-items: center;
}
.auth-copy .wordmark { font-size: clamp(4.5rem, 13vw, 9.5rem); display: block; margin-bottom: 1.5rem; }
.auth-copy p { font-family: var(--display); font-size: clamp(1.25rem, 2.4vw, 1.7rem); line-height: 1.3;
  font-variation-settings: "opsz" 36, "SOFT" 50; max-width: 26rem; margin: 0 0 1rem; color: var(--ink-2); }
.auth-copy p em { color: var(--ink); font-style: italic; }
.auth-card {
  position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 22px;
  padding: clamp(1.5rem, 4vw, 2.5rem); box-shadow: var(--shadow);
}
/* Airmail stripe along the top edge of the card. */
.auth-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 7px; border-radius: 22px 22px 0 0;
  background: repeating-linear-gradient(-45deg, var(--accent) 0 14px, var(--card) 14px 22px, var(--ink) 22px 36px, var(--card) 36px 44px);
}
.auth-card h1 { font-family: var(--display); font-weight: 600; font-size: 1.9rem; margin: .5rem 0 1.25rem; letter-spacing: -.01em; }
.auth-switch { margin-top: 1.25rem; text-align: center; color: var(--ink-2); font-size: .95rem; }
.or { display: flex; align-items: center; gap: .75rem; margin: 1.1rem 0; color: var(--muted); font-size: .85rem; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.passkey-btn svg { width: 1.2rem; height: 1.2rem; }

.qr { display: grid; grid-template-columns: 9.5rem 1fr; gap: 1.25rem; align-items: center; margin: 1rem 0 1.5rem; }
.qr img { width: 100%; border-radius: 10px; border: 1px solid var(--line); image-rendering: pixelated; }
.secret { font-family: var(--mono); font-size: .85rem; overflow-wrap: anywhere; background: var(--paper-2); padding: .5rem .65rem; border-radius: 8px; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: .4rem 1rem; padding: 1rem 1.25rem; margin: 1rem 0;
  background: var(--paper); border: 1.5px dashed var(--line-2); border-radius: 12px; font-family: var(--mono); font-size: 1.05rem; }

/* ---------- inkast (upload slot) ---------- */
.inkast {
  position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1.25rem;
  padding: 1.5rem clamp(1.1rem, 3vw, 2rem); border-radius: 18px; cursor: pointer;
  background: var(--ink); color: var(--paper); overflow: hidden;
  transition: transform .25s var(--ease), box-shadow .25s;
}
.inkast:hover { transform: translateY(-2px); box-shadow: 0 18px 40px -20px rgba(26,25,22,.7); }
.inkast-slot {
  width: 4.25rem; height: 4.25rem; border-radius: 14px; display: grid; place-items: center;
  background: var(--accent); color: #fff; transition: transform .35s var(--ease);
}
.inkast-slot svg { width: 2rem; height: 2rem; }
.inkast h2 { margin: 0; font-family: var(--display); font-weight: 500; font-size: clamp(1.3rem, 2.6vw, 1.75rem);
  font-variation-settings: "opsz" 72, "SOFT" 80; }
.inkast p { margin: .15rem 0 0; color: color-mix(in srgb, var(--paper) 65%, transparent); font-size: .92rem; }
/* The letterbox slit: opens wide while dragging. */
.inkast::after {
  content: ""; position: absolute; left: 50%; bottom: .55rem; width: 22%; height: 5px; translate: -50% 0;
  background: rgba(242, 237, 227, .14); border-radius: 5px; box-shadow: inset 0 1px 2px rgba(0,0,0,.6);
  transition: width .35s var(--ease), background .25s;
}
.inkast.is-over { transform: scale(1.01); }
.inkast.is-over::after { width: 70%; background: var(--accent); }
.inkast.is-over .inkast-slot { transform: rotate(-8deg) scale(1.08); }
.inkast input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.inkast .btn { position: relative; z-index: 1; pointer-events: none; }
.scanner-warning { margin-top: .75rem; }

.uploads { display: grid; gap: .5rem; margin-top: 1rem; }
.upload {
  display: grid; grid-template-columns: 1fr auto; gap: .35rem 1rem; align-items: center;
  padding: .8rem 1rem; border-radius: 12px; background: var(--card); border: 1px solid var(--line);
  animation: rise .35s var(--ease) both;
}
.upload-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-state { font-size: .85rem; color: var(--ink-2); }
.upload-state.is-error { color: var(--accent-dark); }
.upload-state.is-done { color: var(--ok); }
.upload-bar { grid-column: 1 / -1; height: 3px; border-radius: 4px; background: var(--paper-2); overflow: hidden; }
.upload-bar span { display: block; height: 100%; width: 0; background: var(--ink); transition: width .2s linear; }
.upload-bar.is-scanning span { width: 100% !important; background: repeating-linear-gradient(90deg, var(--ink) 0 12px, var(--line-2) 12px 24px); background-size: 48px 100%; animation: scan 0.8s linear infinite; }

/* ---------- parcels (file list) ---------- */
.parcels { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.parcel {
  display: grid; grid-template-columns: auto 1fr auto; gap: 1rem; align-items: center;
  padding: .85rem 1rem .85rem .85rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  animation: rise .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 40ms);
  transition: border-color .15s, box-shadow .2s;
}
.parcel:hover { border-color: var(--line-2); box-shadow: 0 8px 24px -16px rgba(26,25,22,.4); }
/* The label: a luggage tag with the file extension. */
.tag {
  position: relative; width: 3.25rem; height: 2.4rem; display: grid; place-items: center;
  background: var(--paper-2); border: 1.5px solid var(--ink); border-radius: 5px 10px 10px 5px;
  font-family: var(--mono); font-size: .68rem; font-weight: 400; letter-spacing: .02em; text-transform: uppercase;
}
.tag::before { content: ""; position: absolute; left: .28rem; top: 50%; width: .3rem; height: .3rem; translate: 0 -50%;
  border-radius: 50%; border: 1.5px solid var(--ink); background: var(--card); }
.tag span { padding-left: .5rem; max-width: 100%; overflow: hidden; }
.tag--img { background: #e7d9c3; }
.tag--doc { background: #dfe3d8; }
.tag--zip { background: #e6d4cf; }
.tag--av  { background: #d9dde3; }
.parcel-name { font-weight: 600; overflow-wrap: anywhere; line-height: 1.3; }
.parcel-meta { font-size: .85rem; color: var(--muted); margin-top: .1rem; }
.parcel-meta .mono { font-family: var(--body); font-size: 1em; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.parcel-actions { display: flex; gap: .15rem; align-items: center; }
.empty {
  padding: 3rem 1.5rem; text-align: center; border: 1.5px dashed var(--line-2); border-radius: 18px; color: var(--ink-2);
}
.empty h3 { font-family: var(--display); font-weight: 500; font-size: 1.5rem; margin: 0 0 .35rem; color: var(--ink); }

/* ---------- stamps (shares) ---------- */
.stamps { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1.25rem; }
.share {
  display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: start;
  padding: 1rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  animation: rise .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 50ms);
}
.share.is-expired { opacity: .62; }
.stamp-wrap { filter: drop-shadow(0 4px 6px rgba(26,25,22,.18)); }
.stamp {
  --perf: 4px;
  width: 5.25rem; height: 6.25rem; padding: calc(var(--perf) + .3rem); display: grid; grid-template-rows: 1fr auto; text-align: center;
  background: var(--accent); color: #fff; rotate: -3deg;
  /* Perforated edge: solid centre plus a grid of round holes that only shows in the edge band,
     with hole centres placed exactly on the outer edge so each one bites a half circle. */
  -webkit-mask:
    linear-gradient(#000 0 0) center / calc(100% - 2 * var(--perf)) calc(100% - 2 * var(--perf)) no-repeat,
    radial-gradient(circle, transparent calc(var(--perf) * .62), #000 calc(var(--perf) * .62 + .5px)) calc(-1 * var(--perf)) calc(-1 * var(--perf)) / calc(2 * var(--perf)) calc(2 * var(--perf)) round;
          mask:
    linear-gradient(#000 0 0) center / calc(100% - 2 * var(--perf)) calc(100% - 2 * var(--perf)) no-repeat,
    radial-gradient(circle, transparent calc(var(--perf) * .62), #000 calc(var(--perf) * .62 + .5px)) calc(-1 * var(--perf)) calc(-1 * var(--perf)) / calc(2 * var(--perf)) calc(2 * var(--perf)) round;
}
.stamp-inner { border: 1.5px solid rgba(255,255,255,.75); display: grid; place-content: center; padding: .2rem; }
.stamp b { font-family: var(--display); font-size: 2.1rem; line-height: 1; font-weight: 700; font-variation-settings: "SOFT" 100; font-optical-sizing: auto; }
.stamp small { display: block; font-size: .62rem; line-height: 1.15; letter-spacing: .02em; }
.stamp-date { font-size: .6rem; padding-top: .3rem; opacity: .9; }
.share.is-expired .stamp { background: var(--muted); }
.stamp.is-fresh { animation: thunk .5s var(--ease) both; }
.share-file { font-weight: 600; overflow-wrap: anywhere; line-height: 1.3; }
.share-to { font-size: .92rem; color: var(--ink-2); overflow-wrap: anywhere; }
.share-meta { font-size: .82rem; color: var(--muted); margin-top: .35rem; }
.share-note { font-family: var(--display); font-style: italic; font-size: .95rem; color: var(--ink-2); margin-top: .35rem; }
.share .linkbtn { margin-top: .35rem; margin-left: -.5rem; }

/* ---------- dialog ---------- */
dialog.sheet {
  width: min(32rem, calc(100vw - 2rem)); padding: 0; border: 0; border-radius: 22px; background: var(--card); color: var(--ink);
  box-shadow: 0 30px 80px -20px rgba(26,25,22,.55);
}
dialog.sheet::backdrop { background: rgba(26,25,22,.45); backdrop-filter: blur(3px); }
dialog.sheet[open] { animation: rise .3s var(--ease) both; }
.sheet-head { position: relative; padding: 1.6rem 1.6rem .4rem; }
.sheet-head::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 7px; border-radius: 22px 22px 0 0;
  background: repeating-linear-gradient(-45deg, var(--accent) 0 14px, var(--card) 14px 22px, var(--ink) 22px 36px, var(--card) 36px 44px);
}
.sheet-head h2 { margin: .35rem 0 0; font-family: var(--display); font-weight: 600; font-size: 1.6rem; letter-spacing: -.01em; }
.sheet-head p { margin: .25rem 0 0; color: var(--ink-2); overflow-wrap: anywhere; }
.sheet-body { padding: 1rem 1.6rem 1.6rem; }
.sheet-actions { display: flex; gap: .6rem; justify-content: flex-end; flex-wrap: wrap; margin-top: .5rem; }
.sent { display: grid; grid-template-columns: auto 1fr; gap: 1.25rem; align-items: center; margin-bottom: 1rem; }
.copyline { display: flex; gap: .5rem; }
.copyline .input { font-family: var(--mono); font-size: .8rem; min-height: 2.6rem; }

/* ---------- settings & admin ---------- */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: clamp(1.1rem, 3vw, 1.75rem); margin-bottom: 1.25rem; }
.panel h2 { margin: 0 0 .25rem; font-family: var(--display); font-weight: 600; font-size: 1.35rem; }
.panel > p { margin: 0 0 1rem; color: var(--ink-2); }
.panel--danger { border-color: #e6b6a6; }
.rows { list-style: none; margin: 0 0 1rem; padding: 0; border-top: 1px solid var(--line); }
.rows li { display: flex; gap: 1rem; align-items: center; justify-content: space-between; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.rows .r-main { min-width: 0; }
.rows .r-title { font-weight: 600; overflow-wrap: anywhere; }
.rows .r-sub { font-size: .85rem; color: var(--muted); }
.pill { display: inline-block; padding: .1rem .55rem; border-radius: 99px; font-size: .75rem; font-weight: 600; background: var(--paper-2); color: var(--ink-2); vertical-align: middle; }
.pill--ok { background: var(--ok-wash); color: var(--ok); }
.pill--accent { background: var(--accent-wash); color: var(--accent-dark); }
.form-row { display: flex; gap: .75rem; flex-wrap: wrap; align-items: end; }
.form-row .field { flex: 1 1 12rem; margin: 0; }

.ledger { font-family: var(--display); font-size: clamp(1.15rem, 2.4vw, 1.45rem); line-height: 1.55; color: var(--ink-2);
  font-variation-settings: "opsz" 36; margin: 0 0 1.5rem; max-width: 46rem; }
.ledger b { color: var(--ink); font-weight: 600; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
table.users { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.users th { text-align: left; font-weight: 600; font-size: .8rem; color: var(--muted); padding: .7rem .9rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.users td { padding: .7rem .9rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.users tr:last-child td { border-bottom: 0; }
table.users .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.limit { display: grid; grid-template-columns: 1fr auto auto; gap: .6rem; align-items: center; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.limit:last-child { border-bottom: 0; }
.limit .input { min-height: 2.5rem; padding: .4rem .6rem; }

/* ---------- recipient page ---------- */
.app--recipient { min-height: 100dvh; display: grid; place-items: center; padding-top: 2rem; }
.parcel-slip {
  position: relative; width: min(36rem, 100%); background: var(--card); border-radius: 22px; box-shadow: var(--shadow);
  border: 1px solid var(--line); overflow: hidden; animation: rise .55s var(--ease) both;
}
.parcel-slip::before {
  content: ""; display: block; height: 9px;
  background: repeating-linear-gradient(-45deg, var(--accent) 0 16px, var(--card) 16px 24px, var(--ink) 24px 40px, var(--card) 40px 48px);
}
.slip-top { display: grid; grid-template-columns: 1fr auto; gap: 1.25rem; padding: 1.75rem 1.75rem 1.25rem; align-items: start; }
.slip-from { font-size: .9rem; color: var(--ink-2); }
.slip-from b { color: var(--ink); }
.slip-name { font-family: var(--display); font-weight: 600; font-size: clamp(1.5rem, 5vw, 2.25rem); line-height: 1.1;
  letter-spacing: -.015em; margin: .4rem 0 .35rem; overflow-wrap: anywhere; font-variation-settings: "opsz" 96; }
.slip-size { font-size: .95rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.slip-note { margin: 0 1.75rem 1.25rem; padding: 1rem 1.15rem; border-left: 3px solid var(--accent); background: var(--paper);
  font-family: var(--display); font-style: italic; font-size: 1.1rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.slip-foot { padding: 1.25rem 1.75rem 1.75rem; border-top: 1.5px dashed var(--line-2); display: grid; gap: .9rem; }
.slip-foot .btn { min-height: 3.4rem; font-size: 1.05rem; }
.slip-fine { font-size: .8rem; color: var(--muted); text-align: center; }
.slip-fine .mono { font-size: .72rem; overflow-wrap: anywhere; }
.recipient-mark { position: fixed; left: 1.25rem; bottom: 1rem; font-size: 1.4rem; opacity: .5; text-decoration: none; }
.dead { text-align: center; padding: 3rem 1.5rem; }
.dead .wordmark { font-size: 4rem; display: block; margin-bottom: 1.25rem; }
.dead h1 { font-family: var(--display); font-weight: 600; font-size: 2rem; margin: 0 0 .5rem; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: max(1.25rem, env(safe-area-inset-bottom)); translate: -50% calc(100% + 3rem);
  max-width: calc(100vw - 2rem); padding: .8rem 1.2rem; border-radius: 999px; background: var(--ink); color: var(--paper);
  font-weight: 550; box-shadow: var(--shadow); z-index: 50;
  visibility: hidden; transition: translate .35s var(--ease), visibility 0s .35s;
}
.toast.is-on { translate: -50% 0; visibility: visible; transition: translate .35s var(--ease); }
.toast.is-error { background: var(--accent-dark); }

/* ---------- motion ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes thunk {
  0% { transform: scale(1.6) rotate(-14deg); opacity: 0; }
  60% { transform: scale(.94) rotate(-1deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); }
}
@keyframes scan { to { background-position: 48px 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- small screens ---------- */
@media (max-width: 820px) {
  .auth { grid-template-columns: 1fr; gap: 1.5rem; min-height: auto; }
  .auth-copy .wordmark { font-size: 4.5rem; margin-bottom: .75rem; }
  .auth-copy p { font-size: 1.15rem; }
  .gauge { display: none; }
}
@media (max-width: 640px) {
  .masthead { gap: .5rem; padding: .7rem 1rem; flex-wrap: wrap; }
  .masthead .wordmark { font-size: 1.7rem; }
  .nav { order: 3; width: 100%; margin: .25rem 0 0; overflow-x: auto; }
  .nav a { flex: 1; text-align: center; }
  .inkast { grid-template-columns: auto 1fr; }
  .inkast .btn { display: none; }
  .parcel { grid-template-columns: auto 1fr; }
  .parcel-actions { grid-column: 1 / -1; justify-content: flex-end; border-top: 1px dashed var(--line); padding-top: .4rem; margin-top: -.2rem; }
  .qr { grid-template-columns: 1fr; justify-items: center; }
  .qr img { width: 11rem; }
  .slip-top { grid-template-columns: 1fr; }
  .slip-top .stamp-wrap { justify-self: start; order: -1; }
  .limit { grid-template-columns: 1fr auto; }
  .limit > :first-child { grid-column: 1 / -1; }
  .sent { grid-template-columns: 1fr; justify-items: start; }
}

.upload.is-done { border-color: var(--ok-wash); transition: opacity .6s, transform .6s var(--ease); }
.upload.is-done .upload-bar span { background: var(--ok); }
.upload.is-leaving { opacity: 0; transform: translateY(-6px); }
.auth-copy p, .page-lede, .ledger { text-wrap: pretty; }
.limit-inputs { display: flex; align-items: center; gap: .45rem; color: var(--muted); font-size: .9rem; white-space: nowrap; }
.limit-inputs .input { width: 5rem; }
.small { font-size: .88rem; }
.sent-title { margin: 0 0 .25rem; font-family: var(--display); font-weight: 600; font-size: 1.4rem; }
.sent-text { margin: 0; }
.empty--wide { grid-column: 1 / -1; }
.r-num { font-weight: 600; font-variant-numeric: tabular-nums; }
.u-name { font-weight: 600; }
.u-mail { font-size: .82rem; color: var(--muted); overflow-wrap: anywhere; }
.u-pills { display: flex; flex-wrap: wrap; gap: .3rem; }
.limit-label { font-weight: 600; }
