.sheet-backdrop {
  position: fixed;
  z-index: 30;
  inset: 0;
  background: var(--overlay);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity var(--motion-backdrop-out) linear;
}

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

.tab-replaced-overlay {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--overlay, rgba(15, 18, 24, 0.72));
  backdrop-filter: blur(10px);
}

.tab-replaced-overlay[hidden] {
  display: none;
}

.tab-replaced-card {
  max-width: 360px;
  width: 100%;
  display: grid;
  gap: 14px;
  padding: 24px;
  border-radius: 18px;
  background: var(--surface, #fff);
  color: var(--ink, #14161a);
  box-shadow: 0 24px 60px rgba(10, 14, 22, 0.35);
  text-align: center;
}

.tab-replaced-card h2 {
  margin: 0;
  font-size: 18px;
}

.tab-replaced-card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-muted, #5b606b);
}

.tab-replaced-card .sheet-primary {
  margin-top: 4px;
}

.sheet-backdrop.is-open {
  opacity: 1;
  transition-duration: var(--motion-backdrop-in);
}

.bottom-sheet {
  position: fixed;
  z-index: 31;
  left: 16px;
  right: 16px;
  bottom: calc(16px + var(--safe-bottom));
  max-width: 430px;
  max-height: calc(100dvh - 32px - var(--safe-top) - var(--safe-bottom));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  overscroll-behavior: contain;
  margin: 0 auto;
  padding: 18px;
  border: 1px solid var(--composer-border);
  border-radius: 34px;
  color: var(--ink);
  background: var(--composer);
  box-shadow: var(--shadow);
  backdrop-filter: blur(30px);
  opacity: 0;
  transform: translateY(calc(100% + 24px)) scale(.985);
  transform-origin: 50% 100%;
  transition:
    transform var(--motion-sheet-out) var(--ease-in),
    opacity var(--motion-backdrop-out) linear;
}

@media (max-width: 759px) {
  .bottom-sheet {
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: none;
    max-height: calc(100dvh - max(12px, var(--safe-top)));
    margin: 0;
    padding:
      18px
      max(18px, calc(var(--safe-right) + 14px))
      calc(20px + var(--safe-bottom))
      max(18px, calc(var(--safe-left) + 14px));
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 30px 30px 0 0;
    transform: translateY(100%);
  }
}

.bottom-sheet::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.bottom-sheet.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition:
    transform var(--motion-sheet-in) var(--ease-out),
    opacity var(--motion-backdrop-in) linear;
  will-change: transform, opacity;
}

.bottom-sheet.is-closing {
  pointer-events: none;
  will-change: transform, opacity;
}

.action-sheet {
  padding-bottom: 20px;
}

/* Keep the settings sheet to ~70% of the viewport with a momentum-scrolling body. */
[data-settings-sheet] {
  max-height: min(70dvh, calc(100dvh - 24px - var(--safe-top) - var(--safe-bottom)));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 759px) {
  [data-settings-sheet] {
    max-height: 70dvh;
  }
}

.sheet-close-icon {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 15px;
  color: var(--ink-soft);
  background: color-mix(in srgb, var(--ink) 7%, transparent);
  cursor: pointer;
}

.sheet-back-icon {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 15px;
  color: var(--ink-soft);
  background: color-mix(in srgb, var(--ink) 7%, transparent);
  cursor: pointer;
}

.sheet-back-icon svg,
.sheet-close-icon svg {
  width: 18px;
  height: 18px;
}

.sheet-back-icon path,
.sheet-close-icon path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.sheet-handle {
  display: block;
  width: 34px;
  height: 4px;
  margin: 0 auto 15px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 18%, transparent);
}

.sheet-kicker {
  margin: 0 0 4px;
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 620;
  text-align: center;
}

.bottom-sheet h2 {
  margin: 0;
  color: var(--ink);
  font-size: 24px;
  font-weight: 760;
  text-align: center;
  letter-spacing: 0;
}

.peer-candidate-heading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.peer-candidate-heading h2 {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}

.peer-candidate-heading h2 .device-brand {
  width: 28px;
  height: 28px;
  flex-basis: 28px;
}

.peer-candidate-avatar {
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  border: 4px solid #ffffff;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 9px 22px color-mix(in srgb, var(--shadow-ink) 11%, transparent);
}

