/* Self-hosted fonts: no third-party requests */
@font-face { font-family: 'Geist'; src: url('/vendor/fonts/geist-latin-wght-normal.woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Geist Mono'; src: url('/vendor/fonts/geist-mono-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Geist Mono'; src: url('/vendor/fonts/geist-mono-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Instrument Serif'; src: url('/vendor/fonts/instrument-serif-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Instrument Serif'; src: url('/vendor/fonts/instrument-serif-latin-400-italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }

/* ============================================================
   Beam — design tokens
   Warm, editorial neutrals · one ember accent · light + dark
   ============================================================ */
:root {
  --bg: #f7f6f3;
  --surface: #ffffff;
  --surface-2: #f2f0ec;
  --surface-3: #ebe8e2;
  --ink: #171615;
  --ink-2: #57544f;
  --ink-3: #8f8b84;
  --line: #e8e5df;
  --line-2: #d9d5cd;
  --accent: #f0532a;
  --accent-2: #ff9a5a;
  --accent-soft: rgba(240, 83, 42, 0.1);
  --violet: #7c6cff;
  --ok: #17a34a;
  --ok-soft: rgba(23, 163, 74, 0.1);
  --err: #dc3b30;
  --err-soft: rgba(220, 59, 48, 0.1);
  --btn-bg: #171615;
  --btn-fg: #ffffff;
  --shadow-sm: 0 1px 2px rgba(23, 22, 21, 0.05);
  --shadow: 0 1px 2px rgba(23, 22, 21, 0.04), 0 4px 12px -2px rgba(23, 22, 21, 0.05), 0 24px 48px -24px rgba(23, 22, 21, 0.12);
  --sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0b0c;
    --surface: #141415;
    --surface-2: #1b1b1d;
    --surface-3: #232326;
    --ink: #f3f2ef;
    --ink-2: #a8a5a0;
    --ink-3: #6f6c68;
    --line: #232325;
    --line-2: #323235;
    --accent: #ff6a3d;
    --accent-2: #ffb07a;
    --accent-soft: rgba(255, 106, 61, 0.14);
    --ok: #3ecf75;
    --ok-soft: rgba(62, 207, 117, 0.12);
    --err: #ff6b5e;
    --err-soft: rgba(255, 107, 94, 0.12);
    --btn-bg: #f3f2ef;
    --btn-fg: #0b0b0c;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 24px 48px -24px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}

/* ============================================================ Base */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  min-height: 100dvh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 15px; line-height: 1.55; letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
ol, ul { list-style: none; }
[hidden] { display: none !important; }
::selection { background: var(--accent-soft); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.backdrop {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(60% 40% at 50% -6%, var(--accent-soft), transparent 70%);
}

/* ============================================================ Header */
.top {
  width: 100%; max-width: 1120px; margin: 0 auto; padding: 20px 24px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
}
.top-right { justify-self: end; display: flex; gap: 0.5em }

/* Mode switch */
.tabs {
  display: inline-flex; gap: 2px; padding: 3px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--line);
}
.tab {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 14px; border-radius: 9px;
  font-size: 13.5px; font-weight: 500; color: var(--ink-3); text-decoration: none;
  transition: color .2s, background .2s, box-shadow .2s;
}
.tab:hover { color: var(--ink); }
.tab[aria-current="page"] { color: var(--ink); background: var(--surface); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }
.tab[aria-current="page"] svg { color: var(--accent); }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none; font-weight: 600; font-size: 17px; letter-spacing: -0.03em;
}
.mark {
  position: relative; width: 26px; height: 26px; border-radius: 8px; flex: none;
  background: var(--ink); overflow: hidden;
}
.mark::before {
  content: ''; position: absolute; left: 50%; top: 50%; width: 30px; height: 2px;
  transform: translate(-50%, -50%) rotate(-45deg);
  background: linear-gradient(90deg, transparent, var(--accent-2), var(--accent), transparent);
}
.mark i { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: var(--bg); }
.mark i:first-child { left: 5px; bottom: 5px; }
.mark i:last-child { right: 5px; top: 5px; background: var(--accent); }

.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px;
  font-size: 13px; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.chip-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); flex: none; }
.github-icon {
  display: inline-block;
  width: 1.5em;
  height: 1.5em;
  background: center / contain no-repeat url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22800px%22%20height%3D%22800px%22%20viewBox%3D%220%200%2048%2048%22%20fill%3D%22none%22%3E%0A%3Ccircle%20cx%3D%2224%22%20cy%3D%2224%22%20r%3D%2220%22%20fill%3D%22%23181717%22%2F%3E%0A%3Cpath%20d%3D%22M6.81348%2034.235C9.24811%2038.3138%2013.0939%2041.4526%2017.6772%2042.9784C18.6779%2043.1614%2019.0425%2042.5438%2019.0425%2042.0134C19.0425%2041.7938%2019.0388%2041.4058%2019.0339%2040.8866C19.0282%2040.2852%2019.0208%2039.5079%2019.0155%2038.6124C13.4524%2039.8206%2012.2787%2035.931%2012.2787%2035.931C11.3689%2033.6215%2010.0576%2033.0064%2010.0576%2033.0064C8.2417%2031.7651%2010.1951%2031.7896%2010.1951%2031.7896C12.2025%2031.9321%2013.2584%2033.8511%2013.2584%2033.8511C15.0424%2036.9071%2017.94%2036.0243%2019.0794%2035.5135C19.2611%2034.2207%2019.7767%2033.3391%2020.3489%2032.8394C15.908%2032.3348%2011.2387%2030.6183%2011.2387%2022.9545C11.2387%2020.7715%2012.0184%2018.9863%2013.2977%2017.5879C13.0914%2017.082%2012.4051%2015.0488%2013.4929%2012.2949C13.4929%2012.2949%2015.1725%2011.7571%2018.9934%2014.3453C20.5883%2013.9021%2022.2998%2013.6798%2024.0003%2013.6725C25.6983%2013.6798%2027.4099%2013.9021%2029.0072%2014.3453C32.8256%2011.7571%2034.5016%2012.2949%2034.5016%2012.2949C35.5931%2015.0488%2034.9067%2017.082%2034.7005%2017.5879C35.9823%2018.9863%2036.757%2020.7715%2036.757%2022.9545C36.757%2030.638%2032.0804%2032.3286%2027.6247%2032.8234C28.343%2033.441%2028.9827%2034.6614%2028.9827%2036.5277C28.9827%2038.3152%2028.9717%2039.8722%2028.9644%2040.9035C28.9608%2041.4143%2028.9581%2041.7962%2028.9581%2042.0134C28.9581%2042.5487%2029.3178%2043.1712%2030.3332%2042.976C33.9844%2041.7572%2037.1671%2039.5154%2039.5403%2036.5903C35.8734%2041.1108%2030.274%2044%2023.9997%2044C16.6943%2044%2010.3038%2040.0832%206.81348%2034.235Z%22%20fill%3D%22white%22%2F%3E%0A%3C%2Fsvg%3E");
}
/* ============================================================ Layout */
main { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 40px 24px 64px; }
.view { animation: enter .6s var(--ease) both; }
.view > * { animation: enter .6s var(--ease) both; }
.view > *:nth-child(2) { animation-delay: .05s; }
.view > *:nth-child(3) { animation-delay: .1s; }
.view > *:nth-child(4) { animation-delay: .15s; }
.view > *:nth-child(5) { animation-delay: .2s; }
@keyframes enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.narrow { max-width: 560px; margin: 0 auto; }

/* ============================================================ Hero */
.hero { text-align: center; max-width: 720px; margin: 0 auto; }
.badge {
  display: inline-flex; align-items: center; gap: 10px; padding: 4px 14px 4px 4px; border-radius: 999px;
  font-size: 13px; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.badge-tag {
  font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .04em;
  padding: 3px 8px; border-radius: 999px; color: var(--accent); background: var(--accent-soft);
}
h1 {
  margin-top: 26px; font-weight: 500; font-size: clamp(40px, 7.2vw, 76px); line-height: 1; letter-spacing: -0.045em;
}
h1 em {
  font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.02em;
  background: linear-gradient(100deg, var(--accent) 10%, var(--accent-2) 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: .04em;
}
.lede { margin: 22px auto 0; max-width: 500px; font-size: 17px; color: var(--ink-2); line-height: 1.6; }

/* ============================================================ Drop zone */
.drop {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px;
  max-width: 620px; margin: 48px auto 0; padding: 44px 24px 36px; cursor: pointer; text-align: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow);
  transition: border-color .25s, box-shadow .25s, transform .25s var(--ease);
}
.drop::before {
  content: ''; position: absolute; inset: 8px; border-radius: 17px; pointer-events: none;
  border: 1px dashed var(--line-2); transition: border-color .25s, background .25s;
}
.drop:hover { border-color: var(--line-2); }
.drop:focus-visible { outline: none; border-color: var(--accent); }
.drop.over { transform: scale(1.01); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow); }
.drop.over::before { border-color: var(--accent); background: var(--accent-soft); }

.stack { position: relative; width: 120px; height: 76px; margin-bottom: 18px; }
.sheet {
  position: absolute; left: 50%; top: 4px; width: 50px; height: 64px; margin-left: -25px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-sm);
  transition: transform .45s var(--ease);
}
.sheet::after {
  content: ''; position: absolute; left: 9px; right: 9px; top: 12px; height: 3px; border-radius: 2px;
  background: var(--surface-3); box-shadow: 0 7px 0 var(--surface-3), 0 14px 0 var(--surface-3);
}
.s1 { transform: translateX(-20px) rotate(-10deg); background: var(--surface-2); }
.s2 { transform: translateX(20px) rotate(10deg); background: var(--surface-2); }
.s3 {
  display: grid; place-items: center; color: #fff; border: 0;
  background: linear-gradient(160deg, var(--accent-2), var(--accent));
  box-shadow: 0 10px 24px -8px rgba(240, 83, 42, .55), inset 0 1px 0 rgba(255,255,255,.35);
}
.s3::after { display: none; }
.drop:hover .s1, .drop.over .s1 { transform: translateX(-34px) rotate(-16deg); }
.drop:hover .s2, .drop.over .s2 { transform: translateX(34px) rotate(16deg); }
.drop:hover .s3, .drop.over .s3 { transform: translateY(-6px); }

.drop-title { font-size: 19px; font-weight: 550; letter-spacing: -0.025em; }
.drop-sub { color: var(--ink-2); }
.link { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; transition: text-decoration-color .2s; }
.drop:hover .link { text-decoration-color: var(--accent); }
.drop-meta { margin-top: 18px; font-size: 12.5px; color: var(--ink-3); display: inline-flex; align-items: center; gap: 4px; }
kbd {
  font-family: var(--sans); font-size: 11px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 5px;
  display: inline-grid; place-items: center; color: var(--ink-2);
  background: var(--surface-2); border: 1px solid var(--line); border-bottom-width: 2px;
}

/* ============================================================ Receive */
.divider {
  display: flex; align-items: center; gap: 14px; max-width: 420px; margin: 40px auto 18px;
  font-size: 12.5px; color: var(--ink-3);
}
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.receive { display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; }
.otp { display: flex; align-items: center; gap: 6px; }
.otp input, .cbox {
  width: 44px; height: 52px; border-radius: 12px; text-align: center;
  font-family: var(--mono); font-size: 20px; font-weight: 500; text-transform: uppercase;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  outline: none; caret-color: var(--accent); transition: border-color .15s, box-shadow .15s;
}
.otp input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.otp input.filled { border-color: var(--line-2); }
.otp-sep { width: 8px; height: 2px; border-radius: 2px; background: var(--line-2); margin: 0 3px; flex: none; }
.otp.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

/* ============================================================ Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 52px; padding: 0 22px; border-radius: 12px; font-weight: 500; font-size: 15px; white-space: nowrap;
  text-decoration: none; transition: transform .15s var(--ease), background .2s, opacity .2s, border-color .2s, color .2s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .4; pointer-events: none; }
.btn-dark { background: var(--btn-bg); color: var(--btn-fg); box-shadow: var(--shadow-sm); }
.btn-dark:hover { opacity: .88; }
.btn-ghost { color: var(--ink-2); border: 1px solid var(--line); background: var(--surface); }
.btn-ghost:hover { color: var(--ink); border-color: var(--line-2); }
.btn-sm { height: 36px; padding: 0 14px; border-radius: 10px; font-size: 13.5px; }
.btn-lg { width: 100%; }

/* ============================================================ Steps */
.steps {
  display: grid; grid-template-columns: repeat(3, 1fr); max-width: 920px; margin: 88px auto 0;
  border-top: 1px solid var(--line);
}
.steps li { padding: 24px 24px 0 0; }
.steps li + li { padding-left: 24px; border-left: 1px solid var(--line); }
.step-n { font-family: var(--mono); font-size: 12px; color: var(--accent); }
.steps b { display: block; margin-top: 10px; font-weight: 550; font-size: 16px; letter-spacing: -0.02em; }
.steps p { margin-top: 6px; color: var(--ink-2); font-size: 14px; }

/* ============================================================ Text compose */
.h1-sm { font-size: clamp(40px, 6.4vw, 68px); }
.compose-card {
  max-width: 720px; margin: 44px auto 0; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow);
  transition: border-color .2s, box-shadow .2s;
}
.compose-card:focus-within { border-color: var(--line-2); box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow); }
.compose-card textarea, .live-editor textarea {
  display: block; width: 100%; border: 0; outline: none; resize: vertical; background: none;
  font-size: 16px; line-height: 1.65; color: var(--ink);
}
.compose-card textarea { min-height: 240px; padding: 22px 24px; }
textarea::placeholder { color: var(--ink-3); }
.compose-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 10px 10px 20px; border-top: 1px solid var(--line); background: var(--surface-2);
}
.compose-meta { font-size: 12.5px; color: var(--ink-3); display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
.sep { margin: 0 4px; }
.kbd-hint { display: inline-flex; align-items: center; gap: 4px; }
.compose-hint { margin-top: 16px; text-align: center; font-size: 13px; color: var(--ink-3); }

.live-editor {
  margin-top: 18px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); overflow: hidden;
  transition: border-color .2s, box-shadow .2s;
}
.live-editor:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.live-editor textarea { min-height: 240px; max-height: 60vh; padding: 16px 18px; font-size: 15px; }
.editor-foot {
  display: flex; justify-content: space-between; align-items: center; padding: 8px 14px;
  border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums;
}

