:root {
  color-scheme: light dark;
  --bg: #f4f4fb;
  --glow-1: rgba(88, 79, 246, .16);
  --glow-2: rgba(23, 194, 180, .13);
  --surface: #ffffff;
  --surface-2: #f0f1f8;
  --surface-3: #e6e7f2;
  --border: #e2e3ee;
  --text: #11121f;
  --muted: #5d6178;
  --faint: #8a8ea6;
  --indigo: #584ff6;
  --teal: #12a99c;
  --violet: #9458f6;
  --accent: #584ff6;
  --accent-soft: rgba(88, 79, 246, .11);
  --accent-ring: rgba(88, 79, 246, .35);
  --signal: #12b886;
  --danger: #d92f45;
  --danger-soft: rgba(217, 47, 69, .1);
  --warn: #b86e00;
  --ok: #138a5a;
  --ring-line: rgba(17, 18, 31, .09);
  --shadow-sm: 0 1px 2px rgba(17, 18, 31, .06);
  --shadow: 0 1px 2px rgba(17, 18, 31, .05), 0 12px 32px rgba(17, 18, 31, .08);
  --shadow-lg: 0 -10px 50px rgba(17, 18, 31, .18);
  --grad: linear-gradient(135deg, #584ff6 0%, #6b5cf8 35%, #17c2b4 100%);
  --radius: 20px;
  --radius-sm: 14px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", ui-sans-serif, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --dock-h: 74px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0b12;
    --glow-1: rgba(126, 122, 255, .18);
    --glow-2: rgba(46, 230, 200, .10);
    --surface: #14151f;
    --surface-2: #1b1d2a;
    --surface-3: #252838;
    --border: #262939;
    --text: #eceef8;
    --muted: #a0a4bd;
    --faint: #6f7491;
    --indigo: #7e7aff;
    --teal: #2ee6c8;
    --violet: #b48cff;
    --accent: #8b85ff;
    --accent-soft: rgba(139, 133, 255, .16);
    --accent-ring: rgba(139, 133, 255, .45);
    --signal: #2ee6b0;
    --danger: #ff6b7a;
    --danger-soft: rgba(255, 107, 122, .14);
    --warn: #ffb547;
    --ok: #3ddc97;
    --ring-line: rgba(236, 238, 248, .09);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 12px 32px rgba(0, 0, 0, .32);
    --shadow-lg: 0 -10px 50px rgba(0, 0, 0, .6);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; height: 100%; }
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  color: var(--text);
  background:
    radial-gradient(700px 420px at 0% -8%, var(--glow-1), transparent 70%),
    radial-gradient(640px 420px at 110% 8%, var(--glow-2), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
body.sheet-open { overflow: hidden; }
h1, h2, h3, h4, p { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-user-select: none; user-select: none; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
a { color: var(--accent); }

.i { display: inline-flex; width: 22px; height: 22px; flex: none; }
.i svg { width: 100%; height: 100%; }
.i.big { width: 52px; height: 52px; color: var(--faint); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.mono { font-family: var(--mono); letter-spacing: .02em; }

#app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(var(--dock-h) + var(--safe-b) + 16px);
}

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(var(--safe-t) + 10px) calc(var(--safe-r) + 16px) 10px calc(var(--safe-l) + 16px);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(18px);
  backdrop-filter: saturate(1.6) blur(18px);
}
.brand { display: flex; align-items: center; gap: 9px; flex: none; }
.brand img { border-radius: 9px; box-shadow: 0 6px 16px rgba(88, 79, 246, .32); }
.brand-name { font-weight: 800; letter-spacing: .16em; font-size: 14px; }
@media (max-width: 359px) { .brand-name { display: none; } .me { max-width: none; } }
.me {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  max-width: 52vw;
  padding: 6px 13px 6px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  text-align: left;
}
.me-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); box-shadow: 0 0 0 4px color-mix(in srgb, var(--faint) 22%, transparent); flex: none; transition: background .3s; }
.me.on .me-dot { background: var(--signal); box-shadow: 0 0 0 4px color-mix(in srgb, var(--signal) 22%, transparent); }
.me-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.me-text strong { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-text small { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--muted);
}
.icon-btn svg, .icon-btn .i { width: 22px; height: 22px; }
.icon-btn:active { background: var(--surface-3); }
.top .icon-btn { background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); color: var(--text); }

