/* "Gothic Romance" palette: #0A0908 #49111C #F2F4F3 #A9927D #5E503F */
:root {
  color-scheme: light dark;
  --radius: 18px; --ease: cubic-bezier(.2, .8, .2, 1); --spring: cubic-bezier(.34, 1.56, .64, 1);
  --nav-h: 0px;
  --gold: #A9927D; --on-gold: #0A0908;
  --bg: #F2F4F3; --surface: rgba(250, 248, 246, .86); --surface-solid: #FAF8F6; --surface-2: #E9E3DC;
  --fg: #0A0908; --muted: #5E503F; --border: rgba(94, 80, 63, .18);
  --primary: #49111C; --on-primary: #F2F4F3; --primary-soft: #F1E6E3; --primary-soft-fg: #49111C;
  --grad: linear-gradient(135deg, #2A0910 0%, #49111C 50%, #6E1E2C 100%);
  --gt-color: transparent; --gt-bg: linear-gradient(90deg, #49111C 0%, #8A2A3B 100%); --gt-clip: text;
  --amber: var(--gold); --on-amber: var(--on-gold);
  --success: #2F7A55; --danger: #C2410C; --ring: #49111C;
  --dot: rgba(94, 80, 63, .10); --glow-1: rgba(169, 146, 125, .35); --glow-2: rgba(73, 17, 28, .10);
  --shadow: 0 1px 2px rgba(10, 9, 8, .05), 0 10px 28px -16px rgba(10, 9, 8, .32);
  --glow: 0 8px 22px -10px rgba(73, 17, 28, .55);
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0A0908; --surface: rgba(22, 19, 17, .76); --surface-solid: #161311; --surface-2: #221C18;
  --fg: #F2F4F3; --muted: #A9927D; --border: rgba(169, 146, 125, .16);
  --primary: #8A2A3B; --on-primary: #F2F4F3; --primary-soft: rgba(138, 42, 59, .22); --primary-soft-fg: #D9C3B0;
  --grad: linear-gradient(135deg, #49111C 0%, #5A1522 45%, #8A2A3B 100%);
  --gt-color: transparent; --gt-bg: linear-gradient(90deg, #A9927D 0%, #E3D3C4 100%); --gt-clip: text;
  --gold: #A9927D; --on-gold: #0A0908;
  --success: #7DD3A8; --danger: #FF8A65; --ring: #A9927D;
  --dot: rgba(242, 244, 243, .045); --glow-1: rgba(73, 17, 28, .6); --glow-2: rgba(94, 80, 63, .35);
  --shadow: 0 10px 30px -14px rgba(0, 0, 0, .8);
  --glow: 0 8px 22px -10px rgba(138, 42, 59, .6);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0A0908; --surface: rgba(22, 19, 17, .76); --surface-solid: #161311; --surface-2: #221C18;
    --fg: #F2F4F3; --muted: #A9927D; --border: rgba(169, 146, 125, .16);
    --primary: #8A2A3B; --on-primary: #F2F4F3; --primary-soft: rgba(138, 42, 59, .22); --primary-soft-fg: #D9C3B0;
    --grad: linear-gradient(135deg, #49111C 0%, #5A1522 45%, #8A2A3B 100%);
    --gt-color: transparent; --gt-bg: linear-gradient(90deg, #A9927D 0%, #E3D3C4 100%); --gt-clip: text;
    --gold: #A9927D; --on-gold: #0A0908;
    --success: #7DD3A8; --danger: #FF8A65; --ring: #A9927D;
    --dot: rgba(242, 244, 243, .045); --glow-1: rgba(73, 17, 28, .6); --glow-2: rgba(94, 80, 63, .35);
    --shadow: 0 10px 30px -14px rgba(0, 0, 0, .8);
    --glow: 0 8px 22px -10px rgba(138, 42, 59, .6);
  }
}
/* smooth cross-fade when the theme is switched */
:root.theme-anim, :root.theme-anim * {
  transition: background-color .4s var(--ease), color .4s var(--ease), border-color .4s var(--ease), fill .4s, stroke .4s !important;
}
.top-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 40px; height: 40px; min-height: 40px; padding: 0; border-radius: 999px; background: var(--surface);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); color: var(--fg); }
.icon-btn svg.i { width: 19px; height: 19px; }
.icon-btn.spin svg.i { animation: themeSpin .5s var(--spring); }
@keyframes themeSpin { from { transform: rotate(-90deg) scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg); min-height: 100vh; overflow-x: hidden;
  font: 16px/1.5 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
           calc(var(--nav-h) + max(28px, env(safe-area-inset-bottom))) max(16px, env(safe-area-inset-left));
}
svg.i { width: 20px; height: 20px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

/* ---------- background: dot grid ("local network") + two soft glows ---------- */
.backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  background-image: radial-gradient(var(--dot) 1.2px, transparent 1.3px); background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 40%, transparent 100%);
          mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 40%, transparent 100%); }
.backdrop::before, .backdrop::after { content: ""; position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%;
  filter: blur(60px); will-change: transform; }
.backdrop::before { background: var(--glow-1); top: -32vmax; left: -18vmax; animation: drift1 24s ease-in-out infinite alternate; }
.backdrop::after { background: var(--glow-2); top: -28vmax; right: -24vmax; animation: drift2 28s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(10vmax, 6vmax); } }
@keyframes drift2 { to { transform: translate(-8vmax, 8vmax); } }

