:root {
  color-scheme: light;
  --bg: oklch(99.2% 0.002 240);
  --surface: oklch(100% 0 0);
  --glass: oklch(100% 0 0 / 0.68);
  --glass-strong: oklch(100% 0 0 / 0.9);
  --glass-edge: oklch(100% 0 0 / 0.94);
  --fg: oklch(12% 0.01 250);
  --fg-secondary: oklch(38% 0.008 250);
  --muted: oklch(58% 0.008 250);
  --border: oklch(90% 0.003 250);
  --border-strong: oklch(84% 0.006 250);
  --accent: oklch(60% 0.1 40);
  --accent-bright: oklch(65% 0.2 70);
  --accent-soft: oklch(60% 0.1 40 / 0.1);
  --success: oklch(54% 0.11 154);
  --shadow-sm: 0 2px 18px oklch(0% 0 0 / 0.04);
  --shadow-md: 0 12px 38px oklch(0% 0 0 / 0.08);
  --shadow-lg: 0 24px 72px oklch(0% 0 0 / 0.13);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100dvh;
  margin: 0;
  overflow: hidden;
  background: oklch(94% 0.004 240);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100dvh;
  overflow: hidden;
  background:
    linear-gradient(180deg, var(--surface), var(--bg) 34%, oklch(97.2% 0.003 240)),
    var(--bg);
}

.status-bar {
  display: flex;
  flex-shrink: 0;
  justify-content: space-between;
  min-height: 36px;
  padding: 11px 22px 2px;
  font-size: 11px;
  font-weight: 650;
}

.identity-bar {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 58px;
  padding: 7px 16px;
}

.brand-lockup,
.identity-chip,
.identity-actions,
.section-header,
.title-group,
.sheet-peer,
.dialog-actions,
.join-row {
  display: flex;
  align-items: center;
}

.brand-lockup {
  display: none;
}

.identity-chip {
  min-width: 0;
  gap: 9px;
  border: 0.5px solid var(--border);
  border-radius: 999px;
  padding: 5px 13px 5px 5px;
  background: var(--glass);
  color: var(--fg);
  text-align: left;
  box-shadow: inset 0 1px 0 var(--glass-edge);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.identity-chip strong,
.identity-chip small {
  display: block;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.identity-chip strong {
  font-size: 13px;
  font-weight: 630;
}

.identity-chip small,
.muted {
  color: var(--muted);
  font-size: 11px;
}

.identity-actions {
  gap: 6px;
}

.icon-button,
.secondary-button,
.primary-button,
.send-button {
  min-height: 36px;
  border: 0.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  background: var(--glass);
  color: var(--fg-secondary);
  box-shadow: inset 0 1px 0 var(--glass-edge);
}

.icon-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 570;
}

.icon-button svg {
  width: 15px;
  height: 15px;
}

.desktop-status {
  display: none;
}

.main-scroll {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden auto;
  padding: 0 16px calc(78px + var(--safe-bottom));
  -webkit-overflow-scrolling: touch;
}

.main-scroll::-webkit-scrollbar {
  width: 0;
}

.view {
  display: none;
  width: 100%;
}

.view.active {
  display: block;
}

.hero-panel {
  position: relative;
  margin: 10px 0 22px;
  padding: 19px 18px;
  overflow: hidden;
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 88% 0%, var(--accent-soft), transparent 40%),
    var(--glass-strong);
  box-shadow: inset 0 1px 0 var(--glass-edge), var(--shadow-sm);
}