.main {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 4px calc(var(--safe-r) + 16px) 0 calc(var(--safe-l) + 16px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.install-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 6px 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.ib-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: #fff; background: var(--grad); flex: none; }
.ib-icon svg { width: 22px; height: 22px; }
.ib-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.ib-text strong { font-size: 14px; }
.ib-text span { font-size: 12.5px; color: var(--muted); }

.radar-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.radar-wrap.compact .radar { zoom: .7; }
.radar-wrap.compact .radar-hint { display: none; }
.radar {
  position: relative;
  width: min(100%, 440px);
  aspect-ratio: 1;
  margin: 4px auto 0;
}
.radar .disc {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--indigo) 17%, transparent) 0%, color-mix(in srgb, var(--teal) 7%, transparent) 46%, transparent 70%);
}
.radar .ring {
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  border: 1px solid var(--ring-line);
  transform: translate(-50%, -50%);
}
.radar .r1 { width: 26%; height: 26%; }
.radar .r2 { width: 52%; height: 52%; }
.radar .r3 { width: 82%; height: 82%; border-style: dashed; }
.radar .pulse {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18%;
  height: 18%;
  border-radius: 50%;
  border: 2px solid var(--indigo);
  opacity: 0;
  transform: translate(-50%, -50%) scale(1);
  animation: pulse 3.6s cubic-bezier(.2, .6, .3, 1) infinite;
}
.radar .p2 { animation-delay: 1.2s; border-color: color-mix(in srgb, var(--indigo) 50%, var(--teal)); }
.radar .p3 { animation-delay: 2.4s; border-color: var(--teal); }
@keyframes pulse {
  0% { opacity: .45; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(4.6); }
}
.self {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 2;
}
.self-badge {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--grad);
  box-shadow: 0 10px 28px rgba(88, 79, 246, .42), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.self-badge svg, .self-badge .i { width: 32px; height: 32px; }
