/* Relay. The first layout (taste-skill "framed-sheet": a tinted frame, the work on a white sheet,
   one large headline beside one panel) with softer components: pill buttons and fields, pale
   tinted tiles, 24px panel corners stepping down to 16, 12 and 10. No shadows on anything at rest. */
:root {
  --frame: #edf3f3;
  --paper: #ffffff;
  --well: #f3f7f7;
  --tint: #e2f0f2;
  --tint-hover: #d3e8eb;
  --ink: #131416;
  --muted: #555f61;
  --line: #dce4e4;
  --rule: #e9eeee;
  --control: #c4d0d1;
  --accent: #1b6c80;
  --accent-ink: #0f4552;
  --negative: #b4232b;
  --positive: #1e7b4f;
  --tile-image: #e2f0f2; --ink-image: #0f4552;
  --tile-video: #e6eefa; --ink-video: #1d3f73;
  --tile-audio: #f8efdc; --ink-audio: #6b4300;
  --tile-other: #eef1f1; --ink-other: #3a4042;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
  font: 16px/1.5 "IBM Plex Sans", system-ui, sans-serif;
  color: var(--ink);
  background: var(--frame);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100svh; display: flex; flex-direction: column; background: var(--frame); }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
h1, h2, h3, p { margin: 0; }
.sub { color: var(--muted); font-size: 15px; }

/* Frame */
.bar { height: 60px; flex: none; display: flex; align-items: center; justify-content: space-between; padding-inline: 30px; }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-size: 21px; font-weight: 600; letter-spacing: -.01em; }
.brand-mark { width: 30px; height: 30px; padding: 6px; border-radius: 10px; background: var(--accent); fill: #fff; stroke: none; }
.nav { display: flex; gap: 4px; }
.nav a { padding: 8px 14px; border-radius: 999px; color: var(--muted); text-decoration: none; font-weight: 500; font-size: 15px; transition: background-color .15s, color .15s; }
.nav a:hover { background: var(--paper); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--paper); color: var(--ink); }
.sheet {
  flex: 1; margin: 0 8px; border: 1px solid var(--line); border-radius: 24px; background: var(--paper);
  display: grid; place-items: center; padding: 56px 30px;
}
.layout { width: min(100%, 960px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); align-items: center; gap: clamp(32px, 7vw, 96px); }
.foot-bar { flex: none; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 12px 30px 14px; font-size: 13px; color: var(--muted); }
.foot-bar a { color: var(--muted); }

