.app-icon .example-selector {
  background: #ffffff;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  margin: 24px 0;
  /* display: flex; */
  gap: 32px;
  align-items: flex-start;
}

.app-icon .full-preview-section {
  padding-top: 24px;
}

.app-icon .icon-preview-large {
  width: 256px;
  height: 256px;
  border-radius: 20%;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  display: block;
}

.app-icon .preview-label {
  margin-top: 12px;
  font-size: 0.85rem;
  opacity: 0.7;
}

.app-icon .example-selector h3 {
  margin-top: 0;
}

@media (max-width: 768px) {
  .app-icon .example-selector {
    flex-direction: column;
  }
  .app-icon .example-selector-right {
    width: 100%;
  }
}

.app-icon .btn-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.app-icon .btn {
  padding: 12px 24px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  background: transparent;
  color: inherit;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-icon .btn:hover {
  border-color: #2196f3;
  background: rgba(0, 0, 0, 0.04);
}

.app-icon .btn.active {
  border-color: #2196f3;
  background: rgba(0, 0, 0, 0.06);
}

.app-icon .btn img {
  width: 32px;
  height: 32px;
  border-radius: 6px;
}

.app-icon .download-icon-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  opacity: 0.4;
  transition: opacity 0.2s ease;
  text-decoration: none;
}

.app-icon .download-icon-inline img {
  width: 18px;
  height: 18px;
  display: block;
}

.app-icon .download-icon-inline:hover {
  opacity: 1;
}

.app-icon .btn:hover .download-icon-inline {
  opacity: 0.6;
}

/* Upload Zone - Secondary Style */
.app-icon .upload-section {
  margin-top: 32px;
}

.app-icon .upload-zone {
  border: 2px dashed rgba(0, 0, 0, 0.2);
  padding: 20px;
  text-align: center;
  background: rgba(0, 0, 0, 0.02);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.app-icon .upload-zone:hover {
  border-color: #2196f3;
  background: rgba(0, 0, 0, 0.04);
}

.app-icon .upload-zone p {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.75;
}

.app-icon .upload-zone strong {
  color: #2196f3;
}

/* Diagram Section */
.app-icon .diagram-section {
  background: #ffffff;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  margin: 24px 0;
  text-align: center;
}

.app-icon .diagram-section h3 {
  margin-top: 0;
  text-align: left;
}

.app-icon .diagram-container {
  display: inline-block;
  position: relative;
}

.app-icon .diagram-legend {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 16px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  opacity: 0.8;
}

.app-icon .legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.app-icon .legend-color {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.18);
}

/* Preview Grid */
.app-icon .preview-section {
  margin-top: 32px;
}

.app-icon .preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.app-icon .icon-card {
  background: #ffffff;
  padding: 16px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

/* The Secret Sauce: Masking logic */
.app-icon .icon-wrapper {
  width: 100px;
  height: 100px;
  margin: 0 auto 12px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
}

html.dark .app-icon .example-selector,
html.rp-dark .app-icon .example-selector {
  background: #1b1b1b;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

html.dark .app-icon .diagram-section,
html.rp-dark .app-icon .diagram-section {
  background: #1b1b1b;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

html.dark .app-icon .icon-card,
html.rp-dark .app-icon .icon-card {
  background: #1b1b1b;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.45);
}

html.dark .app-icon .btn,
html.rp-dark .app-icon .btn {
  border-color: rgba(255, 255, 255, 0.22);
}

html.dark .app-icon .btn:hover,
html.rp-dark .app-icon .btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

html.dark .app-icon .btn.active,
html.rp-dark .app-icon .btn.active {
  background: rgba(255, 255, 255, 0.12);
}

html.dark .app-icon .upload-zone,
html.rp-dark .app-icon .upload-zone {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.04);
}

html.dark .app-icon .upload-zone:hover,
html.rp-dark .app-icon .upload-zone:hover {
  background: rgba(255, 255, 255, 0.08);
}

html.dark .app-icon .legend-color,
html.rp-dark .app-icon .legend-color {
  border-color: rgba(255, 255, 255, 0.2);
}

html.dark .app-icon .icon-wrapper,
html.rp-dark .app-icon .icon-wrapper {
  background: rgba(255, 255, 255, 0.08);
}

html.dark .app-icon .download-icon-inline img,
html.rp-dark .app-icon .download-icon-inline img {
  filter: invert(1) brightness(0.9);
}

.app-icon .icon-wrapper img {
  width: 150%;
  height: 150%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  position: relative;
  transform-origin: center;
  cursor: auto;
  touch-action: auto;
  user-select: none;
  -webkit-user-drag: none;
  /* Firefox fix: prevent flex container from shrinking the bleed area */
  flex-shrink: 0;
  /* Firefox fix: force composite layer so full bounds render during translate */
  will-change: transform;
  backface-visibility: hidden;
}

/* Shape definitions */
.app-icon .legacy {
  border-radius: 0;
}

.app-icon .circle {
  border-radius: 50%;
}

.app-icon .square {
  border-radius: 12%;
}

.app-icon .rounded-square {
  border-radius: 25%;
}

.app-icon .squircle {
  clip-path: url(#squirclePath);
  border-radius: 20%;
}

.app-icon .ios-app-icon {
  border-radius: 22.5%;
}

.app-icon .icon-wrapper.drag-enabled {
  touch-action: none;
}

.app-icon .icon-wrapper.drag-enabled img {
  cursor: grab;
  touch-action: none;
}

.app-icon .icon-wrapper img.dragging {
  cursor: none;
}

.app-icon.cursor-hidden,
.app-icon.cursor-hidden * {
  cursor: none !important;
}

.app-icon .icon-card label {
  font-weight: 600;
  font-size: 0.8rem;
  opacity: 0.75;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