.self-label { position: absolute; top: calc(100% + 6px); font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.peers { position: absolute; inset: 0; z-index: 3; }
.peer {
  position: absolute;
  width: 112px;
  transform: translate(-50%, -37px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 0;
  border: 0;
  background: none;
  text-align: center;
}
.peer.enter { animation: pop .35s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes pop { from { opacity: 0; transform: translate(-50%, -37px) scale(.6); } }
.peer .bubble { position: relative; width: 74px; height: 74px; display: grid; place-items: center; }
.peer .avatar { box-shadow: 0 8px 20px rgba(17, 18, 31, .18); transition: transform .2s; }
.peer:active .avatar { transform: scale(.94); }
.peer.off .avatar { filter: grayscale(.85); opacity: .5; box-shadow: none; }
.peer-name { margin-top: 4px; font-size: 13px; font-weight: 650; line-height: 1.2; max-width: 112px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word; }
.peer-status { font-size: 11.5px; color: var(--muted); }
.peer.on .peer-status { color: var(--ok); }
.peer.is-active .peer-status { color: var(--accent); font-weight: 600; }
.badge-trust {
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--signal);
  border: 2.5px solid var(--bg);
}
.badge-trust .i { width: 13px; height: 13px; }
.ring-wrap { position: absolute; inset: 0; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--surface-3); stroke-width: 4; }
.ring-fg { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; transition: stroke-dashoffset .3s; }
.radar-hint { text-align: center; color: var(--muted); font-size: 14.5px; max-width: 330px; min-height: 2.9em; }

.avatar {
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 50%;
  color: #fff;
}
.avatar.indigo { background: linear-gradient(135deg, #6a5cff, #4d3ff0); }
.avatar.teal { background: linear-gradient(135deg, #22d3c2, #0f9f93); }
.avatar .i { width: 46%; height: 46%; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 14px;
}
.transfers { display: flex; flex-direction: column; gap: 10px; }
.transfer { display: flex; flex-direction: column; gap: 10px; animation: rise .3s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.tr-head { display: flex; align-items: center; gap: 12px; }
.tr-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; color: var(--indigo); background: var(--accent-soft); }
.tr-icon.in { color: var(--teal); background: color-mix(in srgb, var(--teal) 14%, transparent); }
.transfer.st-done .tr-icon { color: #fff; background: var(--signal); }
.transfer.st-failed .tr-icon, .transfer.st-rejected .tr-icon, .transfer.st-cancelled .tr-icon { color: var(--danger); background: var(--danger-soft); }
.tr-titles { flex: 1; min-width: 0; }
.tr-titles h3 { font-size: 15.5px; line-height: 1.25; }
.tr-titles p { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-actions { display: flex; gap: 6px; align-items: center; flex: none; }
.bar { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: inherit; background: var(--grad); transition: width .25s; }
.meta { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

.sas {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 12px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  text-align: center;
}
.sas-label { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.sas-code { font-family: var(--mono); font-size: 44px; font-weight: 700; letter-spacing: .08em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.sas.inline .sas-code { font-size: 36px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 18px;
  border-radius: 14px;
  border: 1px solid transparent;
  font-weight: 650;
  font-size: 16px;
  text-decoration: none;
  white-space: nowrap;
  transition: transform .12s, opacity .2s, background .2s;
}
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn .i { width: 20px; height: 20px; }
.btn.primary { color: #fff; background: var(--grad); box-shadow: 0 8px 20px rgba(88, 79, 246, .28); }
.btn.secondary { color: var(--text); background: var(--surface-2); border-color: var(--border); }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.danger { color: var(--danger); }
.btn.small { min-height: 38px; padding: 0 13px; font-size: 14px; border-radius: 11px; }
.btn.small .i { width: 17px; height: 17px; }
.btn.ready { box-shadow: 0 0 0 3px var(--accent-ring); }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.row-actions > .btn { flex: 1 1 auto; min-width: 0; }
.btn.small { white-space: normal; line-height: 1.15; text-align: center; }
.actions.two { display: grid; grid-template-columns: 1fr 1.3fr; gap: 10px; }

.dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 1fr 1.25fr 1fr;
  gap: 8px;
  align-items: end;
  padding: 10px calc(var(--safe-r) + 14px) calc(var(--safe-b) + 10px) calc(var(--safe-l) + 14px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(18px);
  backdrop-filter: saturate(1.6) blur(18px);
  border-top: 1px solid var(--border);
}
@media (min-width: 600px) {
  .dock { left: 50%; right: auto; width: 520px; transform: translateX(-50%); bottom: 16px; border: 1px solid var(--border); border-radius: 22px; padding-bottom: 10px; box-shadow: var(--shadow); }
}
.dock-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 56px;
  padding: 6px 4px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}
.dock-btn svg { width: 25px; height: 25px; }
.dock-btn:active { background: var(--surface-3); }
.dock-btn.primary { color: #fff; background: var(--grad); min-height: 60px; font-size: 13.5px; box-shadow: 0 10px 26px rgba(88, 79, 246, .38); }
.dock-btn.primary:active { transform: scale(.97); }
.badge {
  position: absolute;
  top: 2px;
  left: calc(50% + 8px);
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--danger);
  color: #fff;
  font-size: 11.5px;
  line-height: 20px;
  font-weight: 700;
}

.sheet-wrap { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.backdrop { position: absolute; inset: 0; background: rgba(6, 7, 16, .42); opacity: 0; transition: opacity .25s; }
.sheet {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: calc(100dvh - var(--safe-t) - 18px);
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-radius: 26px 26px 0 0;
  box-shadow: var(--shadow-lg);
  transform: translateY(104%);
  transition: transform .3s cubic-bezier(.2, .9, .25, 1);
}
.sheet.tall { min-height: min(80dvh, 720px); }
.sheet-wrap.show .backdrop { opacity: 1; }
.sheet-wrap.show .sheet { transform: none; }
@media (min-width: 600px) {
  .sheet-wrap { align-items: center; }
  .sheet { border-radius: 26px; max-height: 88dvh; transform: translateY(30px) scale(.98); opacity: 0; transition: transform .25s, opacity .2s; }
  .sheet-wrap.show .sheet { opacity: 1; }
}
.grabber { width: 40px; height: 5px; border-radius: 3px; background: var(--surface-3); margin: 8px auto 0; flex: none; }
.sheet-head { display: flex; align-items: flex-start; gap: 8px; padding: 10px 14px 4px 20px; flex: none; }
.sheet-titles { flex: 1; min-width: 0; padding-top: 6px; }
.sheet-titles h2 { font-size: 21px; letter-spacing: -.01em; line-height: 1.2; }
.sheet-titles p { font-size: 14px; margin-top: 2px; }
.sheet-close { background: var(--surface-2); width: 36px; height: 36px; }
.sheet-close .i { width: 18px; height: 18px; }
.sheet-body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 12px 20px calc(var(--safe-b) + 22px); display: flex; flex-direction: column; gap: 14px; overscroll-behavior: contain; }
.sheet-body > div { display: flex; flex-direction: column; gap: 14px; }

.loading { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 36px 0; color: var(--muted); text-align: center; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.spinner.small { width: 18px; height: 18px; border-width: 2.5px; }
@keyframes spin { to { transform: rotate(360deg); } }
.wait-row { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); font-size: 14px; }
.lead { font-size: 15.5px; line-height: 1.5; }

.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.segmented button { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 650; font-size: 14.5px; }
.segmented button .i { width: 18px; height: 18px; }
.segmented button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.pair, .pair-body, .pair-step { display: flex; flex-direction: column; gap: 14px; }
.viewfinder { position: relative; width: 100%; max-width: 380px; aspect-ratio: 1; margin: 0 auto; border-radius: 22px; overflow: hidden; background: #05060c; }
.viewfinder.off { opacity: .35; }
.cam { width: 100%; height: 100%; object-fit: cover; display: block; }
.frame { position: absolute; inset: 14%; pointer-events: none; }
.frame i { position: absolute; width: 34px; height: 34px; border: 4px solid #fff; border-radius: 4px; }
.frame i:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 14px; }
.frame i:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 14px; }
.frame i:nth-child(3) { left: 0; bottom: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 14px; }
.frame i:nth-child(4) { right: 0; bottom: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 14px; }
.scanline { position: absolute; left: 16%; right: 16%; top: 16%; height: 2px; background: linear-gradient(90deg, transparent, #2ee6c8, transparent); box-shadow: 0 0 12px #2ee6c8; animation: scan 2.4s ease-in-out infinite alternate; }
@keyframes scan { to { top: 84%; } }
.qr { width: min(100%, 320px); margin: 0 auto; padding: 14px; background: #fff; border-radius: 22px; box-shadow: var(--shadow); }
.qr svg { width: 100%; height: auto; display: block; }
.steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; color: var(--text); }
.steps li { padding-left: 2px; }
.steps.big { font-size: 16px; gap: 14px; }
.kbd { display: inline-flex; align-items: center; justify-content: center; vertical-align: -5px; width: 28px; height: 26px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--border); color: var(--accent); }
.kbd .i { width: 18px; height: 18px; }

.compose, .field, .code-text {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 13px 14px;
  font-size: 16px;
  outline: none;
  resize: vertical;
}
.compose:focus, .field:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.code-input, .code-text { font-family: var(--mono); font-size: 13px; word-break: break-all; }
.code-input { font-size: 16px; }
.field.small { width: auto; padding: 8px 12px; }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  min-height: 112px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  text-align: left;
  font-weight: 650;
  font-size: 16px;
}
.tile:active { transform: scale(.97); }
.tile .i { width: 40px; height: 40px; padding: 9px; border-radius: 12px; color: #fff; }
.tile.teal .i { background: linear-gradient(135deg, #22d3c2, #0f9f93); }
.tile.indigo .i { background: linear-gradient(135deg, #6a5cff, #4d3ff0); }
.tile.violet .i { background: linear-gradient(135deg, #b07cff, #7a4ff0); }
.drop-hint { text-align: center; font-size: 13px; color: var(--faint); padding: 14px; border: 1.5px dashed var(--border); border-radius: 16px; }
.sheet.dragging { box-shadow: 0 0 0 3px var(--accent-ring), var(--shadow-lg); }

.list { display: flex; flex-direction: column; gap: 8px; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); text-align: left; }
.list-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.list-text strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-text small { color: var(--muted); font-size: 13px; }
.list-row > .i { color: var(--faint); }

.request { display: flex; flex-direction: column; gap: 14px; }
.req-head { display: flex; align-items: center; gap: 14px; }
.req-head h3 { font-size: 19px; }
.offer-items { list-style: none; margin: 0; padding: 4px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); }
.offer-items li, .g-files li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.offer-items li + li { border-top: 1px solid var(--border); }
.offer-items .i, .g-files .i { color: var(--accent); width: 20px; height: 20px; }
.offer-items .name, .g-files .name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14.5px; }
.offer-items .meta, .g-files .meta { flex: none; }
.offer-items .more { color: var(--muted); font-size: 13.5px; justify-content: center; }
.text-preview { margin: 0; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); white-space: pre-wrap; word-break: break-word; font-size: 15px; max-height: 180px; overflow: auto; }
.trusted-note { display: flex; align-items: center; gap: 8px; color: var(--ok); font-weight: 600; font-size: 14px; }

.setting { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); }
.setting.compact { padding: 10px 14px; }
.setting.sub { background: transparent; border: 0; padding: 4px 4px 4px 56px; }
.setting-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.setting-text small { color: var(--muted); font-size: 13px; line-height: 1.35; }
.switch { position: relative; flex: none; width: 52px; height: 32px; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch .track { position: absolute; inset: 0; border-radius: 16px; background: var(--surface-3); transition: background .2s; }
.switch .thumb { position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); transition: transform .22s cubic-bezier(.3, 1.4, .5, 1); }
.switch input:checked + .track { background: var(--signal); }
.switch input:checked + .track .thumb { transform: translateX(20px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px var(--accent-ring); }

.settings { display: flex; flex-direction: column; gap: 22px; }
.settings section { display: flex; flex-direction: column; gap: 10px; }
.settings h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding-left: 4px; }
.stack { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; }
.dev { display: flex; flex-direction: column; gap: 2px; padding: 10px 6px 8px 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); }
.dev-row { display: flex; align-items: center; gap: 12px; }

.received { display: flex; flex-direction: column; gap: 12px; }
.group { display: flex; flex-direction: column; gap: 12px; }
.group.partial { border-style: dashed; }
.g-head { display: flex; align-items: flex-start; gap: 12px; }
.g-icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; flex: none; overflow: hidden; color: #fff; }
.g-icon.indigo { background: linear-gradient(135deg, #6a5cff, #4d3ff0); }
.g-icon.teal { background: linear-gradient(135deg, #22d3c2, #0f9f93); }
.g-icon.violet { background: linear-gradient(135deg, #b07cff, #7a4ff0); }
.g-icon .i { width: 26px; height: 26px; }
.g-icon.photo { background: var(--surface-3); }
.g-icon img { width: 100%; height: 100%; object-fit: cover; }
.g-titles { flex: 1; min-width: 0; }
.g-titles h3 { font-size: 16px; line-height: 1.3; overflow-wrap: anywhere; }
.g-titles p { font-size: 13px; }
.warn-text { color: var(--warn); font-size: 13px; margin-top: 2px; }
.g-files summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 14px; padding: 2px; }
.g-files ul { list-style: none; margin: 6px 0 0; padding: 0; max-height: 260px; overflow: auto; border-radius: 12px; background: var(--surface-2); }
.text-block { display: flex; flex-direction: column; gap: 10px; }
.text-body { white-space: pre-wrap; word-break: break-word; font-size: 15px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); max-height: 220px; overflow: auto; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 48px 12px; text-align: center; }

.toasts { position: fixed; left: 0; right: 0; top: calc(var(--safe-t) + 10px); z-index: 80; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 480px;
  padding: 12px 16px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  font-size: 14.5px;
  font-weight: 550;
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: none; }
.toast .i { width: 20px; height: 20px; color: var(--accent); }
.toast.ok .i { color: var(--ok); }
.toast.error .i { color: var(--danger); }

.fatal { margin: auto; max-width: 420px; padding: 40px 24px; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.install { display: flex; flex-direction: column; gap: 16px; }

@media (prefers-reduced-motion: reduce) {
  .radar .pulse, .scanline { animation: none; opacity: 0; }
  .sheet, .toast, .peer, .transfer { transition: none; animation: none; }
}
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .top, .dock { background: var(--bg); }
}