/* ---------- privacy panel ---------- */
.card.trust { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; padding: 0; overflow: hidden; }
.trust-item { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; padding: 16px 18px;
  border-left: 1px solid var(--border); animation: popIn .5s var(--spring) both; }
.trust-item:first-child { border-left: 0; }
.trust-item:nth-child(2) { animation-delay: .08s; }
.trust-item:nth-child(3) { animation-delay: .16s; }
.trust-item .ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary-soft-fg); }
.trust-item strong { display: block; font-size: .93rem; line-height: 1.3; }
.trust-item span.muted { font-size: .82rem; line-height: 1.4; display: block; margin-top: 2px; }
.trust-foot { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  flex-wrap: wrap; padding: 10px 18px; border-top: 1px solid var(--border); background: var(--primary-soft);
  font-size: .82rem; color: var(--primary-soft-fg); font-weight: 600; }
.trust-foot a { color: inherit; }
.live { display: inline-flex; align-items: center; gap: 6px; }
.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--success);
  box-shadow: 0 0 0 0 var(--success); animation: livePulse 2s infinite; }
@keyframes livePulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--success) 60%, transparent); }
  100% { box-shadow: 0 0 0 7px transparent; } }
.secure-tag { display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; font-weight: 650;
  color: var(--primary-soft-fg); background: var(--primary-soft); border-radius: 99px; padding: 3px 9px; width: fit-content; }
.secure-tag svg.i { width: 13px; height: 13px; }
@media (max-width: 640px) {
  .card.trust { grid-template-columns: 1fr; }
  .trust-item { border-left: 0; border-top: 1px solid var(--border); padding: 12px 16px; }
  .trust-item:first-child { border-top: 0; }
}

/* ---------- layout ---------- */
.shell { max-width: 760px; margin: 0 auto; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0 18px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.3rem; letter-spacing: -.02em;
  color: inherit; text-decoration: none; }
.logo { width: 40px; height: 40px; flex-shrink: 0; filter: drop-shadow(0 6px 12px rgba(10, 9, 8, .35)); }
.logo .drop { transform-origin: 32px 40px; animation: dropBob 3.4s var(--ease) infinite; }
@keyframes dropBob { 0%, 70%, 100% { transform: none; } 80% { transform: translateY(1.5px) scale(1.05, .95); } 90% { transform: translateY(-1px); } }
.wordmark span { color: var(--gt-color); background: var(--gt-bg); -webkit-background-clip: var(--gt-clip); background-clip: var(--gt-clip); -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.pill { display: inline-flex; align-items: center; gap: 8px; font-size: .82rem; font-weight: 600; color: var(--muted);
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 7px 12px;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); position: relative; }
.pill.online .dot { background: var(--success); }
.pill.online .dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--success);
  animation: ping 2s var(--ease) infinite; }