/* Intro */
h1 { font-size: clamp(48px, 7vw, 88px); font-weight: 600; line-height: .98; letter-spacing: -.06em; }
.intro p { color: var(--muted); max-width: 34ch; font-size: 18px; margin-top: 24px; }
.route { display: flex; align-items: center; width: min(100%, 250px); margin-top: 42px; }
.route span { width: 12px; height: 12px; flex: none; border: 2px solid var(--accent); border-radius: 50%; background: var(--paper); transition: background-color .3s; }
.route span.on { background: var(--accent); }
.route i { position: relative; flex: 1; border-top: 2px dashed #9db6ba; }
.route b { position: absolute; left: 0; top: -2px; height: 2px; width: 0; background: var(--accent); transition: width .25s linear; }

/* Panel */
.panel { border: 1px solid var(--line); border-radius: 24px; min-width: 0; background: var(--paper); display: flex; flex-direction: column; }
.view { display: flex; flex-direction: column; animation: rise .3s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.scroll { padding: 20px 20px 4px; }
.foot { padding: 12px 20px 20px; }
.view-center { align-items: center; text-align: center; padding: 32px 24px; gap: 8px; }
h2 { font-size: 24px; line-height: 1.2; font-weight: 600; letter-spacing: -.02em; overflow-wrap: anywhere; }

/* Add tiles */
.adders { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.adder {
  display: grid; justify-items: center; align-content: center; gap: 10px; min-height: 132px; padding: 16px 8px;
  border: 1px dashed #9db6ba; border-radius: 16px; background: var(--well); color: var(--ink); font-weight: 500;
  transition: background-color .15s, border-color .15s, transform .15s var(--ease);
}
.adder:hover { background: var(--tint); border-color: var(--accent); }
.adder:active { transform: scale(.98); }
.adder-disc, .adder-folder { position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #fff; }
.adder-disc svg { width: 22px; height: 22px; stroke-width: 2; }
.adder-folder svg { width: 21px; height: 21px; }
.adder-badge { display: none; }
.adders.compact .adder { min-height: 0; grid-auto-flow: column; justify-content: center; gap: 10px; padding: 10px; }
.adders.compact .adder-disc, .adders.compact .adder-folder { width: 28px; height: 28px; }
.adders.compact .adder svg { width: 16px; height: 16px; }
.hint { margin: 10px 4px 0; text-align: center; color: var(--muted); font-size: 14px; }

/* Rows */
.items { margin-top: 16px; }
.items-head { display: flex; justify-content: space-between; align-items: baseline; padding: 0 4px; font-weight: 600; }
.text-button { border: 0; background: none; padding: 4px 2px; color: var(--accent); font-weight: 500; font-size: 14px; }
.text-button:hover { color: var(--accent-ink); text-decoration: underline; }
.meter { height: 6px; margin: 10px 4px 6px; border-radius: 3px; background: var(--rule); overflow: hidden; }
.meter span { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--accent); transition: width .3s var(--ease); }
.meter.over span { background: var(--negative); }
.meter-label { padding: 0 4px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.meter-label.over { color: var(--negative); }
.rows { list-style: none; margin: 8px 0 0; padding: 0; }
#item-list { max-height: 260px; overflow-y: auto; }
.row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 4px; }
.row + .row { border-top: 1px solid var(--rule); }
.row-body { flex: 1; min-width: 0; }
.row-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; font-size: 15px; }
.row-meta { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile { display: grid; place-items: center; width: 40px; height: 40px; flex: none; overflow: hidden; border-radius: 10px; background: var(--tile-other); color: var(--ink-other); font-size: 12px; font-weight: 600; }
.tile[data-kind="image"], .tile[data-kind="link"] { background: var(--tile-image); color: var(--ink-image); }
.tile[data-kind="video"] { background: var(--tile-video); color: var(--ink-video); }
.tile[data-kind="audio"] { background: var(--tile-audio); color: var(--ink-audio); }
.tile img { width: 100%; height: 100%; object-fit: cover; }
.tile svg { width: 18px; height: 18px; }
.icon-button { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border: 0; border-radius: 50%; background: transparent; color: var(--muted); transition: background-color .15s, color .15s; }
.icon-button:hover { background: var(--well); color: var(--ink); }
.icon-button.danger:hover { color: var(--negative); }

/* Fields */
.fields { display: grid; gap: 8px; margin-top: 16px; }
.field { display: flex; align-items: center; border: 1px solid var(--control); border-radius: 14px; background: var(--paper); transition: border-color .15s; }
.field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--tint); }
.field input, .field textarea { flex: 1; min-width: 0; border: 0; outline: 0; background: none; padding: 11px 14px; resize: none; border-radius: 14px; }
.field textarea { min-height: 108px; max-height: 360px; resize: vertical; line-height: 1.5; }
.field:has(textarea) { align-items: stretch; }
.field .icon-button { margin-right: 4px; }
.field input::placeholder, .field textarea::placeholder { color: #6d7779; }
.chips { list-style: none; margin: 0; padding: 0; }

/* Email fields */
.email-fields { display: grid; gap: 8px; }
.field-to { flex-wrap: wrap; gap: 6px; padding: 6px 8px; min-height: 46px; }
.field-to input { padding: 5px 6px; min-width: 140px; }
.to-list { display: contents; list-style: none; margin: 0; padding: 0; }
.to-chip { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; padding: 3px 4px 3px 12px; border-radius: 999px; background: var(--tint); color: var(--accent-ink); font-size: 14px; font-weight: 500; }
.to-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.to-chip button { display: grid; place-items: center; width: 24px; height: 24px; border: 0; border-radius: 50%; background: none; color: inherit; }
.to-chip button:hover { background: var(--tint-hover); }
.to-chip svg { width: 14px; height: 14px; }
.to-chip.bad { background: #ffedea; color: #831c1e; }
.to-count { padding-right: 8px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.code { width: 100%; margin-top: 8px; padding: 12px 16px; border: 1px solid var(--control); border-radius: 14px; outline: 0; font-size: 28px; font-weight: 500; letter-spacing: .3em; font-variant-numeric: tabular-nums; }
.code:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--tint); }
.verify-links { display: flex; justify-content: space-between; margin-top: 12px; }

/* Foot */
.foot-row { display: flex; gap: 8px; margin-bottom: 10px; }
.expiry-wrap { position: relative; flex: 1; }
.expiry {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 48px; padding: 0 16px;
  border: 1px solid var(--control); border-radius: 999px; background: var(--paper); font-weight: 500; text-align: left;
  transition: border-color .15s, background-color .15s;
}
.expiry:hover, .round-button:hover { border-color: #9db6ba; }
.expiry[aria-expanded="true"] { background: var(--well); border-color: var(--accent); }
.expiry #expiry-label { flex: 1; }
.expiry .chevron { transition: transform .2s var(--ease); }
.expiry[aria-expanded="true"] .chevron { transform: rotate(180deg); }
/* The menu floats above the form, so it is the one control with a shadow. */
.menu {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 8px); z-index: 4; margin: 0; padding: 6px; list-style: none;
  background: var(--paper); border: 1px solid var(--line); border-radius: 18px; outline: 0;
  box-shadow: 0 12px 32px rgba(15, 69, 82, .14), 0 2px 6px rgba(15, 69, 82, .06);
  transform-origin: bottom center; animation: pop .16s var(--ease);
}
@keyframes pop { from { opacity: 0; transform: translateY(4px) scale(.98); } }
.menu li { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; column-gap: 12px; align-items: center; padding: 9px 12px; border-radius: 12px; cursor: pointer; }
.menu li + li { margin-top: 2px; }
.menu-main { font-weight: 500; }
.menu-hint { grid-column: 1; color: var(--muted); font-size: 13px; }
.menu-check { grid-column: 2; grid-row: 1 / 3; width: 18px; height: 18px; color: var(--accent); stroke-width: 2.2; visibility: hidden; }
.menu li[aria-selected="true"] { background: var(--tint); }
.menu li[aria-selected="true"] .menu-main { color: var(--accent-ink); font-weight: 600; }
.menu li[aria-selected="true"] .menu-check { visibility: visible; }
.menu li.active:not([aria-selected="true"]), .menu li:hover:not([aria-selected="true"]) { background: var(--well); }
.menu:focus-visible li.active { outline: 2px solid var(--accent); outline-offset: -2px; }
.round-button { position: relative; display: flex; align-items: center; gap: 6px; height: 48px; padding: 0 18px; border: 1px solid var(--control); border-radius: 999px; background: var(--paper); font-weight: 500; transition: border-color .15s, background-color .15s; }
.round-button[aria-expanded="true"] { background: var(--well); }
.round-button .dot { position: absolute; top: 9px; right: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.primary {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 52px; padding: 12px 22px;
  border: 0; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 600; text-decoration: none;
  transition: background-color .15s, transform .15s var(--ease);
}
.primary:hover { background: #303537; }
.primary:active { transform: scale(.985); }
.primary:disabled { background: #8a9294; cursor: wait; transform: none; }
.primary .arrow { font-size: 18px; }
.secondary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 20px; border: 1px solid var(--control); border-radius: 999px; background: var(--paper); color: var(--ink); font-weight: 500; text-decoration: none; transition: background-color .15s, border-color .15s; }
.secondary:hover { background: var(--well); border-color: #9db6ba; }
.status { color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.status:empty { display: none; }
.status.error { color: var(--negative); }
.options { padding: 0 2px 14px; }
.option-label { display: block; font-weight: 500; }
.option-help { color: var(--muted); font-size: 13px; margin: 2px 0 8px; }
.password { display: flex; align-items: center; gap: 4px; padding-left: 14px; border: 1px solid var(--control); border-radius: 14px; }
.password:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--tint); }
.password input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; padding: 11px 0; }

/* Progress */
.ring { position: relative; width: 168px; height: 168px; margin-bottom: 12px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); stroke-linecap: round; }
.ring-track { stroke: var(--tint); stroke-width: 9; }
.ring-fill { stroke: var(--accent); stroke-width: 9; stroke-dasharray: 326.73; stroke-dashoffset: 326.73; transition: stroke-dashoffset .25s linear; }
.ring-value { position: absolute; inset: 0; display: grid; place-content: center; grid-auto-flow: column; align-items: baseline; font-size: 40px; font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.ring-unit { font-size: 20px; color: var(--muted); margin-left: 2px; }
#progress-detail { font-variant-numeric: tabular-nums; margin-bottom: 18px; }

/* Done */
.done-head { display: grid; justify-items: start; gap: 6px; margin: 2px 0 20px; }
.done-check, .unlock-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--tint); color: var(--accent); margin-bottom: 6px; }
.done-check svg { width: 24px; height: 24px; stroke-width: 2.2; }
.joined { display: flex; border: 1px solid var(--control); border-radius: 999px; overflow: hidden; }
.joined input { flex: 1; min-width: 0; border: 0; outline: 0; padding: 12px 6px 12px 18px; font: 13px "IBM Plex Mono", ui-monospace, monospace; background: none; }
.joined-button { display: flex; align-items: center; gap: 6px; border: 0; padding: 0 18px; background: var(--tint); color: var(--accent-ink); font-weight: 600; transition: background-color .15s; }
.joined-button:hover { background: var(--tint-hover); }
.pair { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; margin-top: 10px; }
.note { margin-top: 16px; color: var(--muted); font-size: 14px; }

/* Receive */
.receive-head { display: grid; gap: 4px; margin: 2px 0 14px; }
.message { background: var(--well); border-radius: 14px; padding: 12px 14px; white-space: pre-wrap; overflow-wrap: anywhere; margin-bottom: 12px; font-size: 15px; }
.thumbs { display: grid; grid-template-columns: repeat(var(--cols, 3), 1fr); gap: 6px; margin-bottom: 8px; }
.thumbs a { display: block; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background: var(--tint); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s var(--ease); }
.thumbs a:hover img { transform: scale(1.04); }
#receive-list, #receive-links { max-height: 300px; overflow-y: auto; }
.unlock { display: grid; gap: 8px; margin-top: 8px; }
.unlock label { font-weight: 500; }
.unlock input { border: 1px solid var(--control); border-radius: 14px; padding: 11px 14px; outline: 0; }
.unlock input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--tint); }
.missing { display: grid; justify-items: start; gap: 18px; padding-bottom: 16px; }
.skeleton { display: block; height: 14px; border-radius: 7px; background: var(--rule); }