.peer-sheet[data-invite-direction="incoming"] .peer-candidate-avatar {
  border-color: #ffffff;
  box-shadow:
    0 0 0 6px color-mix(in srgb, var(--blue) 10%, transparent),
    0 14px 34px color-mix(in srgb, var(--blue) 20%, transparent);
}

.peer-sheet[data-invite-direction="incoming"] .sheet-kicker {
  color: var(--blue);
}

.peer-sheet[data-invite-direction="incoming"] .swipe-control::before {
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--mint) 24%, transparent),
    color-mix(in srgb, var(--blue) 18%, transparent) 62%,
    transparent
  );
}

.bottom-sheet p:not(.sheet-kicker) {
  margin: 10px auto 16px;
  max-width: 320px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
}

.friend-strip {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 58px;
  margin-bottom: 16px;
}

.friend-strip > img,
.friend-strip .avatar-animation,
.friend-strip > span {
  width: 50px;
  height: 50px;
  margin-left: -5px;
  border: 4px solid #ffffff;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--shadow-ink) 10%, transparent);
}

.friend-strip > img:first-child,
.friend-strip .avatar-animation:first-child,
.friend-strip > span:first-child {
  margin-left: 0;
}

.friend-strip .avatar-animation {
  flex: 0 0 50px;
}

.qr-choice-sheet__peer {
  display: block;
  margin: -4px 0 14px;
  color: var(--blue);
  font-size: 12px;
  text-align: center;
}

.qr-choice-sheet__actions {
  display: grid;
  gap: 9px;
}

.qr-choice-sheet__actions > button {
  width: 100%;
  min-height: 70px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--panel-subtle);
  text-align: left;
  cursor: pointer;
}

.qr-choice-sheet__actions > button:focus-visible,
.qr-choice-sheet__actions > button:hover {
  border-color: color-mix(in srgb, var(--blue) 42%, var(--line));
  background: color-mix(in srgb, var(--blue) 8%, var(--panel-subtle));
}

.qr-choice-sheet__actions svg {
  width: 30px;
  height: 30px;
  justify-self: center;
  fill: none;
  stroke: var(--blue);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.qr-choice-sheet__actions span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.qr-choice-sheet__actions strong,
.qr-choice-sheet__actions small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qr-choice-sheet__actions strong {
  font-size: 14px;
}

.qr-choice-sheet__actions small {
  color: var(--ink-muted);
  font-size: 11px;
}

.friend-strip > span:not(.avatar-animation) {
  display: grid;
  place-items: center;
  color: #202124;
  font-size: 24px;
  font-weight: 300;
  background: #ffffff;
}

.nearby-sheet {
  padding-bottom: 20px;
  max-height: min(76dvh, 660px);
}

.nearby-search {
  margin-top: 14px;
}

.nearby-filter-choice {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.nearby-filter-choice button {
  min-height: 42px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 15px;
  color: var(--ink);
  background: var(--panel-subtle);
  font-size: 12px;
  font-weight: 720;
  cursor: pointer;
}

.nearby-filter-choice button.is-selected {
  border-color: color-mix(in srgb, var(--blue) 42%, var(--line));
  color: var(--blue);
  background: color-mix(in srgb, var(--blue) 10%, var(--panel-subtle));
}

.nearby-list {
  --nearby-row-height: 92px;
  display: grid;
  gap: 9px;
  max-height: 320px;
  margin-top: 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
  scroll-padding-block: 9px;
  scrollbar-width: none;
}

.nearby-list::-webkit-scrollbar {
  display: none;
}

.nearby-device-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-height: var(--nearby-row-height);
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel-subtle);
  box-sizing: border-box;
}

.nearby-device-avatar {
  position: relative;
  width: 48px;
  height: 48px;
  border: 4px solid #ffffff;
  border-radius: 50%;
  background: #ffffff;
  overflow: visible;
  box-shadow: 0 9px 22px color-mix(in srgb, var(--shadow-ink) 9%, transparent);
}

