html, body {
  width: 100%;
  overflow-x: hidden;
}

body {
    font-family: "Segoe UI", sans-serif;
    margin: 0;
    padding: 0;
  }

  main {
    display: flex;
    gap: 1.5rem;
    padding: 2rem 1.5rem 5rem; 
    max-width:1650px; 
    margin:0 auto;
  }

  /* Explorer (pastas e arquivos) */
  .explorer {
    flex: 0 0 35%;
    max-width: 530px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    padding: 1rem;
  }

  .folder {
    margin-bottom: 10px;
  }

  .folder-header {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    box-shadow: 0 6px 12px rgba(0,0,0,0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
  }

  .folder-header:hover { background: #f8f9fa; }

  .files {
    margin-top: 0.5rem;
    margin-left: 1.5rem;
    display: none;
  }

  .file {
    padding: 0.4rem 0.5rem;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #eee;
    cursor: pointer;
  }

  .file:hover { background: #f8f9fa; }

  .file span { display: flex; align-items: center; gap: 0.5rem; }
  .file small { color: #777; }

  /* Preview lateral desktop */
  .preview {
    flex: 3;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .preview-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.8rem;
    background: #f3f4f6;
    border-bottom: 1px solid #ddd;
  }

  .preview-header .btn-action.disabled {
    opacity: 0.45;
    pointer-events: none;
    filter: grayscale(70%);
    transform: none;
  }

  .btn-action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;              /* mesmo tamanho para todos */
    height: 20px;
    background: none;
    border: none;
    cursor: pointer;
    transition: transform 0.25s ease, filter 0.25s ease;
    padding: 0;
  }

  .btn-action img,
  .btn-action svg {
    width: 20px;
    height: 20px;
    object-fit: contain;
    pointer-events: none;
  }

  .btn-action:hover {
    transform: scale(1.15);
    filter: brightness(1.2);
  }

  #btn-close {
    font-size: 20px;
    line-height: 1;
  }

  .preview-body {
    flex: 1;
    padding: 1rem;
    overflow: auto;
  }
  .preview-body iframe {
    width: 100%;
    height: 80vh;
    border: none;
  }

  /* Responsividade mobile */
  @media (min-width: 768px) and (max-width: 991px) {
    main {
      padding: 2rem;
      margin: 2rem 4rem;
    }
  }

  @media(max-width:991px){
    main { flex-direction: column; }
    .explorer, .preview { width: 100%; min-width: unset; }
    .preview { display: none !important; }
    .explorer { width: 100%; max-width: none; flex: none; margin-bottom: 1rem; }
    .file span { flex-wrap: wrap; word-break: break-word; }
  }

  @media(min-width:1800px){
    main {
      padding: 3rem 3rem 6rem;
    }
  }
