:root {
  --bg: #fff;
  --ink: #141414;
  --text: #3c3c3c;
  --muted: #6d6d6d;
  --line: #e6e6e6;
  --surface: #f3f3f3;
  color-scheme: light;
}

* { box-sizing: border-box; }

/* Inter is one file on every computer, with optical sizes, so a Mac and a Windows machine draw the same face. */
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/inter-cyrillic-ext.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/inter-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/inter-greek-ext.woff2") format("woff2");
  unicode-range: U+1F00-1FFF;
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/inter-greek.woff2") format("woff2");
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/inter-vietnamese.woff2") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 16.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* Without this, body's overflow moves to the viewport, which still pans sideways on mobile. */
html { overflow-x: clip; }

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: none;
  margin: 0;
  padding: 0;
  overflow-x: clip;
}

main { flex: 1 0 auto; }

.brand {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
}

.flag {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.bar {
  position: sticky;
  top: 0;
  z-index: 4;
  border-bottom: 1px solid transparent;
  background: #fff;
}

.bar.over { border-bottom-color: var(--line); }

.bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  width: min(46rem, calc(100% - 4rem));
  min-height: 4.25rem;
  margin: 0 auto;
}

main {
  width: min(46rem, calc(100% - 4rem));
  margin: 0 auto;
  padding-top: 3.5rem;
}

.home main { padding-top: 4.75rem; }

.word {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink);
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: -0.04em;
  text-decoration: none;
}

.mark {
  flex: none;
  width: 1.05rem;
  height: 1.05rem;
  fill: currentColor;
}

.mark .lost { opacity: 0.25; transition: opacity 0.3s ease; }

.word:hover .mark .lost { opacity: 1; }

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.nav-toggle svg { width: 1.05rem; height: 1.05rem; }

.nav-toggle .close { display: none; }

.nav-toggle[aria-expanded="true"] .bars { display: none; }

.nav-toggle[aria-expanded="true"] .close { display: block; }

.nav-toggle:hover { background: rgba(20, 20, 20, 0.06); }

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem 1.35rem;
}

.nav a {
  color: var(--muted);
  font-size: 0.92rem;
  text-decoration: none;
}

.nav a:hover,
.nav a[aria-current="page"] { color: var(--ink); }

.foot {
  margin-top: 4rem;
  border-top: 1px solid var(--line);
}

.foot-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(46rem, calc(100% - 4rem));
  margin: 0 auto;
  padding: 1.15rem 0;
}

body.docs .foot-inner { width: min(82rem, calc(100% - 4rem)); }

.foot p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.foot nav {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}

.foot nav a {
  color: var(--muted);
  font-size: 0.82rem;
  text-decoration: none;
}

.foot nav a:hover { color: var(--ink); }

.foot-github {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 8px;
}

.foot-github:hover { background: rgba(20, 20, 20, 0.06); }

.foot-status-wrap { position: relative; }

.foot-status-wrap[hidden] { display: none; }

.foot-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 -0.5rem;
  padding: 0.3rem 0.5rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  white-space: nowrap;
  cursor: pointer;
}

.foot-status:hover,
.foot-status[aria-expanded="true"] {
  background: rgba(20, 20, 20, 0.05);
  color: var(--ink);
}