.kicker,
.settings-label {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 640;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero-panel h1,
.page-heading h1 {
  margin: 6px 0 7px;
  font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 28px;
  line-height: 1.05;
  font-weight: 680;
  letter-spacing: 0;
}

.hero-panel > p:last-of-type {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.status-pill {
  position: absolute;
  right: 15px;
  bottom: 15px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0.5px solid var(--border);
  border-radius: 999px;
  padding: 5px 9px;
  background: var(--glass);
  color: var(--muted);
  font-size: 11px;
  font-weight: 570;
}

.status-pill::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.status-pill.online {
  border-color: oklch(70% 0.07 154 / 0.28);
  background: oklch(83% 0.06 154 / 0.16);
  color: var(--success);
}

.notice {
  margin-bottom: 14px;
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 11px 13px;
  background: var(--glass-strong);
  color: var(--fg-secondary);
  font-size: 12px;
}

.receive-notifications {
  position: fixed;
  right: 18px;
  bottom: calc(82px + env(safe-area-inset-bottom));
  z-index: 70;
  display: grid;
  width: min(360px, calc(100vw - 32px));
  gap: 10px;
}

.receive-notification {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  background: oklch(100% 0 0 / 0.96);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(20px);
}

.receive-notification .cat-avatar {
  width: 42px;
  height: 42px;
}

.receive-copy {
  min-width: 0;
}

.receive-copy strong,
.receive-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.receive-copy strong {
  margin-bottom: 3px;
  font-size: 13px;
}

.receive-copy span {
  max-height: 44px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.receive-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.receive-action,
.receive-dismiss {
  min-height: 34px;
  border: 0.5px solid var(--border);
  background: var(--surface);
  color: var(--fg);
}

.receive-action {
  border-color: var(--accent);
  padding: 0 12px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 650;
}

.receive-action:disabled {
  border-color: var(--border);
  color: var(--muted);
}

.receive-dismiss {
  width: 34px;
  padding: 0;
  font-size: 17px;
}

.nearby-section {
  position: relative;
}

.section-header {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.title-group {
  gap: 9px;
}

.section-header h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 640;
}

.count-badge {
  min-width: 24px;
  border: 0.5px solid var(--border);
  border-radius: 999px;
  padding: 2px 7px;
  background: var(--glass);
  color: var(--muted);
  font-family: "SF Mono", ui-monospace, Menlo, monospace;
  font-size: 11px;
  text-align: center;
}

.text-button {
  min-height: 30px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--accent);
  font-size: 11px;
  font-weight: 580;
}

.radar-video,
.self-anchor {
  display: none;
}

.device-grid {
  display: grid;
  gap: 8px;
  min-height: 72px;
}

.peer-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  min-height: 68px;
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 11px 14px;
  background: var(--glass);
  color: var(--fg);
  box-shadow: inset 0 1px 0 var(--glass-edge);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.peer-card:active {
  transform: scale(0.99);
}

.peer-card.drag-target {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.peer-card h3 {
  margin: 0 0 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 610;
}

.peer-card p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.send-button {
  min-height: 32px;
  color: var(--fg);
  font-size: 11px;
  font-weight: 610;
}

.drop-indicator {
  position: absolute;
  inset: -1px;
  border: 1.5px solid var(--accent);
  border-radius: calc(var(--radius-md) + 1px);
  opacity: 0;
  pointer-events: none;
}

.peer-card.drag-target .drop-indicator {
  opacity: 1;
}

.cat-avatar {
  position: relative;
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 42px;
  height: 42px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--glass-edge), 0 7px 18px oklch(0% 0 0 / 0.08);
}

.identity-chip .cat-avatar {
  width: 28px;
  height: 28px;
}

.cat-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cat-avatar span {
  display: none;
  padding: 4px;
  font-size: 7px;
  text-align: center;
}

.cat-avatar img[hidden] + span {
  display: block;
}

.empty-state {
  display: none;
  min-height: 230px;
  place-items: center;
  gap: 13px;
  padding: 30px 20px;
  text-align: center;
}

.empty-state.visible {
  display: grid;
}

.empty-ring {
  position: relative;
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  border: 0.5px solid var(--border);
  border-radius: 50%;
  background: var(--glass);
}

.empty-ring::before {
  position: absolute;
  inset: -5px;
  border: 1px solid oklch(60% 0.1 40 / 0.3);
  border-radius: inherit;
  animation: pulse-ring 2.6s ease-out infinite;
  content: "";
}

.empty-ring span {
  width: 34px;
  height: 34px;
  border: 1.5px solid var(--muted);
  border-radius: 50%;
}

@keyframes pulse-ring {
  from { opacity: 0.7; transform: scale(1); }
  to { opacity: 0; transform: scale(1.2); }
}

.empty-state h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 640;
}

.empty-state p {
  max-width: 280px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.secondary-button {
  background: var(--surface);
  color: var(--fg);
  font-size: 12px;
  font-weight: 580;
}

.primary-button {
  background: var(--fg);
  color: var(--surface);
  border-color: var(--fg);
  font-weight: 620;
}

.wide {
  width: 100%;
}

.quick-send {
  margin-top: 20px;
}

.quick-send > div {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 9px;
}

.quick-send button {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  border: 0.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  background: var(--glass);
  color: var(--fg-secondary);
}

.quick-send svg {
  width: 18px;
  height: 18px;
  color: var(--accent);
}

.quick-send span {
  font-size: 12px;
  font-weight: 580;
}

.page-heading {
  padding: 14px 0 22px;
}

.page-heading h1 {
  font-size: 29px;
}

.activity-section {
  padding-bottom: 20px;
}

.activity-list {
  display: grid;
  gap: 8px;
}

.activity-item {
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 13px 14px;
  background: var(--glass);
  box-shadow: inset 0 1px 0 var(--glass-edge);
}

.activity-item strong {
  display: block;
  margin-bottom: 3px;
  font-size: 13px;
  font-weight: 610;
}

.progress {
  height: 4px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--border);
}

.progress span {
  display: block;
  width: var(--value, 0%);
  height: 100%;
  background: var(--accent);
  transition: width 180ms linear;
}

.settings-label {
  margin: 0 4px 8px;
}

.settings-group {
  margin-bottom: 24px;
  overflow: hidden;
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--glass);
  box-shadow: inset 0 1px 0 var(--glass-edge);
}