.nearby-device-avatar.is-online::after,
.nearby-device-avatar.is-offline::after {
  content: "";
  position: absolute;
  top: -1px;
  right: -1px;
  width: 8px;
  height: 8px;
  border: 2px solid var(--panel-subtle);
  border-radius: 999px;
  background: var(--nearby-presence-color, #ffd84d);
  box-shadow: 0 2px 6px color-mix(in srgb, var(--nearby-presence-color, #ffd84d) 34%, transparent);
}

.nearby-device-avatar.is-online {
  --nearby-presence-color: #ffd84d;
}

.nearby-device-avatar.is-offline {
  --nearby-presence-color: #9aa0a6;
}

.nearby-device-avatar img,
.nearby-device-avatar .avatar-static {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.nearby-device-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.nearby-device-copy strong,
.nearby-device-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nearby-device-name,
.device-summary-line {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  max-width: 100%;
}

.device-brand {
  --device-chip-bg: color-mix(in srgb, var(--blue) 12%, #ffffff);
  --device-chip-ink: var(--blue);
  width: 26px;
  height: 26px;
  display: inline-grid;
  flex: 0 0 26px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--device-chip-ink) 24%, transparent);
  border-radius: 999px;
  color: var(--device-chip-ink);
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, .82), transparent 58%),
    var(--device-chip-bg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .58);
}

.device-brand svg {
  width: 16px;
  height: 16px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.15;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.device-brand--official svg {
  fill: currentColor;
  stroke: none;
}

.device-brand--official text {
  fill: currentColor;
  stroke: none;
}

.device-brand--apple svg,
.device-brand--google svg,
.device-brand--windows svg {
  width: 14px;
  height: 14px;
}

.device-brand--samsung svg {
  width: 50px;
  height: 15px;
}

.device-brand--android svg {
  width: 15px;
  height: 15px;
}

.device-brand--apple {
  --device-chip-bg: #f7f8fa;
  --device-chip-ink: #111111;
}

.device-brand--samsung {
  --device-chip-bg: transparent;
  --device-chip-ink: #1428a0;
  width: 56px;
  flex-basis: 56px;
  height: 20px;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.device-brand--google {
  --device-chip-bg: transparent;
  --device-chip-ink: #4285f4;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.device-brand--android {
  --device-chip-bg: #e9f8e8;
  --device-chip-ink: #3ddc84;
}

.device-brand--windows {
  --device-chip-bg: #eef3ff;
  --device-chip-ink: #0078d4;
}

.app-shell[data-theme="dark"] .device-brand {
  color: color-mix(in srgb, var(--device-chip-ink) 78%, #ffffff 22%);
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, .72), transparent 58%),
    color-mix(in srgb, var(--device-chip-bg) 70%, #ffffff 30%);
  border-color: color-mix(in srgb, var(--device-chip-ink) 52%, #ffffff 22%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18);
}

.app-shell[data-theme="dark"] .device-brand--samsung,
.app-shell[data-theme="dark"] .device-brand--google {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.app-shell[data-theme="dark"] .device-brand--samsung {
  color: #9fb7ff;
}

.nearby-device-copy strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 760;
}

.nearby-device-copy span {
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 560;
}

.nearby-device-name .device-brand {
  color: var(--device-chip-ink);
}

.nearby-device-name > span:not(.device-brand):not(.nearby-history-chip) {
  min-width: 0;
}

.nearby-history-chip {
  flex: 0 0 auto;
  min-height: 20px;
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  border-radius: 999px;
  color: var(--ink-soft);
  background: color-mix(in srgb, var(--ink) 7%, transparent);
  font-size: 10px;
  font-weight: 700;
}

.nearby-device-meta {
  display: flex;
  flex-wrap: nowrap;
  gap: 5px;
  min-width: 0;
  align-items: center;
}

.nearby-pill {
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  flex: 0 1 auto;
  min-height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  color: var(--ink-soft);
  background: color-mix(in srgb, var(--ink) 7%, transparent);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.nearby-device-history {
  display: flex;
  min-width: 0;
}

.nearby-connect {
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(180deg, #4f95ff, var(--blue));
  font-size: 12px;
  font-weight: 760;
  cursor: pointer;
}

@media (max-height: 760px) {
  .nearby-list {
    max-height: calc((var(--nearby-row-height) * 2) + 9px);
  }
}

.nearby-empty {
  min-height: 84px;
  display: grid;
  place-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--ink-muted);
  background: var(--panel-subtle);
  font-size: 13px;
  font-weight: 650;
  text-align: center;
}

.sheet-actions {
  display: grid;
  gap: 10px;
}

.swipe-control {
  position: relative;
  height: 60px;
  display: grid;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: color-mix(in srgb, var(--panel-solid) 56%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3);
  touch-action: none;
  user-select: none;
}

.swipe-control::before {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 18px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--blue) 16%, transparent), transparent 58%);
  opacity: 0;
  transform: scaleX(.72);
  transform-origin: left center;
  transition: opacity var(--motion-control) ease, transform var(--motion-control) var(--ease-out);
  pointer-events: none;
}

.swipe-control.is-dragging::before,
.swipe-control.is-ready::before {
  opacity: 1;
  transform: scaleX(1);
}

.swipe-control.is-complete {
  background: linear-gradient(180deg, #4f95ff, var(--blue));
}

.swipe-control--vertical {
  height: 110px;
  margin-top: 14px;
  align-items: start;
  padding: 12px 14px 0;
}

.swipe-control--vertical:not(.is-ready) {
  height: 76px;
  align-items: center;
  padding-bottom: 0;
  background: color-mix(in srgb, var(--panel-solid) 60%, transparent);
}

.swipe-control--vertical::before {
  background: linear-gradient(0deg, color-mix(in srgb, var(--blue) 12%, transparent), transparent 74%);
  transform: scaleY(.72);
  transform-origin: center bottom;
}

.swipe-control--vertical.is-dragging::before,
.swipe-control--vertical.is-ready::before {
  transform: scaleY(1);
}

.swipe-control--vertical .swipe-text {
  position: absolute;
  top: 12px;
  left: 18px;
  right: 18px;
  width: auto;
  font-size: 13px;
}

.swipe-control--vertical:not(.is-ready) .swipe-text {
  top: 50%;
  transform: translateY(-50%);
}

.swipe-control--vertical.is-dragging .swipe-text {
  opacity: 0;
  transition-duration: 0ms;
}

.swipe-control--vertical.is-complete .swipe-text {
  top: auto;
  bottom: 20px;
  transform: none;
}

.swipe-text {
  position: relative;
  z-index: 1;
  color: var(--ink-soft);
  font-size: 15px;
  font-weight: 680;
  text-align: center;
  line-height: 1.25;
  pointer-events: none;
  transition: opacity 120ms ease, transform 160ms var(--ease-out);
}

.swipe-control:not(.swipe-control--vertical) .swipe-text {
  position: absolute;
  left: 68px;
  right: 20px;
  width: auto;
  padding: 0;
}

.swipe-control:not(.swipe-control--vertical).is-dragging .swipe-text {
  opacity: 0;
  transform: translateX(8px);
  transition-duration: 0ms;
}

.swipe-control:not(.swipe-control--vertical).is-complete .swipe-text {
  left: 20px;
  right: 68px;
}

.swipe-control.is-complete .swipe-text {
  color: #fff;
}

.swipe-thumb {
  position: absolute;
  left: 6px;
  top: 6px;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 17px;
  color: #fff;
  background: var(--blue);
  box-shadow: 0 4px 12px rgba(52, 125, 245, .2);
  cursor: grab;
  transform: translate3d(var(--swipe-x, 0px), var(--swipe-y, 0px), 0);
  transition: transform 220ms var(--ease-out), background var(--motion-control) ease;
  will-change: transform;
}

.connect-haptic-switch {
  position: absolute;
  z-index: 3;
  left: 6px;
  top: 6px;
  width: 48px;
  height: 48px;
  margin: 0;
  opacity: 0;
  cursor: grab;
  appearance: auto;
  -webkit-appearance: auto;
  clip-path: inset(0 round 17px);
  transform: translate3d(var(--swipe-x, 0px), var(--swipe-y, 0px), 0);
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

.swipe-control.is-dragging .connect-haptic-switch {
  cursor: grabbing;
}

.swipe-thumb:active {
  transform: translate3d(var(--swipe-x, 0px), var(--swipe-y, 0px), 0) scale(.97);
}

.swipe-control.is-dragging .swipe-thumb {
  cursor: grabbing;
  transition-duration: 0ms;
}

.swipe-control--vertical .swipe-thumb {
  left: 12px;
  right: 12px;
  width: auto;
  top: auto;
  bottom: 9px;
  height: 50px;
  border-radius: 18px;
  transform: translate3d(0, var(--swipe-y, 0px), 0);
}

.swipe-control--vertical .swipe-thumb:active {
  transform: translate3d(0, var(--swipe-y, 0px), 0) scale(.985);
}

.swipe-control:not(.is-ready).swipe-control--vertical .swipe-thumb {
  opacity: 0;
  pointer-events: none;
}

.swipe-control[aria-disabled="true"] .swipe-thumb {
  cursor: default;
}

.swipe-thumb svg {
  width: 22px;
  height: 22px;
}

.swipe-thumb path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.sheet-cancel {
  min-height: 50px;
  border: 0;
  border-radius: 18px;
  color: var(--ink-soft);
  background: color-mix(in srgb, var(--ink) 7%, transparent);
  cursor: pointer;
}

.field {
  display: grid;
  gap: 8px;
  margin: 16px 0 10px;
}

.field span {
  color: var(--ink-muted);
  font-size: 12px;
}

.field input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--ink);
  background: var(--panel-subtle);
  outline: none;
}

.field input:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent);
}