.net-pop {
  position: absolute;
  right: -0.5rem;
  bottom: calc(100% + 0.6rem);
  z-index: 5;
  width: 16rem;
  padding: 0.85rem 0.95rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 40px -18px rgba(20, 20, 20, 0.28);
  transform-origin: bottom right;
  animation: net-pop 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.net-pop[hidden] { display: none; }

@keyframes net-pop {
  from { opacity: 0; transform: translateY(0.45rem) scale(0.96); }
}

.net-pop dl {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.45rem 1rem;
  margin: 0;
  font-size: 0.85rem;
}

.net-pop dt { color: var(--muted); }

.net-pop dd {
  margin: 0;
  color: var(--ink);
  font-weight: 500;
  text-align: right;
}

.foot .net-pop-foot {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.75rem 0 0;
  padding-top: 0.65rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
}

.foot nav .net-pop-foot a {
  margin-left: auto;
  color: var(--ink);
  font-size: 0.78rem;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}

.pulse {
  position: relative;
  flex: none;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: #b5b5b5;
}

.foot-status.up .pulse { background: #1f9d55; }

.pending-wait .pulse { background: #e0a800; }

.foot-status.up .pulse::after,
.pending-wait .pulse::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: inherit;
  animation: ping 2s ease-out infinite;
}

@keyframes ping {
  from { opacity: 0.6; transform: scale(1); }
  70%, to { opacity: 0; transform: scale(2.6); }
}

.foot-github svg { width: 1.05rem; height: 1.05rem; }

h1 {
  margin: 0 0 1.6rem;
  font-size: 1.85rem;
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.lead {
  margin: 0;
  max-width: 40rem;
  font-size: 1.12rem;
  font-weight: 500;
  letter-spacing: -0.012em;
  line-height: 1.55;
  color: var(--ink);
}

.copy p {
  margin: 0 0 1.35rem;
  color: var(--text);
}

.copy p:last-child { margin-bottom: 0; }

.btn,
a.plain,
.transfer button.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.5rem;
  padding: 0 1.05rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-size: 0.95rem;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}

.copy p:has(.btn),
.copy p:has(.plain) {
  margin-top: 2rem;
  margin-bottom: 0;
}

.btn,
a.plain { margin-top: 0; }

.btn:hover,
.transfer button.primary:hover { background: #2c2c2c; }

a.plain {
  border-color: #d5d5d5;
  background: #fff;
  color: var(--ink);
}

a.plain:hover { background: #f3f3f3; }

.copy p:has(.btn) {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.copy a:not(.btn):not(.plain) { color: var(--ink); }

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 2.25rem 0 2.75rem;
  padding: 1.35rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stats > div { position: relative; min-width: 0; padding-right: 1rem; }

.stats .label.tip { width: fit-content; }

.stats > div + div {
  padding-left: 1.35rem;
  border-left: 1px solid var(--line);
}

.caption {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.12rem 0.4rem;
  margin: 0.3rem 0 0;
}

.caption .label { margin: 0; }

.value {
  margin: 0;
  font-size: 1.85rem;
  font-weight: 600;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
}

.delta {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.delta svg {
  width: 0.72rem;
  height: 0.72rem;
  display: inline-block;
  vertical-align: middle;
  margin-right: 0.15rem;
}

.delta.flat svg { width: 1rem; margin-right: 0; }

.delta.up { color: #137a3a; }

.delta.down { color: #c2342a; }

.label {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.doc code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88em;
}

body.docs .bar-inner,
body.docs main.doc {
  width: min(82rem, calc(100% - 4rem));
}

body.docs main.doc {
  display: grid;
  grid-template-columns: 14.5rem minmax(0, 1fr) 12.5rem;
  column-gap: 3.5rem;
  align-items: start;
  padding-top: 0;
}

.doc-side,
.doc-toc {
  position: sticky;
  top: calc(4.25rem + 1px);
  max-height: calc(100vh - 4.25rem - 1px);
  overflow-y: auto;
  padding: 2.25rem 0 2rem;
}

@property --fade-top { syntax: "<length>"; inherits: false; initial-value: 0px; }

@property --fade-bottom { syntax: "<length>"; inherits: false; initial-value: 0px; }

.doc-side {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.doc-side > .doc-find { flex: none; }

.doc-side .doc-pages {
  --fade: linear-gradient(
    to bottom,
    transparent,
    rgb(0 0 0 / 0.5) calc(var(--fade-top) * 0.5),
    #000 var(--fade-top),
    #000 calc(100% - var(--fade-bottom)),
    rgb(0 0 0 / 0.5) calc(100% - var(--fade-bottom) * 0.5),
    transparent
  );
  min-height: 0;
  overflow-y: auto;
  -webkit-mask-image: var(--fade);
  mask-image: var(--fade);
  transition: --fade-top 0.2s ease, --fade-bottom 0.2s ease;
}

.doc-pages.fade-top { --fade-top: 3.5rem; }

.doc-pages.fade-bottom { --fade-bottom: 4.5rem; }

.doc-find {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  height: 2.3rem;
  margin: 0 0 1.4rem;
  padding: 0 0.5rem 0 0.7rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--muted);
  font: inherit;
  font-size: 0.88rem;
  text-align: left;
  cursor: pointer;
}

.doc-find:hover { border-color: #cfcfcf; color: var(--ink); }

.doc-find svg,
.doc-search-box svg {
  flex: none;
  width: 0.95rem;
  height: 0.95rem;
}

.doc-find span { flex: 1; }

kbd {
  display: inline-flex;
  align-items: center;
  height: 1.3rem;
  padding: 0 0.38rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fafafa;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.72rem;
  line-height: 1;
}

.doc-pages p {
  margin: 1.35rem 0 0.4rem;
  padding: 0 0.65rem;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 600;
}

.doc-pages p:first-child { margin-top: 0; }

.doc-pages a {
  display: block;
  margin: 0.05rem 0;
  padding: 0.36rem 0.65rem;
  border-radius: 7px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
  text-decoration: none;
}

.doc-pages a:hover { color: var(--ink); background: #fafafa; }

.doc-pages a[aria-current="page"] {
  background: var(--surface);
  color: var(--ink);
  font-weight: 500;
}

.doc-toc[hidden] { display: none; }

.doc-toc p {
  margin: 0 0 0.6rem;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 600;
}

.doc-toc nav {
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--line);
}

.doc-toc a {
  margin-left: -1px;
  padding: 0.28rem 0 0.28rem 0.85rem;
  border-left: 1px solid transparent;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
  text-decoration: none;
}

.doc-toc a:hover { color: var(--ink); }

.doc-toc a[aria-current="true"] {
  border-left-color: var(--ink);
  color: var(--ink);
}

.doc-main {
  min-width: 0;
  max-width: 44rem;
  padding: 3rem 0;
}

.doc-mobile { display: none; }

.js .page { display: none; }

.js .page.current { display: block; }

.page + .page { margin-top: 4rem; }

.js .page + .page { margin-top: 0; }

.page h1,
.page h3 { scroll-margin-top: 5.5rem; }

.page h1 { margin-bottom: 1.25rem; }

.page h3 {
  margin: 2.4rem 0 0.75rem;
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.page :is(h1, h3) a {
  color: inherit;
  text-decoration: none;
}

.page :is(h1, h3) a::after {
  content: "#";
  margin-left: 0.4rem;
  color: var(--muted);
  font-size: 0.6em;
  font-weight: 400;
  vertical-align: text-top;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.page :is(h1, h3):hover a::after,
.page :is(h1, h3) a:focus-visible::after { opacity: 1; }

.page .intro {
  margin-bottom: 1.6rem;
  color: var(--ink);
  font-size: 1.08rem;
}

.copy p:has(+ .snippet),
.copy p:has(+ .try),
.copy p:has(+ pre) { margin-bottom: 0.6rem; }

.doc .page > pre { margin: 0 0 1.5rem; }

.copy ul {
  margin: 0 0 1.35rem;
  padding-left: 1.15rem;
  color: var(--text);
}

.copy li { margin: 0.3rem 0; }

.copy :is(p, li) code { overflow-wrap: anywhere; }

.copy ol {
  margin: 0 0 1.35rem;
  padding-left: 1.3rem;
  color: var(--text);
}

.copy table {
  width: 100%;
  margin: 0 0 1.5rem;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.copy th,
.copy td {
  padding: 0.55rem 0.9rem 0.55rem 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.copy th {
  color: var(--muted);
  font-weight: 500;
}

.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 2rem 0 0;
}

.copy a.card {
  display: block;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  text-decoration: none;
}

.copy a.card:hover { border-color: #cfcfcf; background: #fafafa; }

.card strong {
  display: block;
  margin-bottom: 0.2rem;
  font-weight: 600;
}

.card span {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.doc-pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 3.5rem 0 0;
  padding-top: 1.75rem;
  border-top: 1px solid var(--line);
}

.copy .doc-pager a {
  display: block;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  text-decoration: none;
}

.copy .doc-pager a:hover { border-color: #cfcfcf; background: #fafafa; }

.doc-pager .next { grid-column: 2; text-align: right; }

.doc-pager span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
}

.doc-pager strong { font-weight: 500; }

.try {
  margin: 0 0 1.5rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
}

.try .snippet { margin: 0; }

.doc .try pre {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.doc .try .snippet pre { padding-right: 7.25rem; white-space: pre-wrap; overflow-wrap: anywhere; }

.response { border-top: 1px solid var(--line); background: #fafafa; }

.response[hidden] { display: none; }

.response-head {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.45rem 0.45rem 0 1.1rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.response-head .status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--ink);
  font-weight: 500;
}

.response-head .status::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: #b5b5b5;
}

.response-head .status.ok::before { background: #1d9a4a; }

.response-head .status.warn::before { background: #d08a1e; }

.response-head .status.bad::before { background: #c8372d; }

.response-head .status.waiting::before { animation: waiting 1s ease-in-out infinite; }

@keyframes waiting {
  50% { opacity: 0.3; }
}

.doc .try .response-body.arrive { animation: arrive 0.3s ease both; }

.response-head .time {
  flex: 1;
  margin-left: 0.45rem;
}

.response-head button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.response-head button:hover { background: rgba(20, 20, 20, 0.06); color: var(--ink); }

.response-head button svg { width: 0.85rem; height: 0.85rem; }

.response-head .copy-button svg { width: 1rem; height: 1rem; }

.doc .try .response-body {
  max-height: 24rem;
  padding: 0.5rem 1.1rem 1rem;
  overflow: auto;
}

.doc-search {
  width: min(38rem, calc(100% - 2rem));
  max-height: min(34rem, calc(100vh - 8rem));
  margin: 12vh auto auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 24px 64px rgba(20, 20, 20, 0.14);
}

.doc-search[open] {
  display: flex;
  flex-direction: column;
}

html:has(.doc-search[open]) {
  overflow: hidden;
  scrollbar-gutter: stable;
}

.doc-search::backdrop { background: rgba(20, 20, 20, 0.2); }

.doc-search[open] { animation: search-in 0.32s cubic-bezier(0.2, 0.8, 0.2, 1); }

.doc-search[open]::backdrop { animation: backdrop-in 0.28s ease; }

.doc-search[open].closing { animation: search-out 0.18s ease forwards; }

.doc-search[open].closing::backdrop { animation: backdrop-out 0.18s ease forwards; }

@keyframes search-in {
  from { opacity: 0; transform: translateY(-1.25rem) scale(0.95); }
}

@keyframes search-out {
  to { opacity: 0; transform: translateY(-0.75rem) scale(0.97); }
}

@keyframes backdrop-in {
  from { opacity: 0; }
}

@keyframes backdrop-out {
  to { opacity: 0; }
}

.doc-search-box {
  display: flex;
  flex: none;
  align-items: center;
  gap: 0.65rem;
  height: 3.3rem;
  padding: 0 0.9rem 0 1.05rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.doc-search-box input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
}

.doc-search-box input::-webkit-search-cancel-button { display: none; }

.doc-search-box input:focus-visible { outline: none; }

.doc-results {
  margin: 0;
  padding: 0.45rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
}

.doc-results a {
  display: block;
  padding: 0.6rem 0.75rem;
  border-radius: 9px;
  color: inherit;
  text-decoration: none;
}

.doc-results a[aria-selected="true"] { background: var(--surface); }

.result-path {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
}

.result-title {
  display: block;
  font-size: 0.94rem;
  font-weight: 500;
}

.result-text {
  display: block;
  margin-top: 0.15rem;
  color: var(--text);
  font-size: 0.84rem;
  line-height: 1.45;
}

.doc-results mark {
  border-radius: 3px;
  background: #fff0b3;
  color: inherit;
}

.doc-results-empty {
  margin: 0;
  padding: 1.5rem 1.2rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.doc-search-foot {
  display: flex;
  flex: none;
  gap: 1rem;
  padding: 0.6rem 1.05rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.76rem;
}

.doc-search-foot span { display: inline-flex; align-items: center; gap: 0.35rem; }

.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  z-index: 10;
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 0.85rem;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 0.4rem);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

.snippet {
  position: relative;
  margin: 0 0 1.5rem;
}

.doc pre,
.received .item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.doc pre {
  scrollbar-width: thin;
  margin: 0;
  padding: 1.05rem 2.8rem 1.05rem 1.1rem;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
  line-height: 1.55;
}

.snippet button,
.session-id button,
.relay-list button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.snippet-actions {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.snippet .snippet-actions button {
  position: relative;
  top: auto;
  right: auto;
}

.snippet .snippet-actions button.run:disabled { cursor: default; }

.snippet .snippet-actions button.run:disabled:not(.busy) { opacity: 0.35; }

.run .spin {
  display: none;
  width: 0.8rem;
  height: 0.8rem;
  border: 1.4px solid rgba(20, 20, 20, 0.15);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.run.busy svg { display: none; }

.run.busy .spin { display: block; }

@keyframes spin { to { transform: rotate(360deg); } }

.snippet button:hover,
.session-id button:hover,
.relay-list button:hover {
  background: rgba(20, 20, 20, 0.06);
  color: var(--ink);
}

.snippet button svg,
.session-id button svg,
.relay-list button svg {
  display: block;
  width: 1rem;
  height: 1rem;
}

.snippet .check,
.response-head .check,
.session-id .check,
.relay-list .check { display: none; }

.snippet button.copied,
.response-head button.copied,
.session-id button.copied,
.relay-list button.copied { color: var(--ink); }

.snippet button.copied .clip,
.response-head button.copied .clip,
.session-id button.copied .clip,
.relay-list button.copied .clip { display: none; }

.snippet button.copied .check,
.response-head button.copied .check,
.session-id button.copied .check,
.relay-list button.copied .check { display: block; }

.response-head .status.waiting ~ .copy-button { visibility: hidden; }

.notice {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-top: 0.35rem;
  color: var(--text);
}

.notice svg {
  flex: none;
  width: 0.95rem;
  height: 0.95rem;
  margin-top: 0.28rem;
}

.notice span { text-wrap: pretty; }

.notice a { white-space: nowrap; }

.callout {
  --tone: #3a6fd8;
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  margin: 0 0 1.35rem;
  padding: 0.85rem 1rem;
  border: 1px solid #dbe6f6;
  border-radius: 12px;
  background: #f4f8fd;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.55;
}

.callout svg {
  flex: none;
  width: 1.05rem;
  height: 1.05rem;
  margin-top: 0.2rem;
  color: var(--tone);
}

.callout p,
.copy .callout p { margin: 0; color: inherit; }

.callout.good { --tone: #1d7a3a; border-color: #d3e9d9; background: #f3f9f5; }

.callout.warn { --tone: #b07d06; border-color: #f0e2bb; background: #fdf9ee; }

.callout.danger { --tone: #c8372d; border-color: #f3d4d0; background: #fdf4f3; }

.callout.plain { --tone: var(--muted); border-color: var(--line); background: #fafafa; }

.transfer { margin-top: 2rem; }

.row:not([hidden]) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
}

#setup:not([hidden]) {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.start {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin: 0;
  padding: 1.35rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fafafa;
}

.start-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: 1.1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
}

.start-icon svg { width: 1.15rem; height: 1.15rem; }

.start-icon path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.start-icon.alive svg {
  width: 1.5rem;
  height: 1.5rem;
  overflow: visible;
}

.start-icon.alive .mark-check { stroke-width: 3.4; }

.session-main:not([hidden]) {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.session-icon {
  flex: none;
  margin: 0;
}

.session-text {
  flex: 1;
  min-width: 0;
}

.session-text .session-label { line-height: 1.3; }

.session-text .session-id { margin-top: 0.1rem; line-height: 1.35; }

.session-text .session-actions { margin: -0.4rem 0; }

.start h2 {
  margin: 0 0 0.3rem;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.start p {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.start > button,
.code-row { margin-top: auto; }

.code-row {
  display: flex;
  gap: 0.45rem;
  width: 100%;
}

#live:not([hidden]) { display: block; }

.transfer input,
.transfer .start button,
.transfer .row button {
  height: 2.5rem;
  margin: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 0.95rem;
  line-height: 1;
}

.transfer input {
  flex: 1 1 9rem;
  width: auto;
  min-width: 8.5rem;
  max-width: 100%;
  padding: 0 1rem;
  border: 1px solid #d5d5d5;
  background: var(--bg);
  color: var(--ink);
}

.transfer input:focus,
.transfer input:focus-visible {
  border-color: #b5b5b5;
  outline: none;
}

.transfer input.invalid,
.transfer input.invalid:focus,
.transfer input.invalid:focus-visible {
  border-color: #c8c8c8;
  background: #f6f6f6;
  outline: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.transfer .start button,
.transfer .row button {
  padding: 0 1rem;
  border: 1px solid #d5d5d5;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.transfer .start button:focus-visible,
.transfer .row button:focus-visible {
  outline: none;
  border-color: #b5b5b5;
}

.transfer .start button:hover,
.transfer .row button:hover { background: #f3f3f3; }

.transfer .start button.ready {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.transfer .start button.ready:focus-visible {
  border-color: var(--ink);
  outline: none;
}

.transfer .start button.ready:hover { background: #2c2c2c; }

.transfer .start button.primary {
  flex: none;
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.transfer .start button.primary:hover { background: #2c2c2c; }

.transfer button.quiet {
  height: 2.5rem;
  padding: 0 0.35rem;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.transfer button.quiet:hover {
  background: transparent;
  color: var(--ink);
}

.session-label {
  margin: 0 0 0.45rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.linked #setup { display: none; }

#live.holding { visibility: hidden; }

#transfers-label {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.25rem;
}

#transfers-amount { font-variant-numeric: tabular-nums; }

.session {
  position: relative;
  margin: 0 0 1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
}

.session .link-life {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
}

.session .link-life[hidden] { display: none !important; }

.session .link-life-sep { margin: 0 0.15rem 0 -0.15rem; }

.session .link-life.wrapped .link-life-sep { display: none; }

.session .link-life svg { width: 0.85rem; height: 0.85rem; transform: translateY(0.1em); }

.session .link-life circle {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
}

.session .link-life .track { opacity: 0.22; }

.session .link-life .remain {
  stroke: var(--ink);
  opacity: 0.72;
  stroke-linecap: round;
  stroke-dasharray: 37.6991;
  stroke-dashoffset: calc(37.6991 * (1 - var(--life, 1)));
  transition: stroke-dashoffset 0.9s linear;
}

.session-main { padding: 0.95rem 0.85rem 0.85rem 1.1rem; }

.session-main .session-label { margin: 0; }

.session-id {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.25rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.session-id #code { word-break: break-all; }

.session-id.link {
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0;
}

.session-id.link #code {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: normal;
}

.transfer [hidden] { display: none !important; }

.session-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  border-top: 1px solid var(--line);
  background: #fafafa;
}

.session-main[hidden] + .session-foot { border-top: 0; }

.session-buttons {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
}

.presence {
  display: inline-flex;
  flex: 1 1 14rem;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem 0.5rem;
  min-width: 0;
  margin: 0 auto 0 0.25rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  transition: color 0.25s ease;
  animation: arrive 0.3s ease both;
}

/* Stay one phrase. The expiry wraps under it instead of squeezing the words into a column. */
#presence-count {
  flex: none;
  max-width: calc(100% - 1.6rem);
}

.presence.full { color: var(--ink); }

.presence[hidden] { display: none; }

.presence .presence-info,
.presence .presence-warn { display: none; flex: none; width: 0.95rem; height: 0.95rem; }

.presence.over .seats { display: none; }

.presence.over .presence-info { display: block; }

.session.warn { border-color: #f0e2bb; }

.session.warn .session-foot { background: #fdf9ee; }

.session.warn .presence { color: var(--text); }

.session.warn .presence.over .presence-info { display: none; }

.session.warn .presence.over .presence-warn { display: block; color: #b07d06; }

.seats {
  display: inline-flex;
  flex: none;
  gap: 0.2rem;
  transform: translateY(0.1em);
}

.seats i {
  width: 0.45rem;
  height: 0.45rem;
  border: 1.5px solid #b5b5b5;
  border-radius: 50%;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.seats i:first-child,
.presence.full .seats i { border-color: #1d7a3a; background: #1d7a3a; }

.transfer .session-foot button,
.transfer .pending-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.1rem;
  margin: 0;
  padding: 0 0.95rem;
  border: 1px solid #d5d5d5;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.88rem;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.transfer .session-foot button:hover,
.transfer .pending-actions button:hover { border-color: #c2c2c2; background: #f3f3f3; }

.transfer .pending-actions button.primary {
  min-width: 5.5rem;
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.transfer .pending-actions button.primary:hover { border-color: #2c2c2c; background: #2c2c2c; }

.transfer .pending-actions button.primary:disabled {
  border-color: #cfcfcf;
  background: #cfcfcf;
  cursor: default;
  transform: none;
}

.presence:not(.full) .seats i:last-child { animation: waiting 1.4s ease-in-out infinite; }

.session-actions {
  display: flex;
  flex: none;
  align-items: center;
  gap: 0.3rem;
}

.session-id button { flex: none; color: var(--muted); }

.session-id button.copied .link { display: none; }

.session-id button.open {
  background: rgba(20, 20, 20, 0.06);
  color: var(--ink);
}

.qr-panel[hidden] { display: none !important; }

.qr-panel {
  position: fixed;
  top: var(--qr-top, 0px);
  left: var(--qr-left, 0px);
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  width: min(12.5rem, calc(100vw - 1.5rem));
  margin: 0;
  padding: 0.7rem 0.7rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 40px -18px rgba(20, 20, 20, 0.28);
  transform-origin: var(--qr-origin, top right);
}

.qr-panel svg {
  display: block;
  width: 100%;
  height: auto;
}

.qr-panel p {
  margin: 0;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.78rem;
  letter-spacing: 0;
}

.hint {
  margin: 0.85rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  opacity: 1;
}

.hint.fade {
  opacity: 0;
  transition: opacity 0.2s ease;
}

.paths {
  margin: 0 0 2.75rem;
  padding: 1.6rem 1.4rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fafafa;
}

.paths .stage { position: relative; }

.paths svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.paths .route,
.paths .done { vector-effect: non-scaling-stroke; }

.paths .route {
  fill: none;
  stroke: #e3e3e3;
  stroke-width: 1.5;
}

.paths .route.down { stroke-dasharray: 3 6; }

.paths .relay {
  fill: #c9c9c9;
  transition: fill 0.3s ease;
}

.paths .relay.hit { animation: hit 0.35s ease; }

@keyframes hit {
  from { fill: var(--ink); }
}

.paths .relay.down { fill: #f1cdc9; }

.paths .relay.down.hit { animation: blocked 0.4s ease; }

@keyframes blocked {
  from { fill: #c8372d; }
}

.paths .offline {
  position: absolute;
  left: calc(50% + max(0.7rem, 16 / 720 * 100%));
  color: #c8372d;
  font-size: 0.7rem;
  line-height: 1;
  opacity: 0;
  transform: translate(-0.2rem, -50%);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.paths .offline:nth-of-type(1) { top: calc(22 / 160 * 100%); }

.paths .offline:nth-of-type(2) { top: calc(80 / 160 * 100%); }

.paths .offline:nth-of-type(3) { top: calc(138 / 160 * 100%); }

.paths .offline.show { opacity: 1; transform: translate(0, -50%); }

.paths .sender .sheet { fill: var(--ink); }

.paths .receiver .sheet { fill: #dedede; }

.paths .fold { fill: #fff; opacity: 0.4; }

.paths .receiver .fill {
  fill: var(--ink);
  transition: opacity 0.35s ease;
}

.paths .receiver .done {
  fill: none;
  stroke: #fff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: opacity 0.35s ease;
}

.paths .receiver.complete .done { animation: draw 0.35s ease-out 0.1s forwards; }

.paths .receiver.clearing .fill,
.paths .receiver.clearing .done { opacity: 0; }

.paths .sender,
.paths .receiver { transform-box: fill-box; transform-origin: center; }

.paths .receiver.got,
.paths .sender.emit { animation: got 0.3s ease; }

.paths .receiver.complete { animation: got 0.45s ease; }

@keyframes got {
  40% { transform: scale(1.08); }
}

.paths .tesserae circle {
  fill: var(--ink);
  transition: opacity 0.45s ease, fill 0.15s ease;
}

.paths .tesserae circle.lost {
  fill: #c8372d;
  opacity: 0;
  transition: fill 0.1s ease, opacity 0.35s ease 0.2s;
}

.paths .tesserae circle.spare { fill: #bdbdbd; opacity: 0; }

.paths figcaption {
  position: relative;
  height: 1.2rem;
  margin-top: 0.85rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.paths figcaption span {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
}

.paths figcaption span:nth-child(1) { left: calc(30 / 720 * 100%); }

.paths figcaption span:nth-child(2) { left: 50%; }

.paths figcaption span:nth-child(3) { left: calc(690 / 720 * 100%); }

.status.online::before { animation: beat 2.4s ease-out infinite var(--pulse-delay, 0s); }

@keyframes beat {
  0% { box-shadow: 0 0 0 0 rgba(29, 122, 58, 0.45); }
  60%, 100% { box-shadow: 0 0 0 0.35rem rgba(29, 122, 58, 0); }
}

.relay-list li.fresh { animation: fresh 1.6s ease; }

@keyframes fresh {
  from { background: #f0f7f2; }
}

.moving .mark circle { animation: relay 1.2s ease-in-out infinite; }

.moving .mark circle:nth-child(2) { animation-delay: 0.2s; }

.moving .mark circle:nth-child(3) { animation-delay: 0.4s; }

@keyframes relay {
  0%, 100% { opacity: 0.25; }
  35% { opacity: 1; }
}

.received .item { animation: rise 0.28s ease; }

@keyframes rise {
  from { opacity: 0; transform: translateY(0.4rem); }
}

.blur-in {
  display: inline-block;
  white-space: pre;
  animation: blur-in 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes blur-in {
  from { opacity: 0; filter: blur(6px); transform: translateY(0.3em); }
}

.received .item.stalled.busy::after { animation-play-state: paused; opacity: 0.45; }

.received .item.busy::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(100deg, transparent 35%, rgba(255, 255, 255, 0.6) 50%, transparent 65%) no-repeat;
  background-size: 250% 100%;
  pointer-events: none;
  animation: shimmer 1.6s linear infinite;
}

@keyframes shimmer {
  from { background-position: 150% 0; }
  to { background-position: -50% 0; }
}

.item-meta .done {
  display: inline-block;
  width: 0.8rem;
  height: 0.8rem;
  margin-right: 0.3rem;
  color: var(--ink);
  vertical-align: -0.1rem;
}

.item-meta .done path,
button.copied .check path {
  stroke-dasharray: 1;
  animation: draw 0.4s ease-out both;
}

button.copied .check path { animation-duration: 0.3s; }

button.copied .check { animation: pop 0.3s ease; }

@keyframes pop {
  from { transform: scale(0.6); }
}

.btn,
a.plain,
.transfer button,
.snippet button,
.response-head button,
.session-id button,
.relay-list button,
.pending button.x,
.nav-toggle,
.foot-github,
.doc-find,
.doc-menu {
  transition: transform 0.12s ease, background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn:active,
a.plain:active,
.transfer button:active,
.snippet button:active,
.response-head button:active,
.session-id button:active,
.relay-list button:active,
.pending button.x:active,
.nav-toggle:active,
.foot-github:active,
.doc-find:active { transform: scale(0.96); }

.doc-menu:active { transform: scale(0.99); }

.copy a.card,
.copy .doc-pager a { transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease; }

.copy a.card:hover,
.copy .doc-pager a:hover { transform: translateY(-1px); }

#live:not([hidden]),
#setup:not([hidden]) { animation: rise 0.3s ease; }

#live:not([hidden]) .session { animation: settle 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.2); }

@keyframes settle {
  from { opacity: 0; transform: scale(0.92); }
}

@view-transition { navigation: auto; }

.bar { view-transition-name: bar; }

::view-transition-group(bar),
::view-transition-old(bar),
::view-transition-new(bar) { animation: none; }

::view-transition-old(root) { animation: leave 0.1s ease both; }

::view-transition-new(root) { animation: arrive 0.22s ease both; }

@keyframes leave {
  to { opacity: 0; transform: translateY(-0.25rem); }
}

@keyframes arrive {
  from { opacity: 0; transform: translateY(0.4rem); }
}

@keyframes draw {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

.page.enter { animation: enter 0.25s ease; }

@keyframes enter {
  from { opacity: 0; transform: translateY(0.3rem); }
}

.page h3 { position: relative; }

.page h3::before {
  content: "";
  position: absolute;
  top: 0.15em;
  bottom: 0.15em;
  left: -0.85rem;
  width: 2px;
  border-radius: 2px;
  background: var(--ink);
  opacity: 0;
  transform: scaleY(0);
  pointer-events: none;
}

.page h3.flash::before { animation: flash 1.6s ease; }

@keyframes flash {
  0% { opacity: 1; transform: scaleY(0); }
  18%, 65% { opacity: 1; transform: scaleY(1); }
  100% { opacity: 0; transform: scaleY(1); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  @view-transition { navigation: none; }
}

.received { margin-top: 0; }

.received:empty { display: none; }

.sample { margin-top: 2.75rem; }

.pending {
  margin: 0.35rem 0 1.75rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  animation: rise 0.28s ease;
}

.pending[hidden] { display: none; }

#live:has(#pending:not([hidden])) .drop { display: none; }

.pending.over {
  border-color: #9a9a9a;
  box-shadow: 0 0 0 4px rgba(20, 20, 20, 0.04);
}

.pending-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 0.85rem 0.8rem 1.1rem;
  border-bottom: 1px solid var(--line);
}

.pending-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.pending-add {
  display: inline-block;
  padding: 0.3rem 0.6rem;
  border-radius: 8px;
  color: var(--ink);
  font-size: 0.85rem;
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.15s ease;
}

.pending-add:hover { background: rgba(20, 20, 20, 0.06); }

.pending-add:active { transform: scale(0.96); }

.pending ul {
  list-style: none;
  max-height: 18rem;
  margin: 0;
  padding: 0.4rem;
  overflow-y: auto;
}

.pending li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.4rem 0.5rem 0.6rem;
  border-radius: 10px;
  animation: rise 0.22s ease;
}

.pending li:hover { background: #fafafa; }

.pending .kind,
.received .kind {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 9px;
  background: var(--surface);
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.received .kind { border: 1px solid #dcdcdc; }

.pending .kind svg,
.received .kind svg { width: 1rem; height: 1rem; }

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

.pending .name {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.92rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pending .size {
  color: var(--muted);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.pending button.x {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.pending button.x:hover { background: rgba(20, 20, 20, 0.06); color: var(--ink); }

.pending button.x svg { width: 0.75rem; height: 0.75rem; }

.pending-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  border-top: 1px solid var(--line);
  border-radius: 0 0 15px 15px;
  background: #fafafa;
}

.route {
  position: relative;
  flex: none;
  margin-right: auto;
}

.transfer .pending-actions .route > button {
  gap: 0.4rem;
  padding: 0 0.7rem 0 0.55rem;
  border-color: transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 0.85rem;
}

.transfer .pending-actions .route > button:hover,
.transfer .pending-actions .route > button[aria-expanded="true"] {
  border-color: transparent;
  background: rgba(20, 20, 20, 0.06);
  color: var(--ink);
}

.route > button:focus-visible { outline: 2px solid #cfcfcf; outline-offset: 1px; }

.route > button svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
}

.route-menu {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  z-index: 5;
  display: grid;
  gap: 2px;
  width: max-content;
  max-width: min(26rem, calc(100vw - 2.75rem));
  padding: 0.3rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 40px -18px rgba(20, 20, 20, 0.28);
  transform-origin: top left;
  animation: sort-menu 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.route-menu[hidden] { display: none; }

.route-menu label {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  cursor: pointer;
}

.route-menu label:hover,
.route-menu label:has(input:focus-visible) { background: var(--surface); }

.route-menu input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.route-menu label > span {
  display: flex;
  flex: 1;
  flex-direction: column;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.route-menu strong {
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 500;
}

.route-menu em {
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 400;
}

.route-menu label::after {
  content: "";
  flex: none;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
}

.route-menu label:has(input:checked)::after { background: var(--ink); }

.pending-wait {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 auto 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.pending-wait[hidden] { display: none; }

.drop {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 9.5rem;
  margin: 0.35rem 0 1.75rem;
  padding: 1.5rem;
  border: 1px dashed #cfcfcf;
  border-radius: 16px;
  background: #fafafa;
  color: var(--muted);
  text-align: center;
  cursor: pointer;
}

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

#file:focus-visible + .drop {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.drop:hover,
.drop.over {
  border-color: #9a9a9a;
  background: #f3f3f3;
  color: var(--ink);
}

.received .item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 0.65rem;
  padding: 0.85rem 1rem;
}

.received .item:has(.tip:hover),
.received .item:has(.tip.show) { z-index: 3; }

.received .item.busy {
  background: linear-gradient(90deg, var(--surface) var(--progress, 0%), #e8e8e8 var(--progress, 0%));
}

.item-main { flex: 1; min-width: 0; }

.item-name {
  position: relative;
  min-width: 0;
  margin: 0;
  font-size: 0.95rem;
}

.item-name-text {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-name.tip::after {
  max-width: min(24rem, calc(100vw - 2rem));
  word-break: break-all;
}

.item-meta,
.item-stats {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.item-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem;
}

.item-stats .dot { color: var(--muted); }

.item-stats .tip::after {
  top: calc(100% + 0.35rem);
  bottom: auto;
  left: 0;
  z-index: 4;
}

.received .item button.icon {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.received .item button.icon:hover {
  background: rgba(20, 20, 20, 0.06);
  color: var(--ink);
}

.received .item button.icon svg {
  display: block;
  width: 1.05rem;
  height: 1.05rem;
}

.received p { margin: 0; }

.stats.quad { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.stats + .session-label { margin-bottom: 0.65rem; }

.relay-tools {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.25rem;
  margin-bottom: 0.65rem;
}

.relay-tools .session-label {
  flex: 1;
  margin: 0;
  white-space: nowrap;
}

.relay-search {
  display: flex;
  align-items: center;
  height: 2.1rem;
  border: 1px solid transparent;
  border-radius: 9px;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.relay-search.open {
  border-color: var(--line);
  background: #fff;
}

.relay-search.open:focus-within { border-color: #cfcfcf; }

.relay-search button,
.relay-sort {
  color: var(--muted);
}

.relay-search button {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}

@media (hover: hover) {
  .relay-search button:hover { color: var(--ink); background: rgba(20, 20, 20, 0.06); }

  .relay-search.open button:hover { background: transparent; }
}

.relay-search button:focus-visible { outline: 2px solid #cfcfcf; outline-offset: -2px; }

.relay-search button svg { width: 1rem; height: 1rem; }

.relay-search input {
  width: 0;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.85rem;
  opacity: 0;
  transition: width 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.2s ease, padding 0.28s ease;
}

.relay-search.open input {
  width: 15rem;
  padding-right: 0.65rem;
  opacity: 1;
}

.relay-search input:focus-visible { outline: none; }

.relay-search input::-webkit-search-cancel-button { display: none; }

.relay-sort { position: relative; }

.relay-sort > button {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  height: 2.1rem;
  padding: 0 0.6rem 0 0.75rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.85rem;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.relay-sort > button:hover,
.relay-sort > button[aria-expanded="true"] { border-color: #d5d5d5; }

.relay-sort > button:focus-visible { outline: 2px solid #cfcfcf; outline-offset: 1px; }

.relay-sort > button svg {
  width: 0.8rem;
  height: 0.8rem;
  color: var(--muted);
  transition: transform 0.15s ease;
}

.relay-sort > button[aria-expanded="true"] svg { transform: rotate(180deg); }

.relay-sort-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  z-index: 5;
  min-width: 100%;
  margin: 0;
  padding: 0.3rem;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 40px -18px rgba(20, 20, 20, 0.28);
  transform-origin: top right;
  animation: sort-menu 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.relay-sort-menu[hidden] { display: none; }

@keyframes sort-menu {
  from { opacity: 0; transform: translateY(-0.35rem) scale(0.96); }
}

.relay-sort-menu li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  color: var(--text);
  font-size: 0.85rem;
  white-space: nowrap;
  cursor: pointer;
}

.relay-sort-menu li:focus { outline: none; background: var(--surface); color: var(--ink); }

.relay-sort-menu li[aria-selected="true"] { color: var(--ink); font-weight: 500; }

.relay-sort-menu li[aria-selected="true"]::after {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--ink);
}

.relay-rank {
  margin-right: 0.45rem;
  color: var(--muted);
  font-weight: 600;
}

.relay-none { margin: 0; }

.relay-none[hidden] { display: none; }

.relay-empty { margin: 0; }

.relay-empty[hidden] { display: none; }

.relay-empty + .note { margin-top: 1.1rem; }

.relay-spin {
  flex: none;
  width: 0.95rem;
  height: 0.95rem;
  margin-top: 0.25rem;
  border: 1.5px solid rgba(20, 20, 20, 0.15);
  border-top-color: var(--muted);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

main > .cards { margin-top: 2.5rem; }

.relay-list {
  display: grid;
  gap: 0.6rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.relay-list:empty { display: none; }

.relay-list li.relay {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.2s ease;
}

.relay-list li.relay:hover { border-color: #d5d5d5; }

.relay-list li.relay:has(.tip:hover),
.relay-list li.relay:has(.tip.show) {
  position: relative;
  z-index: 3;
}

.relay-list li.relay.open {
  border-color: #d5d5d5;
  box-shadow: 0 10px 28px -22px rgba(20, 20, 20, 0.4);
}

.relay-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 0.7rem 0.95rem 1.1rem;
  cursor: pointer;
}

.relay-head > div:first-child { min-width: 0; }

.relay-actions {
  display: flex;
  flex: none;
  align-items: center;
  gap: 0.3rem;
}

.relay-toggle svg { transition: transform 0.2s ease; }

.relay.open .relay-toggle svg { transform: rotate(180deg); }

.relay-detail {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.relay.open .relay-detail { grid-template-rows: 1fr; }

.relay-detail-inner {
  min-height: 0;
  overflow: hidden;
}

.relay.settled .relay-detail-inner { overflow: visible; }

.relay-body {
  padding: 0.95rem 1.1rem 1rem;
  border-top: 1px solid var(--line);
  border-radius: 0 0 13px 13px;
  background: #fafafa;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.relay.open .relay-body { opacity: 1; transition-delay: 0.05s; }

.relay-facts {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 0.55rem 1rem;
  margin: 0;
  font-size: 0.85rem;
}

.relay-facts dt { color: var(--muted); }

.relay-facts dt.tip { justify-self: start; }

.relay-facts dd {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin: 0;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.relay-facts dd.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
  line-height: 1.6;
}

.relay-claim {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  margin: 0.9rem 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

.relay-claim-icon { display: flex; flex: none; align-items: center; height: 1.5em; }

.relay-claim-icon svg { width: 0.85rem; height: 0.85rem; }

.relay-name {
  margin: 0 0 0.15rem;
  font-weight: 600;
}

.relay-ref {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  line-height: 1.45;
}

.relay-id { white-space: nowrap; }

.relay-id.tip::after {
  max-width: min(36rem, calc(100vw - 3rem));
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  word-break: break-all;
}

.relay-addr {
  margin-left: 0.45rem;
  color: var(--muted);
  white-space: nowrap;
}

.relay-meta {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.relay-bit { white-space: nowrap; }

.status { font-weight: 600; }

.status::before {
  content: "";
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  margin-right: 0.35rem;
  border-radius: 50%;
  background: currentColor;
  transform: translateY(-0.06rem);
}

.status.online { color: #1d7a3a; }

.status.offline { color: #9a6a2f; }

.relay-list button { flex: none; }

.note {
  margin: 0.9rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.tip { position: relative; cursor: help; }

.tip::after {
  content: attr(data-tip);
  position: absolute;
  left: 0;
  top: calc(100% + 0.35rem);
  z-index: 2;
  width: max-content;
  max-width: 16rem;
  padding: 0.28rem 0.5rem;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.35;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transform: translateX(var(--tip-shift, 0px));
}

.tip:hover::after,
.tip.show::after { opacity: 1; }

@media (max-width: 640px) {
  body { font-size: 16px; }

  .bar-inner,
  body.docs .bar-inner,
  main,
  body.docs main.doc { width: min(46rem, calc(100% - 2.5rem)); }

  .bar-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    min-height: 3.6rem;
    padding: 0;
  }

  .nav-toggle { display: flex; }

  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    padding: 0.4rem 0.75rem 0.85rem;
    border-bottom: 1px solid var(--line);
    background: #fff;
    box-shadow: 0 18px 30px -24px rgba(20, 20, 20, 0.35);
  }

  .nav.open {
    display: flex;
    animation: drop 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  .nav a {
    padding: 0.7rem 0.75rem;
    border-radius: 10px;
    color: var(--text);
    font-size: 0.98rem;
    transition: background-color 0.15s ease;
  }

  .nav a:active { background: #fafafa; }

  .nav a[aria-current="page"] {
    background: var(--surface);
    color: var(--ink);
    font-weight: 500;
  }

  .nav-toggle[aria-expanded="true"] { background: var(--surface); }

  main,
  .home main { padding-top: 2.5rem; }

  .foot-inner,
  body.docs .foot-inner { width: min(46rem, calc(100% - 2.5rem)); }

  .foot-inner { flex-wrap: wrap; row-gap: 0.6rem; }

  .foot p,
  .foot nav { flex: 1 1 100%; }

  .foot-status-wrap { margin-right: auto; }

  .net-pop {
    right: auto;
    left: -0.5rem;
    width: min(16rem, calc(100vw - 2.5rem));
    transform-origin: bottom left;
  }

  .relay-ref .relay-addr {
    display: block;
    margin-left: 0;
  }

  .relay-tools:has(.relay-search.open) .session-label { display: none; }

  .relay-search.open { flex: 1; }

  .relay-search.open input { flex: 1; width: auto; }

  .lead { font-size: 1.02rem; }

  h1 { font-size: 1.55rem; }

  .stats {
    grid-template-columns: 1fr;
    gap: 1.15rem;
    margin: 1.75rem 0 2rem;
  }

  .stats > div,
  .stats > div + div {
    padding: 0;
    border-left: 0;
  }

  .stats.quad { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .paths {
    margin-bottom: 2rem;
    padding: 1.1rem 1.35rem 0.85rem;
  }

  .paths figcaption span:nth-child(1) { left: 0; transform: none; }

  .paths figcaption span:nth-child(3) { left: auto; right: 0; transform: none; }

  .paths .tesserae circle { r: 7px; }

  .paths .relay { r: 12px; }

  #setup:not([hidden]) { grid-template-columns: 1fr; }

  .start { padding: 1.15rem; }

  .session-foot { row-gap: 0.65rem; }

  .session-buttons { flex: 1 1 100%; }

  .transfer .session-buttons button { flex: 1; }

  .pending-actions { flex-wrap: wrap; }

  .transfer .pending-actions button { flex: 1; }

  .transfer .pending-actions .route > button { flex: none; }

  .pending-wait { flex: 1 1 100%; }

  .relay-head { padding-left: 0.95rem; }

  .relay-body { padding: 0.85rem 0.95rem 0.95rem; }

  .relay-facts {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.1rem;
  }

  .relay-facts dd + dt { margin-top: 0.55rem; }

  .relay-ref,
  .relay-meta { overflow-wrap: anywhere; }

  .relay-addr,
  .relay-bit { white-space: normal; }

  .tip::after { max-width: min(16rem, calc(100vw - 3rem)); }

  .cards,
  .doc-pager { grid-template-columns: 1fr; }

  .doc-pager .next { grid-column: auto; }

  .doc-search-foot { display: none; }
}

@media (max-width: 1180px) {
  body.docs main.doc { grid-template-columns: 14.5rem minmax(0, 1fr); }

  .doc-toc { display: none; }
}

@media (max-width: 860px) {
  body.docs main.doc { display: block; }

  .doc-mobile {
    display: flex;
    gap: 0.5rem;
    padding: 1.25rem 0 0;
  }

  .doc-menu {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-width: 0;
    height: 2.4rem;
    padding: 0 0.8rem;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-size: 0.92rem;
    cursor: pointer;
  }

  .doc-menu svg { flex: none; width: 0.8rem; height: 0.8rem; color: var(--muted); transition: transform 0.15s ease; }

  .doc-menu[aria-expanded="true"] svg { transform: rotate(180deg); }

  .doc-mobile .doc-find {
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    margin: 0;
    padding: 0;
  }

  .doc-mobile .doc-find span,
  .doc-mobile .doc-find kbd { display: none; }

  .doc-side {
    position: static;
    display: none;
    max-height: none;
    margin: 0.5rem 0 0;
    padding: 0.85rem 0.5rem;
    border: 1px solid var(--line);
    border-radius: 12px;
  }

  .doc-side.open { display: block; }

  @keyframes drop {
    from { opacity: 0; transform: translateY(-0.35rem); }
  }

  .doc-side > .doc-find { display: none; }

  .doc-side .doc-pages {
    overflow: visible;
    -webkit-mask-image: none;
    mask-image: none;
  }

  html:not(.js) .doc-side { display: block; }

  .doc-main { padding-top: 2rem; }
}