/* ---------- navigation ---------- */
.nav { position: relative; display: flex; gap: 4px; padding: 5px; margin: 0 auto 18px; width: fit-content;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px; box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); z-index: 20; }
.nav-indicator { position: absolute; top: 5px; left: 0; height: calc(100% - 10px); width: 0; border-radius: 999px;
  background: var(--grad); box-shadow: var(--glow); transition: transform .35s var(--spring), width .35s var(--spring); }
.nav-link { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px;
  border-radius: 999px; color: var(--muted); font-weight: 600; font-size: .92rem; text-decoration: none;
  transition: color .25s var(--ease); -webkit-tap-highlight-color: transparent; min-height: 40px; }
.nav-link:hover { color: var(--fg); }
.nav-link[aria-current="page"] { color: var(--on-primary); }
.nav-link svg.i { width: 18px; height: 18px; }
.badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--amber); color: var(--on-amber);
  font-size: .7rem; font-weight: 700; display: inline-grid; place-items: center; line-height: 1; }
.badge.bump { animation: bump .45s var(--spring); }
@keyframes bump { 0% { transform: scale(.4); } 100% { transform: scale(1); } }

@media (max-width: 640px) {
  :root { --nav-h: 72px; }
  .nav { position: fixed; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); margin: 0;
    width: auto; justify-content: space-between; border-radius: 22px; padding: 6px; }
  .nav-indicator { top: 6px; height: calc(100% - 12px); border-radius: 16px; }
  .nav-link { flex: 1; flex-direction: column; gap: 3px; padding: 8px 4px; font-size: .72rem; border-radius: 16px; }
  .nav-link svg.i { width: 22px; height: 22px; }
  .nav-link .badge { position: absolute; top: 4px; left: calc(50% + 6px); }
}

/* ---------- views ---------- */
.view { display: grid; gap: 16px; }
.view.enter { animation: viewIn .4s var(--ease) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
h1 { font-size: clamp(1.6rem, 5vw, 2.2rem); line-height: 1.15; letter-spacing: -.03em; margin: 0 0 8px; }
h2 { font-size: 1.02rem; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.grad-text { color: var(--gt-color); background: var(--gt-bg); -webkit-background-clip: var(--gt-clip); background-clip: var(--gt-clip); -webkit-box-decoration-break: clone; box-decoration-break: clone; padding: 0 .06em; }
.muted { color: var(--muted); font-size: .9rem; }
.count { font-size: .78rem; font-weight: 700; color: var(--primary-soft-fg); background: var(--primary-soft);
  border-radius: 99px; padding: 2px 9px; margin-left: 6px; }

/* ---------- buttons ---------- */
button, .btn {
  font: inherit; font-size: .93rem; font-weight: 650; line-height: 1.2; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface-solid); color: var(--fg);
  padding: 10px 15px; min-height: 44px; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), background-color .2s var(--ease), border-color .2s var(--ease);
  -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none;
}
button:hover, .btn:hover { border-color: color-mix(in srgb, var(--primary) 40%, transparent); transform: translateY(-1px); }
button:active, .btn:active { transform: translateY(0) scale(.97); }
.btn-primary { background: var(--grad); background-size: 150% 150%; border-color: transparent; color: var(--on-primary); box-shadow: var(--glow); }
.btn-primary:hover { border-color: transparent; background-position: 100% 0; box-shadow: 0 12px 26px -10px color-mix(in srgb, var(--primary) 70%, transparent); }
.btn-danger { color: var(--danger); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--primary-soft-fg); padding: 6px 10px; min-height: 36px; }
.btn-ghost:hover { background: var(--primary-soft); border-color: transparent; transform: none; }
button:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: default; transform: none; box-shadow: none; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 3px; }

input, textarea {
  font: inherit; font-size: 16px; color: var(--fg); background: var(--surface-solid);
  border: 1px solid var(--border); border-radius: 12px; padding: 11px 13px; width: 100%;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
input:focus, textarea:focus { border-color: var(--ring); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ring) 22%, transparent); }
textarea { min-height: 120px; resize: vertical; }
label.field { display: block; font-size: .88rem; font-weight: 650; margin-bottom: 6px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row > .grow { flex: 1 1 160px; }

/* ---------- devices ---------- */
#peers { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.device-actions .btn, .device-actions button { white-space: nowrap; padding-left: 12px; padding-right: 12px; }
.device { position: relative; border: 1px solid var(--border); border-radius: 16px; padding: 14px;
  background: var(--surface-solid); display: grid; gap: 12px;
  transition: border-color .2s var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease);
  animation: popIn .45s var(--spring) both; animation-delay: calc(var(--i, 0) * 60ms); }
