    * { box-sizing: border-box; margin: 0; padding: 0; }
    body { 
      font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
      background: #f0f2f5;
      color: #1a1a1a;
      height: 100vh;
      width: 100vw;
      overflow: hidden;
      display: flex;
      justify-content: center;
      align-items: center;
    }

    /* Canvas Background */
    #canvas-container {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      z-index: 0;
      background: radial-gradient(circle at 50% 50%, #ffffff 0%, #e6e9f0 100%);
    }
    
    #canvas {
      width: 100%;
      height: 100%;
    }

    /* Branding */
    #branding {
      position: absolute;
      top: 30px;
      left: 30px;
      z-index: 20;
      font-size: 24px;
      font-weight: 600;
      color: #1a1a1a;
      display: flex;
      flex-direction: column;
      gap: 4px;
    }
    
    #branding .subtitle {
      font-size: 14px;
      font-weight: 400;
      color: #666;
      opacity: 0.8;
    }

    /* UI Overlay */
    #ui-layer {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      z-index: 10;
      pointer-events: none; /* Let clicks pass through to canvas where not interacting */
      display: flex;
      flex-direction: column;
      justify-content: flex-end;
      align-items: center;
      padding-bottom: 40px;
    }

    /* Start Overlay */
    #start-overlay {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(255, 255, 255, 0.9);
      backdrop-filter: blur(30px);
      z-index: 100;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      transition: opacity 0.5s ease;
      padding: 20px;
    }

    .start-card {
      max-width: 600px;
      text-align: center;
      display: flex;
      flex-direction: column;
      gap: 24px;
      align-items: center;
    }

    .start-title {
      font-size: 42px;
      font-weight: 700;
      color: #1a1a1a;
      letter-spacing: -1px;
    }

    .start-intro {
      font-size: 18px;
      line-height: 1.6;
      color: #444;
      font-weight: 400;
    }

    .start-motivation {
      font-size: 15px;
      line-height: 1.6;
      color: #666;
      background: rgba(0,0,0,0.03);
      padding: 20px;
      border-radius: 16px;
      margin: 10px 0;
    }

    .contact-links {
      display: flex;
      gap: 20px;
      margin-top: 10px;
    }

    .contact-link {
      font-size: 14px;
      color: #1a1a1a;
      text-decoration: none;
      font-weight: 600;
      opacity: 0.6;
      transition: opacity 0.2s;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .contact-link:hover { opacity: 1; }

    #start-btn {
      margin-top: 20px;
      padding: 18px 50px;
      font-size: 20px;
      font-weight: 500;
      letter-spacing: 0.5px;
      color: #fff;
      background: #1a1a1a;
      border: none;
      border-radius: 100px;
      cursor: pointer;
      transition: all 0.3s ease;
      box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    }

    #start-btn:hover {
      transform: translateY(-2px);
      box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
    }

    /* Chat Bubbles (Side) */
    #chat-container {
      position: absolute;
      top: 0;
      right: 0;
      width: 400px;
      height: 100%;
      padding: 40px;
      display: flex;
      flex-direction: column;
      justify-content: flex-end;
      pointer-events: none;
      mask-image: linear-gradient(to bottom, transparent 0%, black 20%);
      -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 20%);
    }

    #messages {
      display: flex;
      flex-direction: column;
      gap: 20px;
      overflow-y: auto;
      padding-bottom: 150px; /* Space for input */
      pointer-events: auto;
    }

    /* Hide scrollbar */
    #messages::-webkit-scrollbar {
      display: none;
    }

    .message {
      max-width: 100%;
      padding: 16px 24px;
      border-radius: 24px;
      font-size: 16px;
      line-height: 1.5;
      font-weight: 400;
      animation: slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
      backdrop-filter: blur(20px);
      box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    }

    @keyframes slideIn {
      from { opacity: 0; transform: translateY(20px) scale(0.95); }
      to { opacity: 1; transform: translateY(0) scale(1); }
    }

    .message.user {
      align-self: flex-end;
      background: rgba(0, 0, 0, 0.05);
      color: #1a1a1a;
      border-bottom-right-radius: 4px;
      border: 1px solid rgba(0, 0, 0, 0.05);
    }

    .message.character {
      align-self: flex-start;
      background: rgba(255, 255, 255, 0.6);
      color: #1a1a1a;
      border-bottom-left-radius: 4px;
      border: 1px solid rgba(255, 255, 255, 0.4);
    }

    .message.system {
      align-self: center;
      background: transparent;
      font-size: 12px;
      color: rgba(0, 0, 0, 0.4);
      box-shadow: none;
      backdrop-filter: none;
      padding: 5px;
      text-transform: uppercase;
      letter-spacing: 1px;
    }

    /* Input Area (Bottom Middle) */
    #input-container {
      pointer-events: auto;
      width: 600px;
      max-width: 90%;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 12px;
      margin-bottom: 40px;
      position: relative;
      z-index: 20;
    }

    .input-wrapper {
      width: 100%;
      position: relative;
      display: flex;
      align-items: center;
      gap: 10px;
    }

    #messageInput {
      width: 100%;
      background: rgba(255, 255, 255, 0.6);
      border: 1px solid rgba(255, 255, 255, 0.4);
      border-radius: 20px;
      padding: 20px 60px 20px 30px; /* Right padding for button */
      color: #1a1a1a;
      font-size: 18px;
      font-family: inherit;
      outline: none;
      backdrop-filter: blur(20px);
      box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
      transition: all 0.3s ease;
      text-align: left;
    }

    #messageInput::placeholder {
      color: rgba(0, 0, 0, 0.4);
    }

    #messageInput:focus {
      background: rgba(255, 255, 255, 0.8);
      border-color: rgba(0, 0, 0, 0.1);
      box-shadow: 0 30px 60px rgba(0, 0, 0, 0.15);
      transform: translateY(-2px);
    }

    #send-btn {
      position: absolute;
      right: 10px;
      top: 50%;
      transform: translateY(-50%);
      background: transparent;
      border: none;
      cursor: pointer;
      padding: 10px;
      border-radius: 50%;
      color: #1a1a1a;
      opacity: 0.6;
      transition: all 0.2s ease;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    #send-btn:hover {
      background: rgba(0, 0, 0, 0.05);
      opacity: 1;
    }

    #send-btn svg {
      width: 20px;
      height: 20px;
      fill: currentColor;
    }
    
    #mic-btn {
      width: 50px;
      height: 50px;
      border-radius: 50%;
      background: rgba(255, 255, 255, 0.6);
      border: 1px solid rgba(255, 255, 255, 0.4);
      backdrop-filter: blur(20px);
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: all 0.3s ease;
      color: #1a1a1a;
      box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    }
    
    #mic-btn:hover {
      background: rgba(255, 255, 255, 0.9);
      transform: scale(1.05);
    }
    
    #mic-btn.recording {
      background: #ef4444;
      color: white;
      animation: pulse-red 1.5s infinite;
    }
    
    @keyframes pulse-red {
      0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
      70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
      100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
    }
    
    #waveform-container {
      position: absolute;
      bottom: 80px;
      left: 50%;
      transform: translateX(-50%);
      width: 300px;
      height: 60px;
      background: rgba(0,0,0,0.5);
      backdrop-filter: blur(10px);
      border-radius: 30px;
      display: none;
      align-items: center;
      justify-content: center;
      z-index: 30;
    }
    
    #waveform-container.visible {
      display: flex;
    }
    
    #waveform {
      width: 100%;
      height: 100%;
    }

    /* Status Area (in Chat Container) */
    #status-area {
      width: 100%;
      display: flex;
      flex-direction: column;
      align-items: flex-end;
      gap: 4px;
      min-height: 40px;
      margin-top: 10px;
      padding-right: 10px;
    }

    .status-message {
      font-size: 12px;
      color: rgba(0, 0, 0, 0.7);
      font-weight: 500;
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 8px;
      opacity: 0;
      transform: translateY(5px);
      transition: all 0.3s ease;
    }

    .status-message.visible {
      opacity: 1;
      transform: translateY(0);
    }
    
    #status-label {
      animation: pulse-text 1.5s infinite ease-in-out;
    }
    
    @keyframes pulse-text {
      0%, 100% { opacity: 1; }
      50% { opacity: 0.6; }
    }

    .loading-dots span {
      font-size: 18px;
      animation: dots 1.4s infinite;
      opacity: 0;
    }
    .loading-dots span:nth-child(2) { animation-delay: 0.2s; }
    .loading-dots span:nth-child(3) { animation-delay: 0.4s; }

    @keyframes dots {
      0% { opacity: 0; }
      50% { opacity: 1; }
      100% { opacity: 0; }
    }

    .motion-stats {
      font-size: 13px;
      color: rgba(0, 0, 0, 0.5);
      margin-top: 4px;
      text-align: right;
      font-weight: 500;
    }

    /* Settings Sidebar */
    #settings-sidebar {
      position: fixed;
      top: 0;
      left: 0;
      width: 320px;
      height: 100%;
      background: rgba(255, 255, 255, 0.95);
      backdrop-filter: blur(20px);
      box-shadow: 5px 0 30px rgba(0,0,0,0.1);
      z-index: 100;
      transform: translateX(-100%);
      transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      padding: 20px;
      display: flex;
      flex-direction: column;
      gap: 20px;
      overflow-y: auto;
      pointer-events: auto;
    }
    
    #settings-sidebar.visible {
      transform: translateX(0);
    }
    
    .sidebar-header {
      font-size: 20px;
      font-weight: 600;
      margin-bottom: 10px;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
    
    .close-sidebar {
      background: none;
      border: none;
      cursor: pointer;
      padding: 5px;
      opacity: 0.5;
    }
    
    .close-sidebar:hover { opacity: 1; }

    .setting-group {
      display: flex;
      flex-direction: column;
      gap: 8px;
      padding-bottom: 15px;
      border-bottom: 1px solid rgba(0,0,0,0.05);
    }
    
    .setting-label {
      font-size: 12px;
      font-weight: 600;
      color: #666;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }
    
    .setting-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      font-size: 14px;
    }

    /* Drag and Drop VRM */
    #vrm-drop-zone {
      width: 100%;
      height: 100px;
      border: 2px dashed rgba(0,0,0,0.1);
      border-radius: 12px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 5px;
      color: #666;
      font-size: 13px;
      transition: all 0.2s;
      cursor: pointer;
      text-align: center;
      padding: 10px;
    }
    
    #vrm-drop-zone:hover, #vrm-drop-zone.dragover {
      border-color: #1a1a1a;
      background: rgba(0,0,0,0.02);
    }
    
    /* Textareas for prompts */
    .prompt-box {
      width: 100%;
      height: 80px;
      border: 1px solid rgba(0,0,0,0.1);
      border-radius: 8px;
      padding: 8px;
      font-family: inherit;
      font-size: 12px;
      resize: vertical;
      background: rgba(255,255,255,0.5);
    }

    /* Settings Button (Bottom Left) */
    #settings-toggle-btn {
      position: absolute;
      bottom: 30px;
      left: 30px;
      z-index: 50;
      background: rgba(255, 255, 255, 0.8);
      backdrop-filter: blur(10px);
      border: 1px solid rgba(255, 255, 255, 0.4);
      padding: 10px 20px;
      border-radius: 30px;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 14px;
      font-weight: 500;
      color: #1a1a1a;
      box-shadow: 0 5px 20px rgba(0,0,0,0.05);
      transition: all 0.2s;
      pointer-events: auto;
    }
    
    #settings-toggle-btn:hover {
      transform: translateY(-2px);
      box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    }

    /* Motion Only Toggle */
    .motion-toggle-container {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-top: 10px;
      font-size: 13px;
      color: rgba(0,0,0,0.6);
      pointer-events: auto;
    }

    /* Footer */
    #footer {
      position: absolute;
      bottom: 10px;
      left: 50%;
      transform: translateX(-50%);
      font-size: 11px;
      color: rgba(0,0,0,0.3);
      pointer-events: none;
      z-index: 10;
    }

    /* Waveform */
    #waveform-container {
      position: absolute;
      bottom: 90px;
      left: 50%;
      transform: translateX(-50%);
      width: 200px;
      height: 50px;
      display: none;
      align-items: center;
      justify-content: center;
      z-index: 30;
      pointer-events: none;
    }
    
    #waveform-container.visible { display: flex; }
    
    #waveform { width: 100%; height: 100%; }

    /* Hide old settings */
    #settings-btn, #settings-menu { display: none !important; }
    
    /* Status Dot Container */
    #status-container {
      position: absolute;
      top: 30px;
      right: 30px;
      display: flex;
      align-items: center;
      gap: 8px;
      z-index: 20;
    }

    #status-dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: #ccc;
      transition: background 0.3s ease;
    }
    
    #status-text {
      font-size: 16px;
      color: rgba(0,0,0,0.5);
      font-weight: 500;
    }
    
    #status-dot.connected { background: #4ade80; box-shadow: 0 0 24px #4ade80; }
    #status-dot.disconnected { background: #ef4444; }
    #status-dot.processing { background: #fbbf24; animation: pulse 1s infinite; }

    @keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