.settings-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 68px;
  border: 0;
  border-bottom: 0.5px solid var(--border);
  padding: 10px 14px;
  background: transparent;
  color: var(--fg);
  text-align: left;
}

.settings-row:last-child {
  border-bottom: 0;
}

.settings-row > span:nth-child(2) strong,
.settings-row > span:nth-child(2) small {
  display: block;
}

.settings-row strong {
  font-size: 13px;
  font-weight: 610;
}

.settings-row small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.row-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: var(--accent);
}

.row-icon svg {
  width: 17px;
  height: 17px;
}

.row-value {
  color: var(--muted);
  font-size: 12px;
}

.mono {
  font-family: "SF Mono", ui-monospace, Menlo, monospace;
}

.toggle {
  position: relative;
  display: block;
  width: 42px;
  height: 24px;
}

.toggle input {
  position: absolute;
  opacity: 0;
}

.toggle i {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: oklch(82% 0.006 250);
  transition: background 180ms ease;
}

.toggle i::after {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 4px oklch(0% 0 0 / 0.18);
  transition: transform 180ms ease;
  content: "";
}

.toggle input:checked + i {
  background: var(--accent);
}

.toggle input:checked + i::after {
  transform: translateX(18px);
}

.bottom-nav {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 6px 12px calc(6px + var(--safe-bottom));
  border-top: 0.5px solid var(--border);
  background: var(--glass);
  box-shadow: 0 -10px 28px oklch(0% 0 0 / 0.035);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
}

.nav-item {
  position: relative;
  display: grid;
  min-width: 68px;
  place-items: center;
  gap: 2px;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  background: transparent;
  color: var(--muted);
}

.nav-item.active {
  color: var(--accent);
}

.nav-item svg {
  width: 23px;
  height: 23px;
}

.nav-item > span {
  font-size: 10px;
  font-weight: 570;
}