.device:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.device.leaving { animation: popOut .22s var(--ease) both; }
.device.drag { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 20%, transparent); }
@keyframes popIn { from { opacity: 0; transform: scale(.92) translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes popOut { to { opacity: 0; transform: scale(.92); } }
.device-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.avatar { width: 46px; height: 46px; border-radius: 14px; background: var(--grad); color: var(--on-primary);
  display: grid; place-items: center; flex-shrink: 0; box-shadow: var(--glow); }
.avatar svg.i { width: 22px; height: 22px; }
.device-name { font-weight: 700; overflow-wrap: anywhere; line-height: 1.3; }
.device-kind { font-size: .8rem; color: var(--muted); }
.device-actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; }

/* radar empty state */
.empty { text-align: center; padding: 10px 12px 18px; }
.radar { position: relative; width: 150px; height: 150px; margin: 6px auto 16px; display: grid; place-items: center; }
.radar .ring { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid var(--primary); opacity: 0;
  animation: ping 3s var(--ease) infinite; }
.radar .ring:nth-child(2) { animation-delay: 1s; }
.radar .ring:nth-child(3) { animation-delay: 2s; }
.radar .sweep { position: absolute; inset: 8px; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 75%, color-mix(in srgb, var(--primary) 35%, transparent) 100%);
  animation: spin 3s linear infinite; }
.radar .core { position: relative; width: 62px; height: 62px; border-radius: 50%; background: var(--grad); color: var(--on-primary);
  display: grid; place-items: center; box-shadow: var(--glow); }
.radar .core svg.i { width: 26px; height: 26px; }
@keyframes ping { 0% { transform: scale(.45); opacity: .7; } 100% { transform: scale(1.05); opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- lists & transfers ---------- */
.list { display: grid; }
.entry { display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 14px 0; border-top: 1px solid var(--border);
  animation: slideIn .35s var(--ease) both; }
.entry:first-child { border-top: 0; padding-top: 0; }
.entry:last-child { padding-bottom: 0; }
@keyframes slideIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.entry-icon { width: 42px; height: 42px; border-radius: 12px; background: var(--primary-soft); color: var(--primary-soft-fg);
  display: grid; place-items: center; overflow: hidden; }
.entry-icon img { width: 100%; height: 100%; object-fit: cover; }
.entry-icon.done { background: color-mix(in srgb, var(--success) 16%, transparent); color: var(--success); }
.entry-icon.done svg.i { animation: checkPop .5s var(--spring) both; }
.entry-icon.failed { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
@keyframes checkPop { from { transform: scale(0) rotate(-30deg); } to { transform: none; } }
.entry-body { min-width: 0; display: grid; gap: 6px; }
.entry-title { font-weight: 650; overflow-wrap: anywhere; line-height: 1.35; }
.status { font-size: .875rem; color: var(--muted); }
.status.err { color: var(--danger); }
.status.ok { color: var(--success); font-weight: 600; }
.bar { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar > div { position: relative; height: 100%; width: 0; background: var(--grad); border-radius: 99px;
  transition: width .25s linear; overflow: hidden; }
.bar > div::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .45), transparent);
  transform: translateX(-100%); animation: shimmer 1.3s linear infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.text-box { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface-solid); border: 1px solid var(--border);
  border-radius: 12px; padding: 10px 12px; margin: 0; font: inherit; font-size: .95rem; max-height: 240px; overflow: auto; }
.inbox-empty { text-align: center; padding: 26px 12px; }
.inbox-empty .big { width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 20px; background: var(--primary-soft);
  color: var(--primary-soft-fg); display: grid; place-items: center; animation: float 4s ease-in-out infinite; }
.inbox-empty .big svg.i { width: 28px; height: 28px; }
@keyframes float { 50% { transform: translateY(-6px); } }

/* ---------- incoming request toast ---------- */
#toasts { position: fixed; z-index: 30; left: 50%; transform: translateX(-50%); width: min(460px, calc(100% - 24px));
  bottom: calc(var(--nav-h) + max(16px, env(safe-area-inset-bottom))); display: grid; gap: 10px; }