.avatar-setting,
.ring-setting {
  margin: 16px 0 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel-subtle);
}

.settings-device-name {
  margin-top: 16px;
}

.device-summary-setting {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-subtle);
}

.device-summary-setting > span {
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 650;
}

.device-summary-setting strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 760;
}

.ring-setting {
  margin-top: 10px;
}

.setting-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.setting-heading strong {
  color: var(--ink);
  font-size: 13px;
}

.setting-heading span {
  color: var(--ink-muted);
  font-size: 11px;
}

.avatar-carousel {
  min-width: 0;
  display: flex;
  gap: 13px;
  overflow-x: auto;
  padding: 8px 5px 12px 3px;
  scroll-padding-inline: 5px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  touch-action: pan-x;
}

.avatar-picker {
  width: min(100%, 354px);
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: start;
  gap: 16px;
  margin-inline: auto;
}

.avatar-upload__button {
  position: relative;
  width: 58px;
  height: 58px;
  display: grid;
  align-items: center;
  justify-content: center;
  justify-self: start;
  margin-top: 8px;
  padding: 2px;
  overflow: visible;
  border: 0;
  border-radius: 50%;
  color: var(--blue);
  background: color-mix(in srgb, var(--blue) 10%, var(--panel-solid));
  box-shadow: 0 7px 18px color-mix(in srgb, var(--shadow-ink) 9%, transparent);
  cursor: pointer;
}