.nav-badge {
  position: absolute;
  top: 2px;
  right: 12px;
  min-width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.sheet {
  width: min(100vw, 420px);
  max-height: min(84dvh, 720px);
  margin: auto auto 0;
  border: 0.5px solid var(--border);
  border-radius: 24px 24px 0 0;
  padding: 18px 20px calc(20px + var(--safe-bottom));
  background: oklch(99.4% 0.002 240 / 0.98);
  color: var(--fg);
  box-shadow: var(--shadow-lg);
}

.sheet::backdrop {
  background: oklch(0% 0 0 / 0.22);
  backdrop-filter: blur(8px);
}

.compact {
  max-width: 390px;
}

.close-button {
  float: right;
  min-height: 32px;
  border: 0;
  border-radius: 999px;
  padding: 0 10px;
  background: var(--glass);
  color: var(--muted);
  font-size: 11px;
}

.sheet-peer {
  gap: 12px;
  margin: 10px 0 16px;
}

.sheet h2 {
  margin: 3px 0 0;
  font-size: 20px;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-bottom: 14px;
  padding: 4px;
  border-radius: 14px;
  background: oklch(93% 0.004 250);
}

.tab {
  min-height: 36px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
}

.tab.active {
  background: var(--surface);
  color: var(--fg);
  box-shadow: var(--shadow-sm);
}

.tab-panel {
  display: none;
  margin-bottom: 16px;
}

.tab-panel.active {
  display: block;
}

.drop-zone,
.paste-card {
  display: grid;
  width: 100%;
  min-height: 132px;
  place-items: center;
  gap: 6px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--muted);
  text-align: center;
}

.drop-zone input {
  display: none;
}

.drop-zone span,
.paste-card strong {
  color: var(--fg);
  font-weight: 620;
}

.drop-zone small,
.paste-card span {
  max-width: 270px;
  font-size: 11px;
}

textarea,
input {
  width: 100%;
  border: 0.5px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  background: oklch(98% 0.004 250);
  color: var(--fg);
}

textarea {
  min-height: 128px;
  resize: vertical;
}