.toast { background: var(--surface-solid); border: 1px solid var(--border); border-radius: 18px; padding: 14px;
  box-shadow: 0 22px 50px -14px rgba(10, 9, 8, .45); display: grid; grid-template-columns: auto 1fr; gap: 12px;
  animation: toastIn .45s var(--spring) both; }
.toast.leaving { animation: toastOut .22s var(--ease) both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(24px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(16px) scale(.97); } }
.toast .avatar { width: 42px; height: 42px; animation: wiggle 1.6s ease-in-out .4s 2; }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-8deg); } 75% { transform: rotate(8deg); } }

/* ---------- collapsible help / FAQ ---------- */
details > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; font-weight: 700; min-height: 24px; }
details > summary::-webkit-details-marker { display: none; }
details > summary .chev { transition: transform .3s var(--spring); color: var(--muted); }
details[open] > summary .chev { transform: rotate(180deg); }
details[open] > .help-body, details[open] > .faq-body { animation: viewIn .3s var(--ease) both; }
.help-body { margin-top: 14px; display: grid; gap: 12px; }
.help-list { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.error-text { color: var(--danger); font-size: .875rem; margin: 0; min-height: 1.2em; }

/* ---------- support & about ---------- */
.hero { text-align: center; padding: 30px 20px; }
.hero p { max-width: 520px; margin: 0 auto; }
.heart { width: 76px; height: 76px; margin: 0 auto 18px; border-radius: 24px; display: grid; place-items: center; color: #F2F4F3;
  background: linear-gradient(135deg, #2A0910, #49111C 45%, #8A2A3B); box-shadow: 0 12px 30px -10px rgba(73, 17, 28, .6);
  animation: beat 1.8s ease-in-out infinite; }
.heart svg.i { width: 34px; height: 34px; fill: currentColor; }
@keyframes beat { 0%, 40%, 100% { transform: scale(1); } 15% { transform: scale(1.12); } 25% { transform: scale(.98); } }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; counter-reset: step; }
.step { position: relative; padding: 18px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface-solid); }
.step::before { counter-increment: step; content: counter(step); width: 30px; height: 30px; border-radius: 10px;
  background: var(--grad); color: var(--on-primary); font-weight: 800; display: grid; place-items: center; margin-bottom: 10px; }
.step strong { display: block; margin-bottom: 4px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.feature { display: grid; gap: 6px; }
.feature .ic { width: 40px; height: 40px; border-radius: 12px; background: var(--primary-soft); color: var(--primary-soft-fg);
  display: grid; place-items: center; }
.faq { border-top: 1px solid var(--border); padding: 14px 0; }
.faq:first-of-type { border-top: 0; padding-top: 0; }
.faq-body { margin: 10px 0 0; color: var(--muted); }
.stagger > * { animation: popIn .5s var(--spring) both; }
.stagger > *:nth-child(2) { animation-delay: .07s; }
.stagger > *:nth-child(3) { animation-delay: .14s; }
.stagger > *:nth-child(4) { animation-delay: .21s; }

.footnote { display: flex; align-items: center; justify-content: center; gap: 8px; text-align: center;
  color: var(--muted); font-size: .84rem; margin: 6px 0 0; }
.footnote svg.i { width: 16px; height: 16px; }

@media (max-width: 420px) {
  .card { padding: 16px; }
  #peers { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    animation-delay: 0s !important; transition-duration: .01ms !important; }
  .radar .ring, .radar .sweep { display: none; }
}

/* ---------- production additions ---------- */
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--surface-solid); color: var(--fg);
  padding: 10px 14px; border-radius: 10px; border: 1px solid var(--border); font-weight: 650; }