/* Sent and About */
.sent .row { align-items: flex-start; }
.sent .row-actions { display: flex; gap: 2px; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--tile-other); color: var(--ink-other); }
.pill.live { background: #dcfae5; color: #04250e; }
.empty { display: grid; justify-items: start; gap: 14px; margin: 16px 0; color: var(--muted); }
#view-sent .sub, #view-sent h2 { margin-bottom: 4px; }
#sent-list { max-height: 420px; overflow-y: auto; }
.prose { padding-bottom: 20px; }
.prose h2 { margin-bottom: 10px; }
.prose h3 { font-size: 16px; font-weight: 600; margin: 18px 0 6px; }
.prose p, .prose li { font-size: 15px; line-height: 1.6; }
.prose ul { padding-left: 20px; margin: 0; }
.prose li + li { margin-top: 4px; }
.fine { margin-top: 18px; color: var(--muted); font-size: 13px !important; }

/* Drop overlay and toast */
.dropzone { position: fixed; inset: 0; z-index: 5; display: grid; place-items: center; background: rgba(27, 108, 128, .18); pointer-events: none; }
.dropzone p { padding: 14px 26px; border-radius: 999px; background: var(--paper); color: var(--accent); font-weight: 600; font-size: 20px; box-shadow: 0 12px 40px rgba(15, 69, 82, .2); }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 6; transform: translateX(-50%); padding: 10px 18px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 14px; font-weight: 500; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); animation: rise .2s var(--ease); }
.noscript { padding: 16px; text-align: center; }

@media (max-width: 900px) {
  .bar { padding-inline: 16px; }
  .nav a { padding: 8px 10px; }
  .sheet { display: block; margin: 0; padding: 32px 16px; border-radius: 24px 24px 0 0; border-inline: 0; border-bottom: 0; }
  .layout { grid-template-columns: minmax(0, 1fr); gap: 28px; max-width: 560px; margin: 0 auto; }
  h1 { font-size: 48px; }
  .intro p { margin-top: 14px; font-size: 17px; }
  .route { margin-top: 22px; width: 160px; }
  .scroll { padding: 16px 16px 4px; }
  .foot { padding: 12px 16px 16px; }
  .foot-bar { padding-inline: 16px; background: var(--paper); }
  .adder { min-height: 112px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