.text-out {
  margin-top: 18px; min-height: 140px; max-height: 58vh; overflow: auto; padding: 16px 18px; border-radius: 14px;
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: 15.5px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; outline: none;
}
.text-out:empty::before { content: 'Nothing here yet. Waiting for the sender to type…'; color: var(--ink-3); }
.text-out a { color: var(--accent); text-underline-offset: 3px; }
.text-out.flash { animation: flash .7s var(--ease); }
@keyframes flash { from { box-shadow: 0 0 0 4px var(--accent-soft); border-color: var(--accent); } }
.text-meta { margin-top: 10px; font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
#textLive.ended { color: var(--ink-3); }
#textLive.ended .chip-dot { background: var(--ink-3); box-shadow: none; }
.status[data-state="ended"] .status-icon { background: var(--surface-2); border: 1px solid var(--line); }
.status[data-state="ended"] .status-icon::after { content: ''; width: 10px; height: 10px; border-radius: 2px; background: var(--ink-3); }
.status:not([hidden]) ~ #textView:not([hidden]) { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }

/* ============================================================ Beam (signature) */
.beam {
  display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: 8px;
  max-width: 560px; margin: 0 auto 28px; padding: 0 8px;
}
.node { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 104px; }
.node-icon {
  width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  transition: border-color .3s, box-shadow .3s, color .3s;
}
.node-icon svg { width: 24px; height: 24px; }
.node-label { font-size: 13px; color: var(--ink-2); white-space: nowrap; }

.track {
  position: relative; height: 2px; margin-top: 27px; border-radius: 2px; overflow: hidden;
  background: repeating-linear-gradient(90deg, var(--line-2) 0 6px, transparent 6px 12px);
}
.track-fill {
  position: absolute; inset: 0; transform-origin: left; transform: scaleX(0);
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  transition: transform .6s var(--ease), background .3s;
}
.pulse {
  position: absolute; top: 0; bottom: 0; left: -40%; width: 40%; opacity: 0;
  background: linear-gradient(90deg, transparent, var(--accent-2), var(--accent), transparent);
}
.beam[data-state="connecting"] .pulse { opacity: .7; animation: travel 2.4s var(--ease) infinite; }
.beam[data-state="ready"] .track-fill { transform: scaleX(1); opacity: .35; }
.beam[data-state="active"] .track { overflow: visible; }
.beam[data-state="active"] .track-fill { transform: scaleX(1); opacity: .3; }
.beam[data-state="active"] .pulse {
  opacity: 1; animation: travel 1s linear infinite;
  filter: drop-shadow(0 0 6px var(--accent)) drop-shadow(0 0 14px var(--accent-2));
}
.beam[data-state="active"] .node-icon,
.beam[data-state="ready"] .node-icon { color: var(--ink); border-color: var(--line-2); }
.beam[data-state="active"] .node:last-child .node-icon { border-color: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft), var(--shadow); color: var(--accent); }
.beam[data-state="done"] .track-fill { transform: scaleX(1); background: var(--ok); }
.beam[data-state="done"] .node-icon { color: var(--ok); border-color: var(--ok); box-shadow: 0 0 0 5px var(--ok-soft), var(--shadow); }
.beam[data-state="error"] .track { background: repeating-linear-gradient(90deg, var(--err) 0 6px, transparent 6px 12px); opacity: .6; }
.beam[data-state="error"] .node:first-child .node-icon { color: var(--err); }
@keyframes travel { from { left: -40%; } to { left: 100%; } }