.skip:focus { top: 12px; }
.intro { text-align: center; padding: 4px 8px 2px; }
.intro h1 { font-size: clamp(1.45rem, 4.6vw, 2.05rem); margin: 0 0 6px; }
.intro p { margin: 0; }
.display { font-size: clamp(1.6rem, 5vw, 2.2rem); line-height: 1.15; letter-spacing: -.03em; margin: 0 0 8px; font-weight: 800; }
.identity { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.identity strong { color: var(--fg); }
#rename-form { margin-bottom: 16px; }
.empty-title { font-weight: 700; font-size: 1.05rem; }
.mt-12 { margin-top: 12px; }
.m-0 { margin: 0; }
.small { font-size: .82rem; }
.received-note { margin: -8px 0 14px; }
.help-note { margin: -6px 0 12px; }
#share-status { margin-left: 8px; }
ol.steps, ul.features, ul.plain { list-style: none; margin: 0; padding: 0; }
ul.plain { margin-top: 8px; display: grid; gap: 6px; }
ul.plain li { position: relative; padding-left: 18px; color: var(--muted); font-size: .92rem; }
ul.plain li::before { content: ""; position: absolute; left: 2px; top: .6em; width: 7px; height: 7px; border-radius: 50%;
  background: var(--primary); opacity: .7; }
.privacy-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin-bottom: 12px; }
.ok-text { color: var(--success); }
.footer { text-align: center; padding: 18px 0 6px; display: grid; gap: 8px; }
.footer-links { display: flex; justify-content: center; gap: 18px; font-size: .88rem; font-weight: 600; }
.footer-links a { color: var(--primary-soft-fg); text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.footer .small { margin: 0; }
.warn { color: var(--danger); font-size: .84rem; font-weight: 600; }
noscript .card { margin-bottom: 16px; }

/* ---------- tip card & use cases ---------- */
.tip-card { display: grid; gap: 14px; justify-items: start; }
.tip-row { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; }
.tip-row .ic { width: 44px; height: 44px; border-radius: 12px; background: var(--primary-soft); color: var(--primary-soft-fg);
  display: grid; place-items: center; }
.tip-row strong { display: block; font-size: 1.02rem; }
.tip-btn { min-width: 200px; font-size: 1rem; padding: 12px 22px; }
.tip-btn svg.i { animation: beat 1.8s ease-in-out infinite; }
ul.uses { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 520px) { ul.uses { grid-template-columns: 1fr; } }
ul.uses li { padding: 14px 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-solid); }
ul.uses h3 { font-size: .98rem; margin: 0 0 4px; }
ul.uses p { margin: 0; font-size: .9rem; }

/* ---------- connect guide ---------- */
.connect-guide { margin: 22px auto 0; max-width: 460px; text-align: left; padding: 18px; border-radius: 16px;
  border: 1px solid var(--border); background: var(--surface-solid); display: grid; gap: 14px; justify-items: start; }
.connect-guide h3 { font-size: .98rem; margin: 0; }
ol.connect-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; width: 100%; }
ol.connect-steps li { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; }
ol.connect-steps .num { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800;
  font-size: .85rem; background: var(--primary-soft); color: var(--primary-soft-fg); }
ol.connect-steps li.done .num { background: var(--grad); color: var(--on-primary); }
ol.connect-steps .num svg.i { width: 15px; height: 15px; stroke-width: 3; }
ol.connect-steps strong { display: block; font-size: .93rem; line-height: 1.35; }
ol.connect-steps strong + .muted { display: block; font-size: .84rem; margin-top: 1px; }
.site-addr { font-weight: 800; }
.peers-hint { display: flex; align-items: center; gap: 8px; margin: 14px 0 0; font-size: .86rem; }
.peers-hint svg.i { width: 16px; height: 16px; flex-shrink: 0; }

/* ---------- Ko-fi tip panel ---------- */
.tip-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tip-panel { position: relative; width: 100%; border-radius: 14px; overflow: hidden; background: #F9F9F9;
  border: 1px solid var(--border); min-height: 200px; animation: viewIn .35s var(--ease) both; }
.tip-panel iframe { display: block; width: 100%; height: 600px; border: 0; background: #F9F9F9; opacity: 0;
  transition: opacity .3s var(--ease); }
.tip-panel.loaded iframe { opacity: 1; }
.tip-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 10px;
  color: #444; font-weight: 600; font-size: .92rem; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(0, 0, 0, .15); border-top-color: #444;
  animation: spin .8s linear infinite; }
@media (max-width: 520px) { .tip-panel iframe { height: 660px; } }
