.phone-screen {
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
}

.app-grid-section {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding-bottom: 4px;
  overflow: hidden;
  background: transparent;
  position: relative;
}

.desktop-swiper {
  flex: 1;
  min-height: 0;
  overflow-x: auto;
  overflow-y: hidden;
  display: flex;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0 0 4px;
  margin: 0;
  background: transparent;
  width: 100%;
  user-select: none;
  -webkit-user-select: none;
}

.desktop-swiper::-webkit-scrollbar {
  display: none;
}

.desktop-page {
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  box-sizing: border-box;
  padding: 0 2px 2px;
  background: transparent;
}

.desktop-grid {
  height: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 76px;
  gap: 10px 12px;
  grid-auto-flow: dense;
  align-content: start;
  background: transparent;
}

.desktop-card {
  position: relative;
  min-width: 0;
  min-height: 0;
  touch-action: none;
}

.desktop-card.is-editing,
.desktop-app.is-editing,
.desktop-widget {
  cursor: grab;
}

.desktop-card.is-dragging,
.desktop-card.is-dragging .desktop-app,
.desktop-card.is-dragging .desktop-widget {
  cursor: grabbing;
}

.desktop-card.is-dragging {
  z-index: 6;
  opacity: 0.92;
}

.desktop-card.size-1x1 {
  grid-column: span 1;
  grid-row: span 1;
}

.desktop-card.size-2x1 {
  grid-column: span 2;
  grid-row: span 1;
}

.desktop-card.size-2x2 {
  grid-column: span 2;
  grid-row: span 2;
}

.desktop-app {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  text-decoration: none;
  color: inherit;
  min-height: 100%;
  padding-top: 2px;
  position: relative;
  transform-origin: 50% 18%;
}

.desktop-app.is-editing {
  animation: shake 0.28s ease-in-out infinite alternate;
}

.desktop-app-icon {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 7px;
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.1);
  overflow: hidden;
}

.desktop-app-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.desktop-app-name {
  font-size: 11px;
  line-height: 1.28;
  color: var(--text-main);
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.desktop-delete-btn {
  position: absolute;
  top: -6px;
  right: 2px;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 12px;
  line-height: 1;
  display: none;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.28);
  z-index: 3;
  padding: 0;
}

.desktop-card.show-delete .desktop-delete-btn {
  display: grid;
}

.desktop-widget {
  width: 100%;
  height: 100%;
  border-radius: 22px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.32);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.desktop-widget-image {
  cursor: pointer;
  border: none;
  outline: none;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  background-color: transparent;
}

.desktop-widget-image:focus,
.desktop-widget-image:focus-visible,
.desktop-widget-image:active {
  outline: none;
  border: none;
  box-shadow: none;
  background-color: transparent;
}

.desktop-widget-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: transparent;
}

.desktop-widget-image-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 16px;
  text-align: center;
  color: #475569;
  font-size: 12px;
  line-height: 1.6;
  background: linear-gradient(135deg, rgba(219, 234, 254, 0.8), rgba(252, 231, 243, 0.78));
}

.desktop-widget-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 14px 16px;
  color: #0f172a;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.46));
}

.desktop-widget-text strong {
  font-size: 14px;
  margin-bottom: 4px;
  color: #334155;
}

.desktop-widget-text span {
  font-size: 13px;
  line-height: 1.5;
  color: #475569;
  word-break: break-word;
}

.desktop-widget-edit-tip {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.48);
  color: #fff;
  font-size: 11px;
  line-height: 1;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.desktop-card.is-editing .desktop-widget-edit-tip {
  opacity: 1;
  transform: translateY(0);
}

.desktop-empty-area {
  width: 100%;
  height: 100%;
  min-height: 40px;
}

.desktop-editing-indicator {
  position: absolute;
  top: 8px;
  right: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.14);
  color: #334155;
  font-size: 11px;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 5;
}

.desktop-editing-indicator.visible {
  opacity: 1;
}

.dock {
  flex-shrink: 0;
  margin-top: 0;
}

@keyframes shake {
  0% {
    transform: rotate(-1deg);
  }

  50% {
    transform: rotate(1.5deg);
  }

  100% {
    transform: rotate(-1deg);
  }
}

@media (max-width: 480px) {
  .desktop-grid {
    grid-auto-rows: 72px;
    gap: 8px 8px;
  }

  .desktop-app-icon {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    font-size: 17px;
    margin-bottom: 6px;
  }

  .desktop-app-name {
    font-size: 10px;
  }

  .desktop-widget {
    border-radius: 20px;
  }

  .desktop-widget-text {
    padding: 12px 14px;
  }

  .desktop-widget-text strong {
    font-size: 13px;
  }

  .desktop-widget-text span {
    font-size: 12px;
  }
}