.avatar-upload__button::after {
  content: "";
  position: absolute;
  inset: -3px;
  border: 3px solid transparent;
  border-radius: inherit;
  transition: border-color .18s ease, transform .18s ease;
}

.avatar-upload__button.is-selected::after {
  border-color: var(--blue);
  transform: scale(1.03);
}

.avatar-upload__placeholder,
.avatar-upload__button > img {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: inherit;
}

.avatar-upload__placeholder svg {
  width: 29px;
  height: 29px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.avatar-upload__button > img {
  object-fit: cover;
}

.avatar-upload__badge {
  position: absolute;
  z-index: 2;
  right: -2px;
  bottom: -2px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 3px solid var(--panel-solid);
  border-radius: 50%;
  color: #fff;
  background: var(--blue);
  box-shadow: 0 4px 10px rgba(52, 125, 245, .24);
}

.avatar-upload__badge svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2;
}

.avatar-cropper {
  display: grid;
  justify-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: color-mix(in srgb, var(--panel-solid) 92%, transparent);
}

.avatar-cropper[hidden] {
  display: none;
}

.avatar-cropper__preview {
  padding: 5px;
  border-radius: 50%;
  background: linear-gradient(145deg, #fff, color-mix(in srgb, var(--blue) 28%, #fff));
  box-shadow: 0 12px 30px color-mix(in srgb, var(--shadow-ink) 16%, transparent);
}

.avatar-cropper canvas {
  width: 176px;
  height: 176px;
  display: block;
  border-radius: 50%;
  cursor: grab;
  touch-action: none;
}

.avatar-cropper canvas.is-dragging {
  cursor: grabbing;
}

.avatar-cropper > p {
  margin: -1px 0 0;
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 620;
  text-align: center;
}

.avatar-cropper__zoom {
  width: min(100%, 290px);
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 22px;
  align-items: center;
  gap: 10px;
  color: var(--ink-muted);
}

.avatar-cropper__zoom svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.avatar-cropper__zoom input[type="range"] {
  height: 28px;
  width: 100%;
  accent-color: var(--blue);
  cursor: pointer;
}

.avatar-cropper__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: min(100%, 290px);
}