/* ============================================================ Panels */
.host-grid { display: grid; grid-template-columns: 360px 1fr; gap: 16px; align-items: start; }
.panel {
  padding: 24px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.eyebrow { font-size: 12.5px; color: var(--ink-3); font-weight: 500; }
h2 { margin-top: 2px; font-size: 24px; font-weight: 550; letter-spacing: -0.035em; }
.live { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ok); font-weight: 500; }

/* Share panel */
.code { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 18px 0 20px; }
.cbox { display: grid; place-items: center; width: 44px; height: 54px; font-size: 24px; background: var(--surface-2); box-shadow: none; }
.cbox:empty::after { content: ''; width: 10px; height: 2px; background: var(--line-2); border-radius: 2px; animation: blink 1.2s infinite; }
.cbox.in { animation: pop .5s var(--ease) both; }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes blink { 50% { opacity: .3; } }

.qr-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 20px;
  border-radius: 16px; background: var(--surface-2);
}
.qr { width: 168px; height: 168px; padding: 12px; border-radius: 12px; background: #fff; box-shadow: var(--shadow-sm); }
.qr svg { width: 100%; height: 100%; display: block; }
.qr svg path { fill: #171615; }
.qr-skeleton { display: block; width: 100%; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #eeece8, #f7f6f3, #eeece8); background-size: 200% 100%; animation: sheen 1.3s infinite; }
@keyframes sheen { to { background-position: -200% 0; } }
.qr-caption { font-size: 12.5px; color: var(--ink-3); }

.link-row {
  display: flex; align-items: center; gap: 6px; margin-top: 14px; padding: 4px 4px 4px 14px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
}
.link-row input { flex: 1; min-width: 0; border: 0; outline: none; background: none; font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); text-overflow: ellipsis; }

/* Files */
.files { display: grid; gap: 6px; margin-top: 18px; max-height: 296px; overflow: auto; }
.file {
  --p: 0%;
  position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 10px;
  border-radius: 12px; background: var(--surface-2); overflow: hidden; isolation: isolate;
}
.file::after {
  content: ''; position: absolute; left: 0; bottom: 0; height: 2px; width: var(--p); z-index: 1;
  background: linear-gradient(90deg, var(--accent-2), var(--accent)); transition: width .15s linear;
}
.file.done::after { width: 100%; background: var(--ok); }
.ext {
  --h: var(--ink-2);
  flex: none; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  font-family: var(--mono); font-size: 10px; font-weight: 500; text-transform: uppercase; letter-spacing: .02em;
  color: var(--h); background: var(--surface); border: 1px solid var(--line);
}
.ext[data-kind="image"] { --h: #d9467a; }
.ext[data-kind="video"] { --h: #7c5cff; }
.ext[data-kind="audio"] { --h: #0ea5a5; }
.ext[data-kind="doc"] { --h: #2f6fe4; }
.ext[data-kind="archive"] { --h: #c2780a; }
.ext[data-kind="code"] { --h: #17a34a; }
.file-info { flex: 1; min-width: 0; }
.file-name { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-size { font-size: 12.5px; color: var(--ink-3); font-family: var(--mono); }
.file-save {
  flex: none; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 9px;
  font-size: 13px; font-weight: 500; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-2); transition: border-color .2s;
  animation: pop .4s var(--ease) both;
}
.file-save:hover { border-color: var(--ink-3); }

/* Receivers */
.section-label { display: flex; align-items: center; gap: 8px; margin: 26px 0 10px; }
.count {
  font-family: var(--mono); font-size: 11px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  display: inline-grid; place-items: center; background: var(--surface-2); color: var(--ink-2);
}
.peers { display: grid; gap: 6px; }
.empty {
  display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 12px;
  border: 1px dashed var(--line-2); color: var(--ink-3); font-size: 14px;
}
.radar { position: relative; width: 12px; height: 12px; flex: none; }
.radar::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--accent); }
.radar i { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid var(--accent); animation: ping 2s cubic-bezier(0,0,.2,1) infinite; }
.radar i:nth-child(2) { animation-delay: 1s; }
@keyframes ping { from { transform: scale(.4); opacity: 1; } to { transform: scale(2.6); opacity: 0; } }

.peer {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; column-gap: 12px; row-gap: 2px;
  padding: 12px; border-radius: 12px; border: 1px solid var(--line); animation: enter .4s var(--ease) both;
}
.avatar {
  grid-row: span 2; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--ink-2);
  background: var(--surface-2); border: 1px solid var(--line);
}
.peer-name { font-size: 14px; font-weight: 500; }
.peer-pct { font-family: var(--mono); font-size: 12.5px; color: var(--ink-3); text-align: right; }
.peer-status { grid-column: 2 / 4; font-size: 12.5px; color: var(--ink-3); }
.peer .bar { grid-column: 1 / 4; margin-top: 10px; }
.peer[data-state="sending"] .avatar { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.peer[data-state="done"] .avatar { color: var(--ok); border-color: var(--ok); background: var(--ok-soft); }
.peer[data-state="done"] .peer-status { color: var(--ok); }
.peer[data-state="done"] .bar i { background: var(--ok); }
.peer[data-state="failed"] .peer-status, .peer[data-state="left"] .peer-status { color: var(--err); }
.peer[data-state="connecting"] .bar, .peer[data-state="waiting"] .bar, .peer[data-state="live"] .bar { display: none; }

.bar { height: 4px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.bar i {
  display: block; height: 100%; width: 0; border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-2), var(--accent)); transition: width .15s linear;
}

.note {
  display: flex; align-items: center; gap: 8px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line);
  font-size: 13px; color: var(--ink-3);
}
.note svg { flex: none; }

/* ============================================================ Receiver */
.status { display: flex; align-items: center; gap: 14px; }
.status b { display: block; font-size: 17px; font-weight: 550; letter-spacing: -0.025em; }
.status div > span { display: block; font-size: 14px; color: var(--ink-2); }
.status-icon { flex: none; position: relative; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; }
.status[data-state="busy"] .status-icon { border: 2px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.status[data-state="error"] .status-icon { background: var(--err-soft); }
.status[data-state="error"] .status-icon::after { content: '!'; color: var(--err); font-weight: 700; font-size: 18px; }
.status[data-state="done"] .status-icon { background: var(--ok-soft); animation: pop .5s var(--ease) both; }
.status[data-state="done"] .status-icon::after {
  content: ''; width: 14px; height: 8px; border-left: 2px solid var(--ok); border-bottom: 2px solid var(--ok);
  transform: translateY(-2px) rotate(-45deg);
}
.status:not([hidden]) ~ #offer:not([hidden]) { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }

.overall { margin-top: 20px; }
.overall-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; }
#overallPct { font-size: 28px; font-weight: 500; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
#overallMeta { font-family: var(--mono); font-size: 12px; color: var(--ink-3); text-align: right; }
.overall .bar { height: 6px; }
.overall.done .bar i { background: var(--ok); }
.actions { display: grid; gap: 8px; margin-top: 20px; }
.back { margin-top: 12px; }

/* ============================================================ Security & controls */
.ico { display: inline-grid; place-items: center; flex: none; }
.btn-xs { height: 30px; padding: 0 12px; border-radius: 8px; font-size: 13px; gap: 6px; }

.security { display: grid; gap: 8px; margin-top: 16px; }
.security li { display: flex; gap: 9px; align-items: flex-start; font-size: 12.5px; color: var(--ink-3); line-height: 1.45; }
.security svg { flex: none; margin-top: 1px; color: var(--ink-2); }
.security b { color: var(--ink-2); font-weight: 550; }

.live.offline { color: var(--ink-3); }
.live.offline .chip-dot { background: var(--ink-3); box-shadow: none; animation: blink 1.2s infinite; }

.trust {
  display: flex; align-items: center; justify-content: center; gap: 7px; flex-wrap: wrap; margin: -12px auto 18px;
  font-size: 12.5px; color: var(--ink-2); text-align: center;
}
.trust b { font-family: var(--mono); font-weight: 500; letter-spacing: .04em; color: var(--ink); }
.trust.ok { color: var(--ok); }

.sas-big {
  margin-top: 18px; padding: 18px; border-radius: 14px; text-align: center;
  background: var(--surface-2); border: 1px solid var(--line);
}
.sas-big span { display: block; font-size: 12.5px; color: var(--ink-3); }
.sas-big b { display: block; margin: 4px 0; font-family: var(--mono); font-size: 30px; font-weight: 500; letter-spacing: .12em; }
.sas-big small { display: block; font-size: 12.5px; color: var(--ink-3); }
.status[data-state="approval"] .status-icon { border: 2px solid var(--line); border-top-color: var(--accent); animation: spin 1.4s linear infinite; }

.peer-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.peer-badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px 1px 5px; border-radius: 999px;
  font-family: var(--mono); font-size: 11px; font-weight: 500; color: var(--ink-2); background: var(--surface-2);
}
.peer-badge:empty { display: none; }
.peer-badge.ok { font-family: var(--sans); color: var(--ok); background: var(--ok-soft); }
.peer-actions { grid-column: 1 / 4; display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.peer-actions:empty { display: none; }
.peer[data-state="pending"] .peer-actions, .peer .bar + .peer-actions:not(:empty) { margin-top: 12px; }
.peer-actions .sas { margin-right: auto; display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; color: var(--ink-3); }
.peer-actions .sas b { font-family: var(--mono); font-size: 18px; font-weight: 500; letter-spacing: .08em; color: var(--ink); }
.peer[data-state="pending"] { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.peer[data-state="pending"] .bar, .peer[data-state="failed"] .bar, .peer[data-state="left"] .bar { display: none; }
.peer[data-state="paused"] .bar i, .peer[data-state="reconnecting"] .bar i { background: var(--ink-3); }
.peer[data-state="reconnecting"] .peer-status { color: var(--accent); }

.file-saved { flex: none; display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 500; color: var(--ok); }
.save-note { margin-top: 10px; font-size: 12.5px; color: var(--ink-3); }
.save-note.warn { color: var(--err); }
.overall.paused .bar i { background: var(--ink-3); }

/* ============================================================ Blocked-network help */
.help { margin-top: 18px; padding: 16px 18px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); font-size: 14px; }
.help b { font-weight: 550; }
.help ul { margin: 8px 0 10px; padding-left: 18px; list-style: disc; color: var(--ink-2); display: grid; gap: 4px; }
.help-link { font-size: 13px; color: var(--accent); text-decoration: none; }
.help-link:hover { text-decoration: underline; }
.chip-link { text-decoration: none; transition: border-color .2s, color .2s; }
.chip-link:hover { color: var(--ink); border-color: var(--line-2); }

/* ============================================================ Security page */
.sec-flow {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px;
  max-width: 760px; margin: 48px auto 0;
}
.flow-node { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.flow-node .node-icon { color: var(--ink); }
.flow-mid { display: grid; gap: 26px; }
.flow-line { position: relative; display: block; height: 2px; border-radius: 2px; }
.flow-line b {
  position: absolute; left: 50%; top: -24px; transform: translateX(-50%); white-space: nowrap;
  font-size: 12.5px; font-weight: 500;
}
.flow-line.direct { background: linear-gradient(90deg, var(--accent-2), var(--accent)); box-shadow: 0 0 12px var(--accent-soft); }
.flow-line.direct b { color: var(--accent); }
.flow-line.handshake { background: repeating-linear-gradient(90deg, var(--line-2) 0 6px, transparent 6px 12px); }
.flow-line.handshake b { color: var(--ink-3); font-weight: 400; }

.sec-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; max-width: 980px; margin: 56px auto 0; }
.sec-card {
  padding: 22px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.sec-ico {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
  color: var(--accent); background: var(--accent-soft);
}
.sec-ico svg { width: 18px; height: 18px; }
.sec-card h3 { margin-top: 14px; font-size: 16px; font-weight: 550; letter-spacing: -0.02em; }
.sec-card p { margin-top: 6px; font-size: 14px; color: var(--ink-2); line-height: 1.55; }
code { font-family: var(--mono); font-size: .9em; padding: 1px 5px; border-radius: 5px; background: var(--surface-2); }

.sees { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 980px; margin: 14px auto 0; }
.sees-col { padding: 22px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface-2); }
.sees-col h3 { font-size: 15px; font-weight: 550; letter-spacing: -0.02em; }
.sees-col ul { margin-top: 12px; display: grid; gap: 8px; }
.sees-col li { position: relative; padding-left: 24px; font-size: 14px; color: var(--ink-2); }
.sees-col li::before {
  content: ''; position: absolute; left: 2px; top: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3);
}
.sees-col.never { background: var(--ok-soft); border-color: transparent; }
.sees-col.never li::before {
  width: 10px; height: 5px; border-radius: 0; background: none; top: 6px;
  border-left: 2px solid var(--ok); border-bottom: 2px solid var(--ok); transform: rotate(-45deg);
}

.limits { max-width: 980px; margin: 72px auto 0; }
.limits h2 { font-size: 28px; }
.limits dl { margin-top: 18px; border-top: 1px solid var(--line); }
.limits dl > div { display: grid; grid-template-columns: 300px 1fr; gap: 24px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.limits dt { font-weight: 550; font-size: 15px; letter-spacing: -0.015em; }
.limits dd { color: var(--ink-2); font-size: 14.5px; }
.sec-cta { display: flex; justify-content: center; gap: 10px; margin-top: 48px; }

.foot-links { display: inline-flex; align-items: center; gap: 18px; flex-wrap: wrap; justify-content: center; }
.foot-links a { color: var(--ink-2); text-decoration: none; }
.foot-links a:hover { color: var(--ink); }

/* ============================================================ Footer & toast */
.foot {
  width: 100%; max-width: 1120px; margin: 0 auto; padding: 24px; display: flex; justify-content: space-between; gap: 12px;
  align-items: center; font-size: 13px; color: var(--ink-3); border-top: 1px solid var(--line);
}
.brand-sm { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink-2); letter-spacing: -0.02em; }
.brand-sm .mark { width: 18px; height: 18px; border-radius: 5px; }
.brand-sm .mark i { width: 4px; height: 4px; }
.brand-sm .mark i:first-child { left: 3px; bottom: 3px; }
.brand-sm .mark i:last-child { right: 3px; top: 3px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 10; transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 500;
  background: var(--btn-bg); color: var(--btn-fg); box-shadow: 0 12px 32px -8px rgba(0,0,0,.35);
  transition: opacity .25s, transform .3s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ============================================================ Responsive */
@media (max-width: 880px) {
  .host-grid { grid-template-columns: 1fr; }
  .sec-grid { grid-template-columns: 1fr 1fr; }
  .share-panel { order: -1; }
}
@media (max-width: 640px) {
  .top { padding: 16px; grid-template-columns: auto 1fr; }
  .top-right { display: none; }
  .tabs { justify-self: end; }
  .tab { padding: 0 11px; }
  .compose-card textarea { min-height: 200px; padding: 18px; }
  .kbd-hint { display: none; }
  main { padding: 28px 16px 48px; }
  .lede { font-size: 16px; }
  .drop { margin-top: 36px; padding: 36px 16px 28px; }
  .drop-meta { display: none; }
  .otp input, .cbox { width: 40px; height: 48px; font-size: 18px; }
  .receive .btn { width: 100%; max-width: 290px; }
  .steps { grid-template-columns: 1fr; margin-top: 56px; }
  .steps li, .steps li + li { padding: 20px 0; border-left: 0; }
  .steps li + li { border-top: 1px solid var(--line); }
  .panel { padding: 18px; }
  .node { width: 84px; }
  .foot { flex-direction: column; text-align: center; }
  .sec-grid, .sees { grid-template-columns: 1fr; }
  .limits dl > div { grid-template-columns: 1fr; gap: 4px; }
  .sec-flow { gap: 10px; }
  .flow-line b { font-size: 11px; white-space: normal; width: 100%; left: 0; transform: none; text-align: center; top: -30px; }
  .flow-mid { gap: 40px; padding-top: 18px; }
}
@media (max-width: 380px) {
  .otp input, .cbox { width: 36px; height: 46px; }
  .otp { gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
