body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    color: #334155;
  }
  
  .app {
    display: flex;
    height: 100vh;
    position: relative;
  }
  
  /* Mobile Menu Button */
  #menuToggle {
    display: none;
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 20;
    width: 40px;
    height: 40px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    padding: 0;
  }

  #menuToggle span {
    width: 20px;
    height: 2px;
    background-color: #334155;
    border-radius: 2px;
  }

  .sidebar {
    width: 320px;
    overflow-y: auto;
    background: #f8fafc;
    border-right: 1px solid #e2e8f0;
    padding: 20px;
    flex-shrink: 0;
    transition: transform 0.3s ease;
  }
  
  .section {
    margin-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 12px;
  }

  .section:last-child {
    border-bottom: none;
  }
  
  .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 8px 4px;
    user-select: none;
  }

  .section h3 {
    margin: 0;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #475569; /* Darker color */
    font-weight: 700; /* Bolder */
  }

  .accordion-icon {
    font-size: 10px;
    color: #94a3b8;
    transition: transform 0.2s ease;
  }

  /* Accordion functionality */
  .file-list {
    display: none;
    margin-top: 8px;
  }

  .section.open .file-list {
    display: block;
  }

  .section.open .accordion-icon {
    transform: rotate(180deg);
  }
  
  button {
    display: block;
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 4px;
    text-align: left;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    border-radius: 6px;
    font-size: 14px;
    color: #475569;
    text-transform: capitalize;
    transition: all 0.2s ease;
  }
  
  button:hover {
    background: #e2e8f0;
    color: #1e293b;
  }
  
  button.active {
    background: #fff;
    border-color: #cbd5e1;
    color: #0f172a;
    font-weight: 500;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  }
  
  .preview {
    flex: 1;
    background: #e2e8f0;
    display: flex;
    flex-direction: column; /* Changed to column to stack toolbar and iframe */
    align-items: center;
    padding: 20px;
    position: relative;
    overflow: hidden; /* Prevent full page scroll if iframe gets long */
  }

  /* Toolbar Styles */
  .toolbar {
    margin-bottom: 20px;
    background: white;
    padding: 8px;
    border-radius: 8px;
    display: flex;
    gap: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    z-index: 10;
  }

  .icon-btn {
    width: auto;
    padding: 6px 12px;
    margin: 0;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    background: transparent;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #64748b;
  }

  .icon-btn:hover {
    background: #f1f5f9;
    color: #334155;
  }

  .icon-btn.active {
    background: #e2e8f0;
    color: #0f172a;
    font-weight: 600;
  }

  /* Iframe Container */
  .iframe-container {
    flex: 1;
    width: 100%;
    display: flex;
    justify-content: center;
    overflow: hidden;
  }

  iframe {
    width: 100%;
    max-width: 800px; /* Desktop default */
    height: 100%;
    background: white;
    border: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border-radius: 8px;
    transition: max-width 0.3s ease, height 0.3s ease;
  }

  /* Mobile View State */
  iframe.mobile-view {
    max-width: 375px;
    border-radius: 30px;
    border: 8px solid #334155;
    box-sizing: content-box; /* Ensures border doesn't eat into width */
  }

  @media (max-width: 768px) {
    /* ... existing mobile styles ... */
    #menuToggle {
      display: flex;
    }

    .sidebar {
      position: absolute;
      top: 0;
      left: 0;
      height: 100%;
      z-index: 10;
      transform: translateX(-100%);
      box-shadow: 4px 0 15px rgba(0,0,0,0.1);
    }

    .sidebar.open {
      transform: translateX(0);
    }

    .toolbar {
        display: none; /* Hide toolbar on actual mobile devices since width is already constrained */
    }
    
    .preview {
        padding: 20px 10px; /* Reduce padding on mobile */
        padding-top: 70px;
    }
    
    iframe {
        max-width: 100%; /* Force full width on mobile devices */
        border-radius: 4px;
    }
  }