.bead-wrapper {
    width: 100%;
    max-width: 72rem;
    margin: 0 auto;
    padding: 1rem 2rem;
  }

  .bead-hidden {
    display: none;
  }

  .bead-card {
    position: relative;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(16px);
    border-radius: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.15);
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.2);
  }
  .theme-dark .bead-card {
    background: rgba(17,24,39,0.85);
    border-color: rgba(55,65,81,0.3);
  }

  .bead-top-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0.5rem;
    background: linear-gradient(to right, #ec4899, #a855f7, #6366f1);
  }

  .bead-inner {
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
  }

  .bead-header {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: space-between;
    align-items: flex-end;
  }
  .bead-header-title h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
  }

  .theme-dark .bead-header-title h2 {
    color: #fff;
  }

  .bead-header-title p {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0.25rem 0 0;
  }

  .theme-dark .bead-header-title p {
    color: #9ca3af;
  }

  .bead-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
  }

  .bead-control-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 9rem;
  }

  .bead-control-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #6b7280;
  }

  .bead-slider-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #f3f4f6;
    padding: 0.5rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
  }

  .theme-dark .bead-slider-row {
    background: #1f2937;
    border-color: #374151;
  }

  .bead-slider {
    flex: 1;
    height: 0.5rem;
    border-radius: 0.5rem;
    appearance: none;
    cursor: pointer;
    background: #d1d5db;
  }

  .theme-dark .bead-slider {
    background: #4b5563;
  }

  .bead-slider-pink {
    accent-color: #ec4899;
  }

  .bead-slider-purple {
    accent-color: #a855f7;
  }

  .bead-slider-val {
    font-size: 0.875rem;
    font-weight: 700;
    width: 2rem;
    text-align: center;
  }
  .bead-val-pink {
    color: #ec4899;
  }

  .bead-val-purple {
    color: #a855f7;
  }

  .bead-options-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    height: 2.625rem;
    background: #f3f4f6;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
  }

  .theme-dark .bead-options-row {
    background: #1f2937;
    border-color: #374151;
  }

  .bead-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 700;
    color: #374151;
    white-space: nowrap;
  }

  .theme-dark .bead-checkbox-label {
    color: #d1d5db;
  }

  .bead-checkbox {
    width: 1rem;
    height: 1rem;
    accent-color: #ec4899;
    cursor: pointer;
  }

  .bead-divider {
    width: 1px;
    height: 100%;
    background: #d1d5db;
  }

  .theme-dark .bead-divider {
    background: #4b5563;
  }

  .bead-download-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: #4f46e5;
    color: #fff;
    border: none;
    border-radius: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(79,70,229,0.3);
    transition: background 0.2s, box-shadow 0.2s;
    white-space: nowrap;
  }

  .bead-download-btn:hover {
    background: #4338ca;
  }

  .bead-download-btn:disabled {
    opacity: 0.5;
    box-shadow: none;
    cursor: not-allowed;
  }

  .bead-canvas-area {
    position: relative;
    min-height: 25rem;
    display: flex;
    flex-direction: column;
    gap: 3rem;
  }

  .bead-drop-zone {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 3px dashed #d1d5db;
    border-radius: 1rem;
    min-height: 25rem;
    background: rgba(255,255,255,0.5);
    backdrop-filter: blur(4px);
    transition: border-color 0.2s, background 0.2s, transform 0.2s;
    cursor: pointer;
  }
  .theme-dark .bead-drop-zone {
    border-color: #374151;
    background: rgba(31,41,55,0.5);
  }

  .bead-drop-zone:hover,
  .bead-drop-active {
    border-color: #ec4899;
    background: rgba(236,72,153,0.04);
    transform: scale(1.01);
  }

  .bead-file-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 1;
  }

  .bead-drop-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    pointer-events: none;
  }

  .bead-upload-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 5rem;
    height: 5rem;
    background: linear-gradient(135deg, #f472b6, #a855f7);
    border-radius: 50%;
    box-shadow: 0 8px 20px rgba(168,85,247,0.3);
    color: #fff;
  }

  .bead-drop-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #374151;
    margin: 0;
  }

  .theme-dark .bead-drop-content h3 {
    color: #e5e7eb;
  }

  .bead-drop-content p {
    color: #6b7280;
    margin: 0;
  }

  .bead-result {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    animation: bead-fade-in 0.5s ease;
  }

  @keyframes bead-fade-in {
    from {
      opacity: 0;
      transform: scale(0.98);
    }

    to {
      opacity: 1;
      transform: scale(1);
    }
  }

  .bead-result-inner {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
  }

  @media (max-width: 640px) {
    .bead-result-inner {
      flex-direction: column;
    }
  }

  .bead-palette-col {
    width: 12rem;
    flex-shrink: 0;
  }

  .bead-palette-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    margin: 0 0 0.75rem;
  }

  .bead-palette-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
  }

  .bead-palette-item {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .bead-color-swatch {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    border: 2px solid #fff;
    outline: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .theme-dark .bead-color-swatch {
    border-color: #1f2937;
    outline-color: #374151;
  }

  .bead-symbol {
    font-size: 0.75rem;
    font-weight: 700;
    user-select: none;
  }
  .bead-symbol-dark {
    color: #000;
  }

  .bead-symbol-light {
    color: #fff;
  }

  .bead-reupload-btn {
    margin-top: 1.5rem;
    width: 100%;
    padding: 0.5rem;
    font-size: 0.875rem;
    font-weight: 700;
    color: #6b7280;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: color 0.2s, border-color 0.2s;
  }

  .bead-reupload-btn:hover {
    color: #ec4899;
    border-color: #f9a8d4;
  }

  .bead-canvas-col {
    flex: 1;
    background: #f3f4f6;
    padding: 1rem;
    border-radius: 0.75rem;
    border: 2px solid #e5e7eb;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.06);
    overflow-x: auto;
    text-align: center;
  }

  .theme-dark .bead-canvas-col {
    background: #030712;
    border-color: #1f2937;
  }

  .bead-canvas {
    display: inline-block;
    max-width: 100%;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    cursor: crosshair;
    image-rendering: pixelated;
  }

  .bead-tunnel-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 0.75rem;
  }

  .theme-dark .bead-tunnel-bar {
    background: rgba(79,70,229,0.1);
    border-color: rgba(99,102,241,0.3);
  }

  .bead-tunnel-title {
    font-weight: 700;
    color: #312e81;
    margin: 0;
  }

  .theme-dark .bead-tunnel-title {
    color: #c7d2fe;
  }

  .bead-tunnel-sub {
    font-size: 0.875rem;
    color: #4338ca;
    margin: 0.25rem 0 0;
  }

  .theme-dark .bead-tunnel-sub {
    color: #818cf8;
  }

  .bead-tunnel-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
  }

  .bead-tunnel-btn {
    padding: 0.5rem;
    border-radius: 0.5rem;
    border: none;
    background: #fff;
    color: #4f46e5;
    cursor: pointer;
    transition: background 0.15s;
  }

  .bead-tunnel-btn:hover {
    background: #e0e7ff;
  }

  .theme-dark .bead-tunnel-btn {
    background: #1f2937;
    color: #818cf8;
  }

  .bead-tunnel-display {
    padding: 0.5rem 1rem;
    background: #fff;
    border-radius: 0.5rem;
    font-weight: 700;
    color: #4f46e5;
    border: 1px solid #c7d2fe;
    min-width: 3rem;
    text-align: center;
  }

  .theme-dark .bead-tunnel-display {
    background: #1f2937;
    color: #818cf8;
    border-color: rgba(99,102,241,0.3);
  }