:root {
  color-scheme: light;
  --canvas: #f4f9fc;
  --panel: #ffffff;
  --raised: #edf4f8;
  --field: #f8fbfd;
  --line: #d4e2ea;
  --text: #172e40;
  --muted: #50697a;
  --blue: #006a9e;
  --blue-button: #0076ad;
  --blue-brand: #0097d6;
  --control-line: #80929e;
  --blue-soft: #e0f4ff;
  --radius: 16px;
  font: 16px/1.55 Inter, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--text); background: var(--canvas); }
[hidden] { display: none !important; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
a, button, input, select { transition: background-color 180ms ease-out, color 180ms ease-out, border-color 180ms ease-out; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }
h1, h2, h3, p, dl, dd { margin: 0; }
h1 { font-size: clamp(32px, 4vw, 48px); line-height: 1.3; letter-spacing: -.045em; }
h2 { font-size: 21px; line-height: 1.45; }
h3 { font-size: 17px; }
h1, h2, h3, strong { font-weight: 650; }
p { overflow-wrap: anywhere; }
.lead { color: var(--muted); max-width: 65ch; margin-top: 12px; }
.muted, small, dt { color: var(--muted); }
small { display: block; font-size: 13px; font-weight: 400; }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.site-header { background: var(--panel); border-bottom: 1px solid var(--line); }
.header-inner, main { width: min(1152px, calc(100% - 80px)); margin-inline: auto; }
.header-inner { min-height: 80px; display: flex; gap: 32px; align-items: center; }
.brand, .identity, .main-nav a, .button, button, .text-link, .privacy-note, .project-name, .account-head { display: inline-flex; align-items: center; }
.brand { gap: 12px; font-size: 18px; font-weight: 700; color: var(--text); white-space: nowrap; }
.brand-mark, .tile, .avatar { display: inline-grid; place-items: center; flex: none; }
.brand-mark { width: 36px; height: 36px; border-radius: 12px; color: white; background: var(--blue-brand); }
.brand-mark .icon { width: 23px; height: 23px; stroke-width: 2; transform: rotate(-8deg); }
.main-nav, .tabs, .actions, .pager, .inline, .row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.main-nav { margin-inline: auto; gap: 4px; }
.main-nav a { min-height: 44px; padding: 0 12px; gap: 8px; color: var(--muted); border-radius: 8px; font-size: 14px; white-space: nowrap; }
.main-nav .icon { width: 16px; height: 16px; }
.main-nav a:hover, .tabs a:hover { color: var(--text); background: var(--raised); }
.main-nav [aria-current="page"], .tabs [aria-current="page"] { color: var(--blue); background: var(--blue-soft); }
.brand:hover, .main-nav a:hover, .identity:hover, .tabs a:hover, .button:hover { text-decoration: none; }
.identity { color: var(--muted); gap: 8px; min-width: 0; font-size: 14px; }
.identity > :last-child { max-width: 12ch; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 32px; height: 32px; border-radius: 50%; color: var(--blue); background: var(--blue-soft); font-weight: 700; }
main { margin-block: 48px 80px; }
.surface, .admin section, .admin .cards article { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 32px; min-width: 0; }
.page-heading, .section-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.page-heading { margin-bottom: 32px; }
.section-heading { margin-bottom: 24px; }
label { display: grid; gap: 8px; font-size: 14px; }
input, select, button, .button { font: inherit; border: 1px solid var(--line); border-radius: 8px; }
input, select { width: 100%; min-width: 0; min-height: 44px; padding: 8px 12px; color: var(--text); background: var(--field); border-color: var(--control-line); }
input::placeholder { color: #5d7180; }
input:focus, select:focus { border-color: var(--blue); }
input[type="checkbox"] { width: 16px; min-height: 0; height: 16px; accent-color: var(--blue); }
button, .button { justify-content: center; gap: 8px; min-height: 44px; padding: 8px 16px; background: var(--raised); color: var(--text); font-size: 14px; font-weight: 600; cursor: pointer; overflow-wrap: anywhere; }
button:hover, .button:hover { background: #dfeaf1; border-color: #849aa9; }
button.primary { color: white; background: var(--blue-button); border-color: transparent; }
button.primary:hover { background: #006493; }
button:disabled { opacity: .55; cursor: wait; }
.text-link { gap: 8px; font-size: 14px; font-weight: 600; min-height: 44px; }
.text-link .icon, button .icon, .button .icon { width: 16px; height: 16px; }

.auth-layout, .receive-hero { overflow: hidden; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--panel); border: 1px solid var(--line); border-radius: 24px; }
.auth-layout { max-width: 1000px; margin: clamp(40px, 9vh, 112px) auto; }
.auth { padding: clamp(32px, 5vw, 72px); align-self: center; }
.auth form { margin-top: 32px; display: grid; gap: 20px; }
.auth input { min-height: 48px; }
.auth button { margin-top: 4px; min-height: 48px; }
.auth-switch { margin-top: 24px; font-size: 14px; color: var(--muted); }
.auth-switch a { font-weight: 600; }
.receive-hero { grid-template-columns: minmax(0, 1.6fr) minmax(240px, 1fr); }
.hero-copy { align-self: center; padding: clamp(28px, 4.5vw, 64px); }
.search-form { display: flex; gap: 8px; max-width: 560px; margin-bottom: 24px; }
.hero-copy .search-form { margin: 28px 0 0; }
.search-form label { display: flex; align-items: center; gap: 8px; background: var(--field); border: 1px solid var(--control-line); border-radius: 8px; padding-left: 16px; flex: 1; min-width: 0; color: var(--muted); }
.search-form label:focus-within { outline: 2px solid var(--blue); outline-offset: 2px; }
.search-form input { border: 0; background: transparent; outline: none; padding-left: 0; }
.search-form button { flex: none; padding-inline: 24px; }
.privacy-note { color: var(--muted); gap: 8px; margin: 16px 0 32px; font-size: 14px; }
.privacy-note .icon { width: 16px; height: 16px; }

/* A paper envelope, postage stamp and cancellation mark on a blue postal grid. */
.postal-art { display: grid; place-items: center; position: relative; isolation: isolate; overflow: hidden; min-height: 240px; background-color: #c6ecff; background-image: radial-gradient(#91c9e3 1px, transparent 1px); background-size: 16px 16px; }
.orbit, .orbit::before { position: absolute; aspect-ratio: 1; border: 1px solid #9cd3eb; border-radius: 50%; }
.orbit { width: 108%; }
.orbit::before { content: ""; inset: 9%; }
.letter { position: relative; width: min(68%, 320px); aspect-ratio: 1.6; transform: rotate(-10deg); background: #fffefa; border-radius: 8px; box-shadow: -8px 10px 0 #98cbe0; }
.letter::before { content: ""; position: absolute; inset: 0 0 auto; height: 8px; border-radius: 8px 8px 0 0; background: repeating-linear-gradient(130deg, #1d95cc 0 12px, #eef7fa 12px 24px, #d75755 24px 36px, #eef7fa 36px 48px); }
.letter-face { position: absolute; inset: 17% 6% 10%; border-bottom: 1px solid #a8bfc9; }
.letter-stamp { position: absolute; right: 8%; top: 17%; width: 24%; aspect-ratio: .92; display: grid; place-items: center; background: #107eb1; color: #f3fbff; outline: 3px dotted #fffefa; outline-offset: -2px; }
.letter-stamp::before { content: ""; position: absolute; inset: 12%; border: 1px solid #93d0eb; }
.letter-stamp .icon { width: 48%; height: auto; transform: rotate(-9deg); }
.postmark { position: absolute; right: 22%; top: 28%; width: 24%; aspect-ratio: 1; border: 3px double #53717f; border-radius: 50%; transform: rotate(5deg); }
.postmark::after { content: ""; position: absolute; top: 42%; right: 70%; width: 90%; height: 20%; border-block: 1px solid #68848f; transform: rotate(-9deg); }
.address-lines { position: absolute; left: 8%; bottom: 24%; width: 31%; height: 8%; border-block: 2px solid #8ba6b3; }

.project-row, .row { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); gap: 16px; padding: 16px 0; }
.project-row:last-child { padding-bottom: 0; }
.project-name { gap: 16px; min-width: 0; overflow-wrap: anywhere; }
.tile { width: 40px; height: 40px; border-radius: 12px; color: var(--blue); background: var(--blue-soft); }
.take { color: var(--blue); background: var(--blue-soft); border-color: transparent; }
.take:hover { background: #c8eafb; border-color: transparent; }
.empty { text-align: center; padding: 24px 16px 32px; }
.empty .tile { width: 48px; height: 48px; margin-bottom: 16px; }
.empty h2, .empty h3 { font-size: 17px; }
.empty p { color: var(--muted); margin-top: 8px; font-size: 14px; }
.empty form, .empty .text-link { margin-top: 16px; }
.pager { justify-content: flex-end; }
.pager:not(:empty) { margin-block: 16px; }
.session { margin-bottom: 24px; scroll-margin-top: 16px; }
.session .section-heading { margin-bottom: 16px; }
.session .mailbox { font: 600 clamp(18px, 2.8vw, 30px)/1.5 ui-monospace, monospace; }
#cancel-controls { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; margin-top: 24px; }
#cancel-controls label { display: inline-flex; align-items: center; gap: 8px; }
#message-body { border-top: 1px solid var(--line); padding-top: 20px; margin-top: 20px; }
#message-body h3 { overflow-wrap: anywhere; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; padding: 16px; border-radius: 8px; background: var(--field); }
pre:empty { display: none; }
.profile-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; }
.account-head { gap: 16px; }
.account-head .avatar { width: 48px; height: 48px; font-size: 20px; }
.quota { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; border-top: 1px solid var(--line); margin-top: 24px; padding-top: 24px; }
dt { font-size: 14px; }
dd { font-size: 28px; font-weight: 650; font-variant-numeric: tabular-nums; }
.key-panel h2 { margin-top: 16px; }
.key-panel p { margin: 8px 0 24px; }
.history-panel { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 12px 8px; }
th { color: var(--muted); font-weight: 500; }
td { border-top: 1px solid var(--line); overflow-wrap: anywhere; }
time { font-variant-numeric: tabular-nums; color: var(--muted); }
.status { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.status::before { content: ""; width: 8px; height: 8px; background: currentColor; border-radius: 50%; flex: none; }
[data-state="success"] { color: #16704b; }
[data-state="waiting"] { color: var(--blue); }
[data-state="timeout"], .notice { color: #815005; }
[data-state="failed"], .alert, #feedback[data-kind="error"] { color: #aa3039; }
#feedback { position: sticky; top: 8px; z-index: 3; background: var(--raised); border: 1px solid var(--line); padding: 12px 16px; margin-bottom: 16px; border-radius: 8px; }
#feedback[data-kind="success"] { color: #16704b; }
.admin section, .admin .cards { margin-block: 16px; overflow: auto; }
.admin h1 { margin-block: 24px; font-size: 32px; }
.admin section h2 { margin-bottom: 16px; }
.admin section p + p { margin-top: 8px; }
.tabs { border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.tabs a { padding: 8px 12px; color: var(--muted); border-radius: 8px; }
.inline { margin-block: 12px; }
.inline input, .inline select { width: auto; max-width: 100%; }
.fields, .cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(192px, 100%), 1fr)); gap: 16px; }
.fields { margin-bottom: 16px; }
.cards strong { font-size: 28px; }
.admin .alert { padding: 12px; }
meter { accent-color: var(--blue); }

@media (max-width: 960px) {
  .header-inner, main { width: calc(100% - 48px); }
  .header-inner { gap: 16px; }
  .main-nav a { padding-inline: 8px; }
  .identity > :last-child { display: none; }
}
@media (max-width: 760px) {
  .header-inner { min-height: 64px; padding-block: 12px; flex-wrap: wrap; gap: 8px; }
  .identity { margin-left: auto; }
  .main-nav { flex: 1 0 100%; margin: 0; order: 1; }
  .main-nav a { justify-content: center; }
  main { margin-top: 32px; }
  .auth-layout { grid-template-columns: 1fr; max-width: 480px; margin: 32px auto; }
  .auth-layout .postal-art { order: -1; min-height: 144px; }
  .auth-layout .letter { width: 152px; }
  .auth { padding: 32px; }
  .receive-hero { grid-template-columns: minmax(0, 1.6fr) minmax(150px, 1fr); }
  .hero-copy { padding: 24px; }
  .profile-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .header-inner, main { width: calc(100% - 32px); }
  .main-nav { gap: 4px; }
  .main-nav a { flex: 1 1 auto; font-size: 13px; padding-inline: 8px; gap: 4px; }
  .main-nav .icon { display: none; }
  .surface, .admin section, .auth { padding: 24px; }
  .receive-hero { grid-template-columns: 1fr; }
  .receive-hero .postal-art { display: none; }
  .search-form button { padding-inline: 16px; }
  .section-heading { gap: 8px; margin-bottom: 16px; }
  .project-row { flex-wrap: wrap; }
  .project-name { gap: 8px; }
  .project-row .actions { margin-left: auto; }
  .history-table, .history-table tbody { display: block; }
  .history-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .history-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; align-items: center; padding-block: 16px; }
  .history-table tr + tr { border-top: 1px solid var(--line); }
  .history-table td { padding: 0; border: 0; }
  .history-table td:first-child { grid-column: 1 / -1; }
  .history-table td:nth-child(3) { grid-column: 1; }
  .history-table td:last-child { grid-row: 2 / 4; grid-column: 2; text-align: right; }
  .history-table td form { margin-top: 8px; }
  .history-panel:has(table) { padding-block: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
#remaining { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