.selected-files {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.file-chip {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 0.5px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
  color: var(--muted);
}

.file-chip strong {
  overflow: hidden;
  color: var(--fg);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dialog-actions {
  justify-content: flex-end;
  gap: 8px;
}

.qr-box {
  display: grid;
  width: 190px;
  height: 190px;
  margin: 16px auto;
  place-items: center;
  overflow: hidden;
  border: 0.5px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
}

#roomCode {
  display: block;
  margin-bottom: 16px;
  font-family: "SF Mono", ui-monospace, Menlo, monospace;
  font-size: 27px;
  letter-spacing: 0.12em;
  text-align: center;
}

.join-row {
  gap: 8px;
  margin-bottom: 10px;
}

.context-menu {
  position: fixed;
  z-index: 30;
  display: grid;
  min-width: 170px;
  border: 0.5px solid var(--border);
  border-radius: 14px;
  padding: 6px;
  background: oklch(100% 0 0 / 0.96);
  box-shadow: var(--shadow-md);
}

.context-menu button {
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  background: transparent;
  text-align: left;
}

.drop-catcher {
  position: fixed;
  inset: 18px;
  z-index: 40;
  display: grid;
  place-items: center;
  border: 1px dashed var(--accent);
  border-radius: 28px;
  background: oklch(99% 0.002 240 / 0.9);
  color: var(--fg);
  text-align: center;
  backdrop-filter: blur(24px);
}

.drop-catcher strong,
.drop-catcher span {
  display: block;
}

.drop-catcher span {
  margin-top: 4px;
  color: var(--muted);
}

@media (max-width: 919px) {
  body.has-peers .hero-panel {
    display: none;
  }

  body.has-peers .nearby-section {
    margin-top: 26px;
  }

  body.has-peers .section-header {
    margin-bottom: 16px;
  }

  body.has-peers .peer-card {
    min-height: 84px;
    gap: 15px;
    padding: 14px 16px;
  }

  body.has-peers .peer-card .cat-avatar {
    width: 50px;
    height: 50px;
  }

  body.has-peers .peer-card h3 {
    font-size: 15px;
  }

  body.has-peers .peer-card p {
    margin-top: 3px;
    font-size: 12px;
  }

  body.has-peers .send-button {
    min-width: 54px;
    min-height: 36px;
  }

  body.has-peers .quick-send {
    margin-top: 24px;
  }

  body.has-peers .quick-send > div {
    gap: 10px;
    margin-top: 11px;
  }

  body.has-peers .quick-send button {
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    min-height: 78px;
    padding: 10px;
  }

  body.has-peers .quick-send svg {
    width: 21px;
    height: 21px;
  }
}

@media (min-width: 920px) {
  :root {
    --bg: oklch(98.5% 0.003 80);
    --surface: oklch(100% 0.002 75);
    --glass: oklch(100% 0 0 / 0.58);
    --glass-strong: oklch(100% 0 0 / 0.88);
    --fg: oklch(12% 0.012 70);
    --fg-secondary: oklch(34% 0.01 70);
    --muted: oklch(45% 0.01 70);
    --border: oklch(88% 0.006 75);
    --border-strong: oklch(80% 0.01 75);
    --accent: oklch(60% 0.1 40);
  }

  .app-shell {
    display: grid;
    grid-template-rows: 44px 1fr;
    height: 100dvh;
    min-height: 0;
    background: var(--bg);
  }

  .status-bar,
  .hero-panel,
  .quick-send {
    display: none;
  }

  .identity-bar {
    position: relative;
    z-index: 30;
    grid-row: 1;
    min-height: 44px;
    padding: 0 10px 0 16px;
    border-bottom: 0.5px solid var(--border);
    background: var(--glass);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
  }

  .brand-lockup {
    display: flex;
    gap: 7px;
    border: 0;
    background: transparent;
    color: var(--fg);
  }

  .brand-lockup img {
    width: 22px;
    height: 22px;
  }

  .brand-lockup strong {
    font-size: 14px;
    font-weight: 650;
  }

  .identity-bar > .identity-chip {
    display: none;
  }

  .identity-actions {
    margin-left: auto;
  }

  .identity-actions .icon-button {
    min-height: 28px;
    border-radius: 8px;
    padding: 0 8px;
    background: transparent;
    box-shadow: none;
  }

  .identity-actions .icon-button span {
    display: none;
  }

  .desktop-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 22px;
    margin-left: 3px;
    padding-left: 10px;
    border-left: 0.5px solid var(--border);
    color: var(--muted);
    font-size: 11px;
  }

  .desktop-status i,
  .self-anchor small i {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--success);
  }

  .main-scroll {
    grid-row: 2;
    height: 100%;
    padding: 0 44px 0 0;
    overflow: hidden;
  }

  .view.active {
    height: 100%;
  }

  .share-view {
    position: relative;
  }

  .notice {
    position: fixed;
    top: 58px;
    left: 50%;
    z-index: 40;
    max-width: 500px;
    transform: translateX(-50%);
  }

  .receive-notifications {
    right: 64px;
    bottom: 24px;
  }

  .nearby-section {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--bg);
  }

  .radar-video {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    pointer-events: none;
  }

  .nearby-section > .section-header {
    position: absolute;
    top: 24px;
    left: 50%;
    z-index: 8;
    margin: 0;
    transform: translateX(-50%);
  }

  .nearby-section .title-group {
    border: 0.5px solid var(--border);
    border-radius: 999px;
    padding: 6px 15px;
    background: var(--glass);
    backdrop-filter: blur(14px);
  }

  .nearby-section .section-header h2 {
    color: var(--fg-secondary);
    font-size: 12px;
    font-weight: 580;
  }

  .nearby-section .count-badge {
    min-width: auto;
    border: 0;
    padding: 0;
    background: transparent;
    font-family: inherit;
  }

  #emptyPairButton {
    display: none;
  }

  .device-grid {
    position: absolute;
    inset: 0;
    z-index: 7;
    display: block;
    min-height: 0;
    pointer-events: none;
  }

  .peer-card {
    position: absolute;
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 6px;
    width: 150px;
    min-height: 116px;
    border: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
    text-align: center;
    pointer-events: auto;
  }

  .peer-card:only-child {
    top: 24%;
    left: 50%;
    transform: translateX(-50%);
  }

  .peer-card:nth-child(1):not(:only-child) { top: 35%; left: 16%; }
  .peer-card:nth-child(2) { top: 17%; left: 50%; transform: translateX(-50%); }
  .peer-card:nth-child(3) { top: 32%; right: 15%; }
  .peer-card:nth-child(4) { top: 55%; left: 28%; }
  .peer-card:nth-child(5) { top: 54%; right: 27%; }

  .peer-card:hover {
    background: transparent;
    transform: translateY(-2px);
  }

  .peer-card:only-child:hover,
  .peer-card:nth-child(2):hover {
    transform: translate(-50%, -2px);
  }

  .peer-card .cat-avatar {
    width: 62px;
    height: 62px;
    padding: 3px;
    background: var(--surface);
    box-shadow:
      0 0 0 1px var(--border),
      0 0 0 5px oklch(65% 0.2 70 / 0.13),
      var(--shadow-md);
    transition: transform 180ms ease, box-shadow 180ms ease;
  }

  .peer-card:hover .cat-avatar,
  .peer-card.drag-target .cat-avatar {
    transform: scale(1.05);
    box-shadow:
      0 0 0 1px var(--border),
      0 0 0 7px oklch(65% 0.2 70 / 0.24),
      0 0 0 10px var(--accent),
      var(--shadow-md);
  }

  .peer-info {
    display: grid;
    justify-items: center;
    gap: 3px;
  }

  .peer-card h3 {
    max-width: 150px;
    border: 0.5px solid var(--border);
    border-radius: 999px;
    padding: 4px 10px;
    background: var(--glass);
    color: var(--fg);
    font-size: 11px;
    font-weight: 620;
    backdrop-filter: blur(10px);
  }

  .peer-card p {
    font-size: 10px;
  }

  .send-button {
    position: absolute;
    top: 92px;
    min-height: 28px;
    border-radius: 999px;
    opacity: 0;
    transform: translateY(-3px);
    transition: opacity 150ms ease, transform 150ms ease;
  }

  .peer-card:hover .send-button,
  .peer-card:focus-within .send-button {
    opacity: 1;
    transform: translateY(0);
  }

  .drop-indicator {
    inset: -7px auto auto;
    width: 76px;
    height: 76px;
    border-radius: 50%;
  }

  .empty-state.visible {
    position: absolute;
    top: 47%;
    left: 50%;
    z-index: 5;
    min-height: 0;
    padding: 0;
    transform: translate(-50%, -50%);
  }

  .empty-state h2 {
    font-size: clamp(18px, 2vw, 24px);
  }

  .empty-state p {
    max-width: 400px;
    font-size: 13px;
  }

  .empty-state .secondary-button {
    border-radius: 999px;
  }

  .empty-ring {
    display: none;
  }

  .self-anchor {
    position: absolute;
    bottom: clamp(34px, 8vh, 76px);
    left: 50%;
    z-index: 9;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    border: 0;
    background: transparent;
    color: var(--fg);
    transform: translateX(-50%);
  }

  .self-anchor .cat-avatar {
    width: 62px;
    height: 62px;
    padding: 3px;
    box-shadow:
      0 0 0 1px var(--border),
      0 0 0 5px oklch(65% 0.2 70 / 0.16),
      var(--shadow-md);
  }

  .self-anchor strong {
    margin-top: 4px;
    font-size: 13px;
    font-weight: 650;
  }

  .self-anchor small {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--muted);
    font-size: 10px;
  }

  .activity-view,
  .settings-view {
    width: min(720px, calc(100vw - 120px));
    height: 100%;
    margin: 0 auto;
    overflow: auto;
    padding: 28px 20px 60px;
  }

  .page-heading {
    padding-top: 0;
  }

  .activity-section {
    width: 100%;
  }

  .bottom-nav {
    top: 44px;
    right: 0;
    bottom: 0;
    left: auto;
    flex-direction: column;
    justify-content: flex-start;
    width: 44px;
    padding: 8px 0;
    border-top: 0;
    border-left: 0.5px solid var(--border);
  }

  .nav-item {
    min-width: 44px;
    width: 44px;
    min-height: 44px;
    padding: 0;
  }

  .nav-item > span {
    display: none;
  }

  .nav-item svg {
    width: 18px;
    height: 18px;
  }

  .nav-badge {
    top: 6px;
    right: 7px;
  }

  .sheet {
    border-radius: 24px;
    margin: auto;
  }

  .drop-catcher {
    inset: 58px 58px 18px 18px;
  }
}

@media (max-width: 390px) {
  .identity-chip strong,
  .identity-chip small {
    max-width: 112px;
  }

  .icon-button {
    padding: 0 9px;
  }

  .hero-panel h1 {
    font-size: 25px;
  }

  body.has-peers .peer-card {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 11px;
    padding-inline: 12px;
  }

  body.has-peers .send-button {
    min-width: 48px;
    padding-inline: 9px;
  }
}

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