.avatar-cropper__actions button {
  min-height: 48px;
  padding: 0 14px;
  border-radius: 17px;
  font-size: 13px;
  font-weight: 760;
}

.avatar-cropper__apply.sheet-primary {
  min-height: 48px;
}

.avatar-cropper__cancel {
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--panel);
  box-shadow: var(--card-shadow);
}

.avatar-carousel::-webkit-scrollbar {
  display: none;
}

.avatar-carousel button {
  position: relative;
  flex: 0 0 58px;
  width: 58px;
  height: 58px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.avatar-carousel button::after {
  content: "";
  position: absolute;
  inset: -3px;
  border: 3px solid transparent;
  border-radius: inherit;
  transition: border-color .18s ease, transform .18s ease;
}

.avatar-carousel button.is-selected::after {
  border-color: var(--blue);
  transform: scale(1.03);
}

.avatar-carousel .avatar-animation {
  width: 100%;
  height: 100%;
  border-radius: inherit;
}

.avatar-carousel img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.ring-choice {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ring-choice button {
  position: relative;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

@media (max-width: 380px) {
  .ring-choice {
    gap: 8px;
  }
}

.ring-choice button::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 5px solid var(--panel-solid);
  border-radius: inherit;
  background: var(--swatch);
  box-shadow: 0 0 0 1px var(--line-strong), 0 5px 12px color-mix(in srgb, var(--ink) 10%, transparent);
}

.ring-choice button.is-selected::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid var(--blue);
  border-radius: inherit;
}

.language-choice button,
.motion-choice button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 15px;
  color: var(--ink);
  background: var(--panel-subtle);
}

.language-choice button.is-selected,
.motion-choice button.is-selected {
  border-color: color-mix(in srgb, var(--blue) 42%, var(--line));
  color: var(--blue);
  background: color-mix(in srgb, var(--blue) 10%, var(--panel-subtle));
}

.language-setting,
.motion-setting {
  display: grid;
  gap: 8px;
  margin: 12px 0 10px;
}

.language-setting > span,
.motion-setting > span {
  color: var(--ink-muted);
  font-size: 12px;
}

.language-choice,
.motion-choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.settings-link {
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--ink);
  background: var(--panel-subtle);
  text-align: left;
  cursor: pointer;
}

.settings-link strong,
.settings-link small {
  display: block;
}

.settings-link strong {
  font-size: 13px;
}

.settings-link small {
  margin-top: 3px;
  color: var(--ink-muted);
  font-size: 11px;
}

.settings-link svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
}

.settings-link path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.sheet-primary {
  min-height: 54px;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 19px;
  color: #fff;
  background: linear-gradient(180deg, #4f95ff, var(--blue));
  box-shadow: 0 12px 28px rgba(52, 125, 245, .24);
  font-weight: 760;
  cursor: pointer;
}

.sheet-primary--soft {
  color: var(--purple);
  background: color-mix(in srgb, var(--purple) 11%, transparent);
  box-shadow: none;
}

.sheet-primary--soft svg {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
}

.sheet-primary--soft span {
  min-width: 0;
  line-height: 1.1;
}

.selected-files:not([hidden]) + .send-swipe {
  margin-top: 10px;
}

.send-limit-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -2px 0 4px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.35;
}

.send-limit-hint svg {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--blue);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sheet-primary svg {
  width: 20px;
  height: 20px;
}

.sheet-primary path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.bottom-sheet.is-open:not([hidden]) {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.app-version {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding: 2px 4px 0;
  color: var(--ink-muted);
  font-size: 11px;
}

.app-version strong {
  color: var(--ink-soft);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
